ASN

Notes by Akhil Saji

How to install OpenVPN Client on OMV (openmediavault)

OMV (openmediavault) is an open source NAS operating system based on Debian. If you're not familiar with it, head here and check it out.

This tutorial assumes basic knowledge of Linux and root access to your OMV server. Lets get started.

  1. Installing OpenVPN (as root)

    apt-get install openvpn

  2. After installing OpenVPN, you'll want to obtain the VPN certificate files. These should be provided to you by your VPN provider. My personal recommendation is PIA. If you choose to utilize PIA, you can download the necessary files here.

  3. At this point you'll want to transfer the certificate files over to your server either using SCP or some other mechanism. I personally recommend directly downloading it on the server with wget and then unzipping it with unzip.

  4. From your extracted files, move ca.crt, crl.pem, vpn.ovpn to /etc/openvpn/ (Note: vpn.ovpn refers to whatever VPN server you're looking to connect to)

  5. edit the vpn.ovpn file using whatever editor you prefer and replace the line

    auth-user-pass
    with
    auth-user-pass login.txt
    Save and close the file.

  6. Next, create login.txt in /etc/openvpn and place your username on the first line, and your password on the second line. These should be provided to you by your VPN provider.

    Username
    Password

  7. Now change the extension of vpn.ovpn file to vpn.conf

    mv vpn.ovpn vpn.conf

  8. To ensure that OpenVPN connects to this VPN on start, we must edit the openvpn configuration file. Open /etc/default/openvpn in your editor of choice and add the entry AUTOSTART=vpn where vpn refers to the vpn.conf file in /etc/openvpn/. Adding this entry will allow openvpn to search for this configuration file on start and run it.

  9. Lets test our handywork. Start and run openvpn

    openvpn /etc/openvpn/vpn.conf

  10. Now test the connection using

    curl -s http://ifconfig.me
    You should see a different WAN IP which represents your VPN IP.

  11. Now restart openvpn and be set

    /etc/init.d/openvpn restart


Installing and Running ESSNet on Mac OSX

ESSNet is a program that was developed by Dr. Lim et al. at the University of Singapore for studying relationships between entities in biological pathways.

  1. Install Homebrew if you don't have it installed already. The instructions on their website should suffice.

  2. The first package we will install is R. In order to gain access to the R installer under homebrew, you need to add the following repository.

    brew tap homebrew/science

  3. Once the repository is added run the following command. The prompts during the installation will guide you through the necessary steps.

    brew install r

  4. Once you have R installed, type r then enter to initiate the r shell. If the installation went successfully, you should be greeted by the r shell.

  5. Next we need to install the R dependencies that ESSNet relies on and are avaliable on the R distribution network. In the prompt, type the following commands.

    install.packages("rJava")
    install.packages("igraph")
    

    You may be prompted to selected a CRAN mirror. If so, select a mirror that is closest to your geographical location for the fastest download times.

  6. After the packages are installed, type q() to exit the r shell.

  7. Next, install Apache ant

    brew install ant

  8. Finally, make sure that you have JDK 7 installed.

  9. ESSNet relies on another package called PFSnet which we need to install before we install ESSnet. Change directory to a writeable folder such as ~/Downloads and run the following in terminal:

    curl -o pfsnet.tar.gz 'http://compbio.ddns.comp.nus.edu.sg/~intpath/ftp/Storage/pfsnet_1.0.tar.gz'
    tar xvzf pfsnet.tar.gz
    r CMD install pfsnet

    If successful, you will receive output similar to this:

    asaji@asaji:~/Downloads$ r CMD install pfsnet
    installing to library ‘/usr/local/Cellar/r/3.1.0/R.framework/Versions/3.1/Resources/library’
    installing source package ‘pfsnet’ ...
    libs
    ant clean
    Buildfile: /Users/asaji/Downloads/pfsnet/src/build.xml

    clean:

    BUILD SUCCESSFUL Total time: 0 seconds R inst preparing package for lazy loading help installing help indices building package indices testing if installed package can be loaded DONE (pfsnet)

  10. Now we can download and install ESSNet. Once again, make sure you are in a writeable directory and run the following commands in terminal:

    curl -o essnet.tar.gz 'http://compbio.ddns.comp.nus.edu.sg:8080/essnet/downloads/essnet_1.0.tar.gz'
    tar xvzf essnet.tar.gz
    r CMD install essnet

    If successful, you will receive output similar to this:

    asaji@asaji:~/Downloads$ r CMD install essnet
    * installing to library ‘/usr/local/Cellar/r/3.1.0/R.framework/Versions/3.1/Resources/library’
    * installing source package ‘essnet’ ...
    ** libs
    ant clean
    Buildfile: /Users/asaji/Downloads/essnet/src/build.xml

    clean:

    BUILD SUCCESSFUL Total time: 0 seconds R inst preparing package for lazy loading help Warning: /Users/asaji/Downloads/essnet/man/essnet-package.Rd:33: All text must be in a section Warning: /Users/asaji/Downloads/essnet/man/essnet-package.Rd:34: All text must be in a section installing help indices building package indices testing if installed package can be loaded DONE (essnet)

  11. You should now be able to successfully run ESSnet in R.


Instituting Local and Production Django Settings files

If you do any of your dynamic web development in Django, maintaining separate settings files for your production and development environments is essential. Here I will detail my setup for this process.

1. Create two files called settings_local.py and settings_production.py for your development environment and production environment respectively.

2. In both files, put in the respective Django settings you need. For example in development you might be using SQLite3 as your database but in production you would use PostgreSQL and therefore the database settings would be different.

3. Next, in your settings.py put in the following code

try:
        from settings_local import *
except ImportError:
        try:
                from settings_server import *
        except ImportError:
                pass

4. Finally, ensure that your settings_local.py is excluded from your source management system (i.e git), so when you push your app to the server, only settings_server.py will get pushed. This step is absolutely essential because the code above will always load the local settings as default if available.