Javascript trick to edit the page displayed

Do you want to quickly edit the text of any webpage that you are browsing? Maybe you wanted to see how the site looks if you change some words. Here is a neat Javascript trick that you can use to edit the text part of the web page.

Do note that you can’t save the changed text onto the server or is this any means to hack a web server. If you refresh the page, all the changes you made will disappear. You can however save the resulting HTML if you goto File -> Save as.

Step 1: Drag this Edit/View bookmarklet into your bookmarks toolbar.

Step 2: Goto the web page which you want to edit and click on the bookmarklet – you will be put into the edit mode. Click the bookmarklet again and you will be put into the normal view mode.

Step 3: ?????

Step 4: Profit.

For those of you who like to know what it does beneath the scenes, it just sets two properties of the document to make it editable.

javascript:document.body.contentEditable='true'; document.designMode='on'; void 0

Embed Youtube in WordPress

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.

Mount NTFS filesystem read/write on Ubuntu

ubuntu logoHere 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 404 error when publishing or saving

Wordpress logoWordPress 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.

Todo.txt – simple todo app

You might have used a variety of online services to maintain your todo list. But there are variuos reasons to use a text todo file which is stored on your own PC. You just have to use a single todo.txt file which contains your list of items. Todo.txt shows you how to maintain your todo list.
The file contains one item per line. The items can be categorised under variuos projects using the tag p:project. For eg. if I want to categorise a particular item under college, then I tag it as p:college. There are also contexts which show when/where the particular item has to be done. Eg. if I have to make a phone call, then I would tag it as @phone.
An example todo.txt file may be

write blog entry about todo.txt p:fslog
clean up room
call broadband provider for connection @phone

The site also has shell files which can be used to maintain the todo.txt files. You can download them and use it to maintain your own todo list. One advantage of using the text files are that you could just grep the file to find what tasks are pending.