Wednesday, February 27, 2013

Using screen to manage your terminal windows

You can use screen if you need to have more than one terminal window open to at the same time.

The advantage of screen is that even if there is an internet problem, you can reattach to the screen where you were working on once your internet is back up.

screen                             Will open a new screen
exit                                  To quit the screen, and go back to the shell
screen -ls                         Display a list of all screens
screen -d screen_name     Detach from screen_name

In Screen, you type Control-a and then you can type in your command. Below are a few common commands.

Ctrl-A :sessionname dev_server    Names the current screen dev_server

Ctrl-A c         Open a new screen
Ctrl-a n          Switch to next screen
Ctrl-a p          Switch to previous screen
Ctrl-a \           Quit and kill all your windows

Wednesday, January 30, 2013

How to get your first software job

Good advice on how to get your first software job at http://youtu.be/snMOeLxVQPg

Make something. Anything. When you do, you learn. And you show the company why they should hire you.




Friday, January 11, 2013

Engineering for the worst case

In software engineering, you write a program to solve a problem, and then you see how it behaves in the worst case.

For instance, you write a program to sort an array of numbers, and then you see how fast it is for an array with all the numbers the same, or for an array with all the numbers already sorted.

Do you see numbers like this in real life? Very rarely.

So, it is fine for a student or a scientist to worry about, and it may be a good question to ask in interviews, but when actually writing software, this is not something we should care about.

I believe that the 80-20 principle applies just as well to software as it does to anything else.


For the problem of sorting an array in most business software, you want to make sure that it is fast for the 20% of the kind of sorts which are called 80% of the time. And we only need to test and benchmark for these cases.

Worrying about anything more than this, is most probably over-engineering.

Saturday, December 29, 2012

How to cook Potato for Masala Dosa

Wash the potatoes, cut them in half and put them in a cooker. Add water and put it on the stove. When the steam comes out 3 times, switch off and wait for the potatoes to cool down.

Once the potatoes cool down, peel off the skin and throw it away. Mash the potatoes, mix salt and taste it to make sure you have the right amount of salt.

Cut onions, tomatoes and chillies.
Put some oil in a kadai and let it heat a bit.
Add awalu, jilakara, urad dal and karepaku and fry them till it goes chat pat.
Add onions and fry till light brown.
Add tomatoes and chillies.
Take a small spoon and add a quarter spoon of turmeric powder.
Add the mashed potatoes and mix.

Keep it on the stove on a low flame for a few minutes and serve hot.

Deploying a Catalyst application with Starman and Apache on Linux

Go to your application directory and run this command, to run the server.

starman -I./lib --workers 1 --port 3000 myapp.psgi --log log/myapp.log --pid run/paxi.pid --daemonize

Confirm that the PSGI server is running on the server by visiting http://localhost:3000.

Add this to your Apache configuration file. On centOS, you will find it at /etc/httpd/conf/httpd.conf

<VirtualHost *:80>
    ServerAdmin email@myapp.com
    DocumentRoot /var/www/vhosts/myapp
    ServerName myapp.com
    ErrorLog /var/log/httpd/error_log-myapp
    CustomLog /var/log/httpd/access_log-myapp common

    ProxyPreserveHost On
    ProxyPass / http://0:3000/
    ProxyPassReverse / http://0:3000/
</VirtualHost>


Now, you should be able to visit http://myapp.com from any browser.

Thursday, November 1, 2012

How to make dosas

Get up early in the morning.

Wash 3 cups rice, 2 cups boiled rice, 1 cup pesarapappu (urad dal) and a handful of menthi seeds.
Mix them all and soak them in water in a vessel.

Come home from work in the evening, and go straight to the kitchen.

Put the seeds in a mixie along with some water. Take all the batter and put it in a vessel. Keep it next to the stove and leave it overnight for fermenting.

Next morning, add some salt, and mix.

And you are ready to start making your dosas.

Take a non stick tawa, and keep a cup of oil and a wooden ladle ready. Put the tawa on a stove on a small flame, put some oil on it and spread the oil.

Take a big ladle with a flattish base and use it to pour one cupful of batter onto the tawa. Spread it going in a circle from the center to the outside until it is reasonably thin. Don't make it too thin, or the dosa will get stuck to the tawa. Raise the flame on the stove, and wait till it starts becoming brown. Reduce the flame on the stove. Use the ladle to raise the dosa from the tawa, and turn it around. Fry it a little bit.

The first dosa is ready.

Before making the next one, take an onion, and cut off the base. Rub the onion on the tawa. This helps prevent the next dosa from sticking to it.

Enjoy your dosa! You deserve it after working so hard!

Wednesday, October 31, 2012

TWS - How to add a new workstation

Below are the steps to add a new FTA to your Tivoli Workload Scheduler environment.

Create a file, ws.txt, with the workstation definition,like this

CPUNAME MACHINE_NAME
  OS UNIX
  NODE MACHINE_NAME TCPADDR 31111
  DOMAIN MASTERDM
  FOR MAESTRO
    TYPE FTA
    AUTOLINK ON
    BEHINDFIREWALL OFF
    FULLSTATUS OFF
    SERVER D
END



Run this command to add the workstation

composer add ws.txt

To start the netman process on the workstation, login to the workstation as the tws_user, and run this command
StartUp
or
/opt/IBM/TWS/TWS/StartUp 


To create the Symphony file on the workstation, run this command on the master
JnextPlan -for 0000


To link the  new workstation to the master, run this from the master
conman 'link MACHINE_NAME'

To raise the limit of the number of jobs that can be run on the machine at one time,
conman 'lc MACHINE_NAME;40'

Once this is done, you can start scheduling new jobs on this workstation.