Thursday, July 9, 2020

Quote Translation



People Who Say It Cannot Be Done Should Not Interrupt Those Who Are Doing It.
别让他人口中的不可能,阻碍踏实肯干的脚步。

"Everything has beauty, but not everyone sees it." - Confucius
世事洞察皆学问 - 孔子






Monday, March 2, 2020

All to the efficiency: Iterm2 setup for MacOS



Enable cursor blink, and change it to underline:
Preference -> Profile -> Text -> Blink cursor | Underline

Enable select and copy, right-click to paste from clipboard:
https://dbavic.wordpress.com/tag/right-click-paste-on-iterm2/

Open Numpad (small keyboard with numbers on the right) support:
https://superuser.com/questions/565178/how-do-i-get-the-numpad-to-work-in-vim-using-iterm2-on-osx-with-term-xterm

Wednesday, February 26, 2020

Set up local BLAST site with sequence retrieval function



# Install LAMP package with one liner
sudo install lamp-server^

# enable CGI
sudo a2enmod cgi

# Enable PhP session
vim /etc/php/7.2/apache2/php.ini
# uncomment the line: session.save_path = "/var/lib/php/sessions"
# make sure other lines were setup for session function as described at https://support.qualityunit.com/021373-How-To-Enable-Session-Support-for-PHP
# type ":wq" to save modification and exit vim. If no vim, use other editor like vi or nano.

# edit apache2 config file to enable CGI for specific folder containing NCBI WWWBLAST tools and databases
vim /etc/apache2/sites-enabled/000-default.conf

# add the following lines to the 000-default.conf file
<Directory "/projects/blast_sites">
    Require all granted
    AddHandler cgi-script cgi REAL
    Options Indexes FollowSymLinks ExecCGI MultiViews
    AllowOverride All
</Directory>
</VirtualHost>

# Restart apache2
sudo service apache2 restart

Friday, February 14, 2020

Install QIIME1 with conda 2020


Python 2.7 is gone, but still want to use Qiime1?
conda create -n qiime1 python=2.7
conda activate qiime1
conda config --add channels bioconda
conda install biom-format
pip install qiime

Test
print_qiime_config.py -t

PS:
Guide to install conda or miniconda: https://docs.conda.io/projects/conda/en/latest/user-guide/install/

Galaxy server setup: change to www.your.domain/galaxy



After deploying the local galaxy following the official guide at https://galaxyproject.org/admin/get-galaxy/, a few more steps can be done to hide the port (:8080) and change your galaxy site link to something like www.your.domain/galaxy.


1. Enable apache modules: proxy, proxy_http, and rewrite
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod rewrite
2. Add following lines to apache config file, e.g. /etc/apache2/sites-enabled/000-default.conf
RewriteEngine on
RewriteRule ^/galaxy$ /galaxy/ [R]
RewriteRule ^/galaxy(.*) http://localhost:8080$1 [P]
sudo systemctl restart apache2
Done!

PS:
One command to install LAMP server packages on Ubuntu Linux, including Apache, MySQL and PHP. Use the "^" at the end!
sudo apt install lamp-server^