Sunday, April 25, 2010

bash: send a command to a screen session

"Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells." It is a very useful tool, that I often use, as it allows me to run "multiple terminals in one" even when I log out from the system.

So how to send command to screen session from other terminal. In other words how to remote-control a screen session from within a script. This post is useful for this.

In particular, I wanted to execute matlab scripts in screen windows. To do this I used the following:
1. Create screen sessionscreen -S matlab2. Create few windows in the screen session using Ctr-a c
3. Send matlab command to each as followsfor ((i=0;i<$NO_WINDOWS;i+=1)); do
echo $i
sleep 2
screen -S matlab -p $i -X exec matlab -nodesktop -r "bashCalculations('part',$i+1)"
where bashCalculations is my matlab script bashCalculations.m that takes part argument. So,, each screen window executes different part of my script.

Saturday, April 24, 2010

Ubuntu 10.04: How to remove chat and mail icons (indicators) from system tray

The 10.04 LTS release of Ubuntu seems to be very, very good. However, for some strange reason, creators of this release made some strange decisions about Ubuntu's look-and-feel. One of the things that annoyed me was the assumption that every Ubuntu user, uses Twitter, Facebook or other social network. Thus, they incorporated the tools for using social networking sites into the distibution. They did it by adding chat and status icons/notifiers into Gnome system try. However, what they did not do, was the ability to easily remove them. For example, when you remove massage notifier (mail icon) using "Remove From Panel" option, the volume control icon also disappears.
Thus you need to remove these icons some other way, which in this case, is to remove two packages: indicator-me and indicator-messages:sudo apt-get remove indicator-me indicator-messagesAfter that just log-out and log-into the gnome session and the icons should be gone:

It also should work for Ubuntu 11.04 (Natty Narwhal).