Category Archives: Bash

Running script in background on linux

If we want to run a script from terminal and be able to close the terminal without killing a script (because terminal would be a parent process, so if it dies, its children die automatically), here is the command: nohup … Continue reading

Posted in Bash, Productivity, Programming, Python, UNIX/Linux, Vim | Tagged , , | Leave a comment

Great unix one liner to join two tables keys in the first columns

Suppose file column_ids.csv contains the first column with some IDs. You have a table big_table.csv with the first column also containing IDs. We can join the two files in unix shell: -t option specifies a delimiter. Both files must be … Continue reading

Posted in Bash, Productivity, Programming, UNIX/Linux | Leave a comment

Mounting memory card on Ubuntu

sudo fdisk -l sudo mount -t vfat /dev/mmcblk1p1 /media/external

Posted in Bash, UNIX/Linux | Leave a comment

Running Selenium Server on Ubuntu 10.04

I decided to record the process of starting Selenium server as it was not easy to find such info on the fly. I follow instructions of Dan Straw literally: Take this attachment, and save it as /etc/init.d/selenium This script lets … Continue reading

Posted in Bash, Python, Selenium, UNIX/Linux | Tagged , , , , | Leave a comment

Script to display count of shell commands used most frequently

The credit for this excellent idea is to Matt Might. This perl script calculates the number of occurrencies of bash shell commands stored in ~/.bash_history Save the above script in file “frequency” in some directory under “PATH” variable. cd to … Continue reading

Posted in Bash, UNIX/Linux | Tagged , , , | Leave a comment

Basic Managing of Mercurial Repos with Bitbucket

1. Setting ssh. cd ~/.ssh ssh-keygen. Enter a phrase when requested. Then enter the file path. /home/your_user_name/ssh/id_rsa. After this steps file id_rsa.pub will be created. ssh-add ~/.ssh/id_rsa. This loads your default identity into ssh agent. Go to your Bitbucket Account/Manage … Continue reading

Posted in Bash, Mercurial, Programming | Tagged | Leave a comment

Sudo command changes environment variables

When you run sudo command it switches user to “supper user” and environment variables also change. This can be annoying. For example, on amazon free-tier micro instance you ssh to it as ec2-user but often (almost always I would say) … Continue reading

Posted in Bash, EC2 | Leave a comment