Posts

SVN Introduction

A very common thing while doing any kind of project is using repository. I tend to forget these commands every now and then. That's why this svn checkout http://fileextensiontype.unfuddle.com/svn/fileextensiontype_fi/ local_directory_name svn status svn add * svn commit You may also have to do this export EDITOR=vim

Wordweb Equivalent on Linux

One feature I really miss in Linux is Word-Web. We can have word-web in Linux using wine but pressing the hot-key when word is selected does not activate it. Thus, we can use "gnome-dictionary" with "xbindkeys" and "xclip" to get same kind of functionality. yum install xbindkeys yum install xclip xbindkeys --defaults > ~/.xbindkeysrc xbindkeys -k Now a small window will appear and you can get code for the key-combination pressed. Use this combination in configuration file ~/.xbindkeysrc. (I got m:0x1c + c:52 for alt+ctrl+e) cat "gnome-dictionary $(xclip -o)" m:0x1c + c:52 END echo "xbindkeys &" >> ~/.bashrc killall -HUP xbindkeys Equivalent to "delimiter cat" is "echo -e". That's it. Just select any word you don't know and press your key combination. We will get its meaning.

Using cscope and ctags

Many people complain that though Linux is in C they don't have good IDE for C development. Though there the things mentioned here are not great but they are good enough to help you in C development. 1. Cscope find . -name '*.c' > cscope.files cscope -i cscope.files cscope.files is default file name, thus just cscope command would work. To exit, you can type Ctrl+D and to see help, you can type "?". 2.Ctags cd /path/to/your/project ctags -R * vim -t Once inside a file, hitting ctrl-] while the cursor is over a function/class name, Vim will attempt to open the file with that tag. Pressing ctrl-t will take you back a step. To exit, , regular ":q" should work.

KVM setup

I usually love to start from a brand new OS installation. That way we know what packages we actually need. Follow these instructions for both machines A and B. 1. Confirm your CPU has virtualisation support egrep 'vmx|svm' /proc/cpuinfo 2. Install kvm packages yum install kvm kmod-kvm qemu 3. Install appropriate kernel module modprobe kvm-intel OR modprobe kvm-amd 4.Check whether the module is installed or not lsmod | grep kvm Also make sure the kvm is present as a device ls -l /dev/kvm 5.Mount same NFS share at same path (say /mount_point) mount server:/nfs_share /mount_point 6.Download ISO file for creation on virtual machine wget -O /mount_point/fedora.iso http://mirror.cc.vt.edu/pub/fedora/linux/releases/10/Fedora/i386/iso/Fedora-10-i386-DVD.iso 7. Create VM image file qemu-img create fedoraroot.img -f raw 10G 8. I do not know if there is a command line version of qemu. So if your server does not have GUI, you can use following commands On server export DISPLAY=your_ma...

Wallpaper changer script

Tired of changing wallpaper everyday? You will get many soft-wares which will change it for you everyday. The only thing which I dint like about them is, they put a picture which is stored on your computer. SO there is possibility that you have seen that picture before. What about a truly random pic?? Here is the script: rm -f ~/wallpaper/w.jpg ~/wallpaper/widescreen_rss.php wget -O ~/wallpaper/widescreen_rss.php http://www.mlewallpapers.com/widescreen_rss.php wget -O ~/wallpaper/w.jpg `grep enclosure ~/wallpaper/widescreen_rss.php | cut -d \" -f 2` gconftool-2 -t str --set /desktop/gnome/background/picture_filename ~/wallpaper/w.jpg Put it in your cron so that it will execute daily. You can modify this to fetch picture from any site which will give new picture daily. All this can be done using following : mkdir -p ~/new_installation/wallpaper cat > ~/new_installation/wallpaper/wallpaper_changer.sh rm -f ~/new_installation/wallpaper/w.jpg ~/new_installation/wallpaper/widescreen...

Installing 64 bit adobe in firefox

I have 64 bit ubuntu in office and for some strange reasons, it installs 32 bit flash player through apt-get. To install 64 bit version here are the commands to copy paste in terminal. wget -O flash.tar.gz http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.22.87.linux-x86_64.so.tar.gz tar xvzf flash.tar.gz mkdir -p ~/.mozilla/plugins mv libflashplayer.so ~/.mozilla/plugins pkill firefox firefox

Open terminal in current folder

One feature I really miss in Fedora after moving from redhat was opening a terminal in current folder of nautilus. So my workaround is this : echo gnome-terminal > ~/.gnome2/nautilus-scripts/terminal chmod a+x ~/.gnome2/nautilus-scripts/terminal