Thursday, December 16, 2010

fixing linux's shell worst pitfal: rm

When I started working with shell few yeas ago, I remember the first thing people warned me about: the rm command has no backup. So there is no copy saved in the Recycle bin or in Trash. Many books and tutorial will share this warning, and also the wisdom that no matter how careful you are. It is bound to happen that you will delete an important file wasting the work of hours or days.

Today I thought of a solution of this for my UBUNTU 9.10. We might mention that alias doesn't work since it doesn't take arguments. Also we should make the effort to find where "Trash" is, a matter that wasn't so simple [1] [2] So the next solution is to write a function and save it in .bashrc:

function rmv () { scp $* ~/.local/share/Trash/files/; }

so now:
$rmv test.f

will put it in the trash instead of deleting it forever. If you are an extensive user of rm you should be careful not to fill up the Trash directory so maybe writing a command that will clean it say every 24 hours or few days. Maybe I will do that one day...

Tuesday, December 14, 2010

fixing your webcam for skype

After updating to UBUNTU 9.10. Skype started running without any interferences. So the next step is to tackle the issue of webcams.Here is a good resource:

https://wiki.ubuntu.com/SkypeWebCams

 so now using lsusb:
Bus 003 Device 003: ID 045e:00f7 Microsoft Corp. LifeCam VX-1000

i get the details of my webcam and the link associated with it:
http://ubuntuforums.org/archive/index.php/t-914952.html
it turned out that the needed fix is to have the following command:
 env LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype

so i fixed it for the alias:
alias skype='env LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype'

and i fixed it on the launching pas:
System->Preference->Mainmenu.
I removed skype and put instead the required command.

my skype has a webcam access and life is good.

Thursday, December 2, 2010

Updating ROOT on your machine.

I was running ROOT 5.18 on my laptop and it has the interesting issue of saving the plots 90 degrees rotated. I never bothered myself with this until someone brought the issue on CMS's hypernews. The solutions she got were:

1- You can change the size of the canvas to be rectangle
TCanvas *c = new TCanvas("c","",800,850); Quite easy but we need to remember that the TDR style for CMS papers is 600 by 600.

2- It turned out that this issue is solved in the new releases (after 5.22).


So the challenge was to try to update my old ROOT release. These days they have clear instructions about installing ROOT. The problem is that this is not a full package and installing without care will create a mess! so doing the instructions you can use that release in the current shell. but not if you opened a new one.

I wanted something more "default". So here is the trick:

in 'root' edit file names: .bashrc
and at the bottom i added:
. $HOME/Desktop/Research/ROOT522/root/bin/thisroot.sh

which is the place where the new installation is.

Friday, November 19, 2010

The point behind TomBoy

I've started using TomBoy over a year ago. it sounded a very reasonable tool to make my own "wiki". As it grew larger and larger, I was wondering of a way to move it to other computers I use.


That wish materialized one day after some research. I needed to define a path where all my files are stored. It turned out that this option was killed in my version (a very old one). After some research I managed to renew it. Then you would do the following:

Edit->Preferences->Synchronization and set a path for that file.
Then you can send a copy of that file to your second machine. And through the same process, set your TomBoy to "see" that folder.
Done! and life is good.


============ update 20150212 =================

You can synchronize Tomboy with other machines using DropBox. Simply follow these instructions:

http://ubuntuforums.org/showthread.php?t=2122776

and make sure to "kill" all tomboy processes using shell before trying it.

An Easy Recipe to install ROOT

#I am assuming you are using tcsh
cd somedir
wget ftp://root.cern.ch/root/root_v5.26.00c.source.tar.gz
tar xzf root_v5.26.00c.source.tar.gz
setenv ROOTSYS $PWD/root
setenv PATH $ROOTSYS/bin:$PATH
cd root
./configure
make

Tuesday, May 25, 2010

Insatalling a printer on ubuntu

I found this link to give an exceptional help

http://www.edwardstafford.com/2009/08/31/add-a-network-printer-to-an-ubuntu-desktop-the-easy-way/comment-page-1/#comment-9047

The only issue was that I had slightly different names probably due to different version of Ubuntu.

 While these instruction are specific for DELL 1700. It is easy enough to generalize them for any printer. Another technique is to add a printer from the network. All you need is the IP number and the type of the printer. In this case after running:

$sudo system-config-printer

you should go to ->Find Network Printer. and put the IP address in the "host" field. the rest is self explanatory. 

Saturday, February 27, 2010

How to fix skype on ubuntu

for two years I've been sweating in an effort to fix skype on my Ubuntu. The reception was fine, but the mic never worked. This happened also on my ubntu installation in my office and for more elite services like EVO. Finally I figured out that it was all due to Audiopules. accordign to the ubuntu forum I can delete it and install another package called esound:

killall pulseaudio
sudo aptitude remove pulseaudio
sudo aptitude install esound
sudo aptitude remove /etc/X11/Xsession.d/70pulseaudio
Now skype works like magic! Lets hope that I will get the same luck with Evo.