# tmux multiple terminals

I think most of us watched the movie Inception in which there was dream within a dream. It was a bit of confusing at some point. There is a Linux version of it 🙂 terminal within terminal provided by the fantastic tool tmux (terminal multiplexer). I use this tool during some troubleshooting scenarios when I would like to see two continuous pings on two terminals. Sometimes, I also divide the screen to 4 terminals. It may not be needed for everyone but in my opinion it is really handy. Here is an example of what you can achieve by tmux on a single terminal.

It is pretty cool right.

# Migrating from rtoodtoo.net to rtodto.net

I have recently changed the domain name of this blog from rtoodtoo.net to rtodto.net. My intention was to buy r2d2.net in the first place but very smart people bought it long time ago before me:) I couldn’t even find the r2d2.nl available. Now I think there isn’t much make sense to have such a long name on this blog. I have also set the web server side redirection. If you see any broken link or redirection loop etc, please do let me know.

# Average, variance & standard deviation in Python

Here is a quick python script which calculates average, variance and standard deviation. This is also part of codeacademy work. I must say last time I worked with variance and standard deviation it was more than 10 years ago in statistics course. Hence a bit of reminder here for me too: (Some are from wikipedia and mathsisfun.com)

Average: In mathematics and statistics, it is called arithmetic mean according to wikipedia but simply it is the sum of a list of numbers divided by the number of numbers in the list.

Variance: The average of the squared differences from the mean. Here is the formula which we will use in our python code.

$\displaystyle \sigma^2 = \frac{\displaystyle\sum_{i=1}^{n}(x_i - \mu)^2} {n}$

Standard deviation: Square root of the variance is the standard deviation which just means how far we are from the normal(mean)

$\displaystyle \sigma = \sqrt{\frac{\displaystyle\sum_{i=1}^{n}(x_i - \mu)^2} {n}}$

Now here is the code which calculates given the number of scores of students we calculate the average,variance and standard deviation.

# htop an alternative to top command

Today I have stumbled across a system resource utilization tool htop which is way more visual than top and it is easier to use too. For example, following is from my single core amazon cloud centos server.

You can easily see that sorting is by CPU and if you want to change it, just press F6 and you get a new menu to choose as to which column you want to sort by. It is really cool!

PS: I have disabled my mail notifications for a while for minor posts as I don’t want to bother subscribers with my tiny posts.

# a simple battleship python script

I have written a simple python game script to sink a battleship. It is very simple as it was almost a year ago last time when I wrote a long python script. Thanks to codeacademy that it helps to brush up my python skills. I think it is also good to put the script here for my documentation. Simply, you guess the coordinates of the point and by default you have maximum 4 turns to do it right. Each time a guess is run, coordinate is marked by “X”. Below is a sample execution:

Here is the code itself:

# Fate of Rtoo

I have been asked several times if RtooDtoo.net will stay alive or not. I don’t have any plan to bring it down. On the contrary, I will continue to update the blog but I am quite busy in learning new technologies some of which I haven’t really worked with before. Another news is that, soon I will be in Santa Clara for around 2 weeks for which I am pretty excited actually as this will be my first US visit.
I am hoping that in a month or so I can start blogging once again!

Genco.