sed -i "23 d" file_name
Wednesday, June 9, 2010
Friday, April 30, 2010
Best way to get IE on ubuntu
I was doing web development(???) and I needed to check page on IE. so this is what I found out.
And nice IE for testing...
sudo apt-get install wine
sudo apt-get install cabextract
wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-2.99.0.1.tar.gz
tar xzvf ies4linux-2.99.0.1.tar.gz
./ies4linux-2.99.0.1/ies4linux
ln /root/bin/ie6 /usr/bin/ie6
ie6
And nice IE for testing...
Tuesday, April 27, 2010
popup=popup, not popup=newtab
For some reason or other, Firefox does not have the option under the Tabs option items to “force links that open in new windows to open in:”. I have Firefox 2.0.0.7 now, and I don’t have that under Tabs options. But, if you open about:config in your address bar, you can change the setting manually.
Change:
Mine was set to 3, which told the popups to always open in a new tab. I like that, mostly. But some web sites, TinyMCE editor in this case, like to open a popup and return you back the the original page. I keep losing that original popup. So I wanted to turn off my popup forced to new tab option. To make this behave normally, I set it to 2. All worked just peachy!
Change:
browser.link.open_newwindowMine was set to 3, which told the popups to always open in a new tab. I like that, mostly. But some web sites, TinyMCE editor in this case, like to open a popup and return you back the the original page. I keep losing that original popup. So I wanted to turn off my popup forced to new tab option. To make this behave normally, I set it to 2. All worked just peachy!
Monday, April 19, 2010
Disabling touchpad while typing
cat >> /etc/hal/fdi/policy/shmconfig.fdi << END
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
<match key="input.x11_driver" string="synaptics">
<merge key="input.x11_options.SHMConfig" type="string">True</merge>
</match>
</device>
</deviceinfo>
END
In start-up programs, add command
syndaemon -i 1 -d
and reboot!!!
Thursday, April 15, 2010
Listing files by decreasing directory size / space left
If you want to see how is your disk being used, you can use
du -h --max-depth=1 <directory> | sort -rh
If you want to see size of different partition, you can also use
df -hMonday, April 12, 2010
Removing ^M from end of the line in VI
To remove the ^M characters at the end of all lines in vi, use:
The ^v is a CONTROL-V character and ^m is a CONTROL-M. When you type this, it will look like this:
In UNIX, you can escape a control character by preceding it with a CONTROL-V. The :%s is a basic search and replace command in vi. It tells vi to replace the regular expression between the first and second slashes (^M) with the text between the second and third slashes (nothing in this case). The g at the end directs vi to search and replace globally (all occurrences).
:%s/^V^M//g
The ^v is a CONTROL-V character and ^m is a CONTROL-M. When you type this, it will look like this:
:%s/^M//g
In UNIX, you can escape a control character by preceding it with a CONTROL-V. The :%s is a basic search and replace command in vi. It tells vi to replace the regular expression between the first and second slashes (^M) with the text between the second and third slashes (nothing in this case). The g at the end directs vi to search and replace globally (all occurrences).
Friday, April 2, 2010
Invisible plugin in pidgin
Want to become invisible in pidgin??
wget http://fahhem.com/pidgin/gtalkinvisible.tar.gz
tar -vxf gtalkinvisible.tar.gz
mv gtalkinvisible/gtalkinvisible.so ~/.purple/plugins/
rm -rf gtalkinvisible*
Friday, March 26, 2010
Changing base of a number
Suppose we want to convert 0xFACE into decimal value.
'ibase' is input number base.
'obase' is output number base in ibase number.(10 is A in hexadecimal format).
'FACE' is the number.
when we dont specify any of the value, its assumed to be 10.
echo "ibase=16; obase=A; FACE" | bc
'ibase' is input number base.
'obase' is output number base in ibase number.(10 is A in hexadecimal format).
'FACE' is the number.
when we dont specify any of the value, its assumed to be 10.
Saturday, February 27, 2010
Linux or UNIX password protect files
Suppose you want to protect file pwd.txt
This will ask you to set new password and create a file called pwd.txt.gpg
Now you can delete pwd.txt.
If you want to retrieve pwd.txt, you can say
and it will ask you to enter password and create pwd.txt
gpg -c pwd.txt
This will ask you to set new password and create a file called pwd.txt.gpg
Now you can delete pwd.txt.
If you want to retrieve pwd.txt, you can say
gpg pwd.txt.gpg
and it will ask you to enter password and create pwd.txt
Monday, February 22, 2010
Keep Firefox Open When Closing the Last Tab
The new Firefox 3.5 release brought a lot of great features, but one annoyance sent reader Mark looking for a solution: When you close the last tab, the browser closes instead of opening a blank tab.
Changing the behaviour back to the way it used to work is very simple: just type about:config into the address bar and find the browser.tabs.closeWindowWithLastTab entry in the list—using the filter makes it easy. Once you've found that key, double-click on it to change the value from true to false, and Firefox should no longer close when you close the last tab.
Changing the behaviour back to the way it used to work is very simple: just type about:config into the address bar and find the browser.tabs.closeWindowWithLastTab entry in the list—using the filter makes it easy. Once you've found that key, double-click on it to change the value from true to false, and Firefox should no longer close when you close the last tab.
Sunday, February 21, 2010
Disabling selinux
Temporary disabling.
Permanent disabling.
.. just change SELINUX=enforcing to SELINUX=disabled, and you're done.
Or we can also change /boot/grub/grub.conf.
On the kernel line of current distribution, add enforcing=0 at the end.
echo 0 >/selinux/enforce
Permanent disabling.
vim /etc/selinux/config
.. just change SELINUX=enforcing to SELINUX=disabled, and you're done.
Or we can also change /boot/grub/grub.conf.
On the kernel line of current distribution, add enforcing=0 at the end.
Tuesday, February 2, 2010
New wallpaper script
New wallpaper script. This had been on my mind for a long time. Using this we can change wallpaper any-time, unlike previous one in which we could change only once per day.
and a bit improvised version of that is
cat >> ~/Dropbox/new_installation/wallpaper/mast/wall.sh << END
folder="Dropbox/new_installation/wallpaper/mast/"
rm -f ~/$folder/*.jpg
limit=`wc -l < ~/$folder/list`
my_number=`expr $RANDOM % $limit`
name=`tail -n $my_number ~/$folder/list| head -n 1`
wget -O ~/$folder/pics_list http://www.wallpaperbox.com/Celebrities/$name/
limit=`wc -l < ~/$folder/pics_list`
limit=`expr $limit - 10`
limit=`expr $limit / 2`
my_number=`expr $RANDOM % $limit`
echo $my_number
wget -O ~/$folder/$name.jpg http://www.wallpaperbox.com/Celebrities/$name/$name-$my_number.JPG
gconftool-2 -t str --set /desktop/gnome/background/picture_filename ~/$folder/$name.jpg
END
and a bit improvised version of that is
#!/bin/bash
#folder=`pwd`;
folder="/root/Dropbox/new_installation/wallpaper/celeb";
cd $folder;
rm -f *.jpg;
limit=`wc -l < list`;
my_number=`expr $RANDOM % $limit`;
name=`tail -n $my_number list| head -n 1`;
wget -O pics_list http://www.wallpaperbox.com/Celebrities/$name/ ;
limit=`wc -l < pics_list`;
limit=`expr $limit - 10`;
limit=`expr $limit / 2`;
my_number=`expr $RANDOM % $limit`;
wget -O $name.jpg http://www.wallpaperbox.com/Celebrities/$name/$name-$my_number.JPG;
gconftool-2 -t str --set /desktop/gnome/background/picture_filename $folder/$name.jpg;
Subscribe to:
Posts (Atom)
Loading .bas file in excel
* Ctrl + Break to stop Macro / Alt + F8 to run "stop function" * Alt + F11 to open VBA editor * Remove old bas and import new bas ...
-
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...
-
Better than opening in 2 VIM windows , I used to take diff and open its output in vim :). But diff itself has flag which will compare files ...
-
This is how we use a command line / bash variable (named num) in a awk command. We define an awk variable 'var' with -v option. Th...