Yesterday we noticed in our windows samba share machine that it was infected with virus. This is the kind of virus which became common 2 years back which created an executable file with the name same as the current directory name. In a windows machine, the icon was set in such a way that it looked exactly like a windows directory. If you double click that file (thinking it is a folder), you are sure be infected.
So, I had to delete the files and the shared directory was having numerous folders. I then wrote a bash one liner (not exactly 1 line) to delete the files.
First I used find to get the list of all the exe files in all folders and stored it in a file (exe_files).
This was the command I then used to delete all the files.
cat exe_files | while read line;do l=`ls -lh "${line}"`;size=`echo $l| cut -d' ' -f5`;if [ $size = "604K" ]; then rm “`echo $l| cut -c”47-”`” ;fi; done
What it does is reads each line in the file and finds the size of each file and if the size is ‘604K‘ then remove the file.
Deleting based on the filesize was not that good, as we might have lost some original file which was correctly 604K. If you wanted a better solution, you would have to write one more if clause to check if the filename is the same as the folder name - better to create a shell script instead of trying a one liner.
Thanks to linux, we could delete all the ~6000 virus files in a simple command without the fear of infection.
Today I found this excellent firefox addon called feedly - which calls itself as a more social and magazine-like start page for firefox. I see this as a great RSS feed reader which is integrated with Google reader, twitter and other social thingies.
This is very well integrated with Google reader that any feeds you subscribe here automatically is reflected in Google reader. Reading a post here marks the post as read in Google reader.
You can recommend, tweet and annotate articles which enables your friends to know what you are doing with your feeds. One important feature is allowing the user to view the post from the site directly in an IFrame. So, I can comment on a post without leaving my feed reader.
They also have a feedly API which lets website owners to write custom views for their content. They also have a plan to allow the owners to better design ads for displaying in their feedly UI.
Overall this is a nice way to read my feeds and I think I am going to try this one for some days. It is available as a free Firefox extension and you can install it by going to the feedly website.
Update: They even have got it integrated with del.icio.us.
For people who have been using Turbogears, Catwalk is an excellent tool to manage the database models and for populating the data into the database. But the footer which displays “Turbogears under the hood” is irritating as I couldn’t select items in which lie directly below the div. So I thought of writing down a quick userstyle where the display property of that div is set to none.
Find the Turbogears Catwalk - Remove footer userscript here. You may need to install the Stylish firefox extension for it to work.
If you want to use the latest snapshot of Beryl, Compiz, OpenCompositing Compiz Tools and Plugins, Emerald, kiba-dock on your Ubuntu Feisty, then you should add Treviño’s repositories. Once you add these repositories, you can install them by using apt-get.
Edit your /etc/apt/sources.list file and add the following to it.
deb http://download.tuxfamily.org/3v1deb feisty eyecandy
deb-src http://download.tuxfamily.org/3v1deb feisty eyecandy
After you do that, update your packages and then install your required package.
Recording screencasts in Linux was a difficult problem faced by many users. recordmyDesktop is a command line tool to record screencasts and it has a GTK and a qt based frontend to make it easy for newbies. RecordMyDesktop can be tweaked to your hearts content by changing the sound and video quality, frames captured per second, mouse cursor style, compression, and whether to record the current window or the entire desktop.
Ubuntu users can install recordMyDesktop and gtk-recordMyDesktop with:
sudo apt-get install recordmydesktop gtk-recordmydesktop
Other distro users too can use their package management tool to install it.
Just found through this post by Technofreak, where a simple(ok, that is not simple), onliner on your terminal will show you the top 10 commands used recently.
$ history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr
This on my system shows up
82 cd
63 ls
51 sudo
51 screen
18 ps
17 irssi
15 python
14 svn
12 irb
11 uptime
Goto any website and paste
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0
in the address bar.
Now you can edit anything in that page. Really cool trick.
When I tried to post the previous post I tried hard at embedding the Youtube code into this. The Visual MCE editor didn’t accept the code and I couldn’t embed the video. So, I changed my settings to use the old plain editor instead of the WYSIWYG editor. It is there is the Users > Your Profile. Under the Personal Options, uncheck the “Use the visual rich editor when writing” option and Update your profile. Now you can easily embed the videos.
Here is the simple method to enable read write access for your NTFS file system on your Ubuntu Box. This method uses ntfs-3g which is still in beta. You should not use it on production machines.
First enable Universe repository
Then in your terminal type
sudo apt-get install ntfs-3g
You can view the partition table by using this command
sudo fdisk -l
Then in your /media folder create new mount folders. This is where your filesystem will be mounted. Then make a backup of the /etc/fstab file and edit the file
sudo mkdir /media/windows
sudo cp /etc/fstab /etc/fstab.bak
gksudo gedit /etc/fstab
Append this line to the fstab file, by substituting the respective drive name. This should be done for every drive in your system.
/dev/hda1 /media/windows ntfs-3g defaults,locale=en_US.utf8 0 0
Save the file and reboot the system. You can however mount them without reboot by issuing this command.
sudo umount -a && sudo mount -a
This would unmount all your file systems and again mount them.
Wordpress has this particular problem when publishing or saving a blog post where it shows a 404 page instead of the required effect. This is irritating when you have typed a long post and just after you have published it shows the 404 error, and all your data is lost. I have faced this same problem for many times.
After a bit of Googling, I found out that the problem is with mod_security being set on server.
To fix this, add the following two lines in our .htaccess file.
SecFilterEngine Off
SecFilterScanPOST Off
This should fix the problem. Let me try publishing this post.