Vim Howtos and Tips

Posted on

Vim is a fast and handy editor on *nix systems. Like Emacs, Vim has a steep learning curve as you get constantly get new things. However, the effort deserves it as you efficiency is highly improved. Here, I summarize the tips and howtos I learned using Vim. Some previous posts on vim are tagged with
Read more

How to Find Out Failed Disks’ SATA Ports in Linux

Posted on

The Linux disk names (e.g. sda1, hdb3, etc.) are not reliable—they may be changed if there are hardware changes, such an adding or removing a disk. Additionally, the order for the Linux device names is not always the same as the order of SATA poets. For example, the disk connected to SATA port 0 (first
Read more

Changing Linux User Password in One Command Line

Posted on

In Linux, we use passwd to change password, but passwd requires input from stdin to get the new password. It is common case that we may want to change the password non-interactively, such as creating new user accounts and change or set password for these accounts on a number of Linux boxes when the new
Read more

HP Compaq BIOS Crisis Recovery from a Failed BIOS Flashing Using a USB Flash Disk

Posted on

I tried to flash my HP Compaq CQ35-240TX’s BIOS to F.15 but unfortunately failed. The computer turned to white screen. When I restarted (powered off then boot again), this is no response any more: the hard disk and caps lock’s LED keep blinding. I thought “Oh my God! I must send it to HP to
Read more

Thunderbird Tips: Default Descending Email Sort Order and Inline Quote When Reply

Posted on

Thunderbird is a great email client and what make it special is deeply configurable like Firefox. For me, I like to view email in the descending sort order and inline quote relied email content when replying emails. Let’s look at how to set the default order as descending sort order and quote mode as inline
Read more

Hashing Library for C

Posted on

I try to find some Hashing libraries for C and find several good ones. The hsearch function in the GNU C library. There are other methods to organize information which later should be searched. The costs of insert, delete and search differ. One possible implementation is using hashing tables. The following functions are declared in
Read more

Controlling Display of WordPress Widget with PHP Code

Posted on

I am always wondering how to display different Widgets in WordPress depending on the page/post/category etc. I ever tried some plugins that is for specific purpose. However, they are not flexible enough for all my needs. For example, I want a widget that contains AdSense ad not display on certain posts that I selected and
Read more

Using noindex Meta Tag in WordPress to Prevent Search Engines Indexing Categories, Tags and Archives

Posted on

WordPress may show “duplicate” content which may potentially confuse search engines. Duplicate content won’t hurt much, unless it is spam or keyword stuffing, as said by Matt Cutts, and Google may just ignore the duplicate content. However, instead of letting the search engines decide which pages of the duplicate ones are important, we may only
Read more

Using “META” Tag in HMTL HEAD to Redirect Pages

Posted on

It is quite simple to redirect pages using the “meta” tag in HTML head, I just give the example to redirect the page to https://www.systutorials.com after 1 second. <html> <head> <meta http-equiv=”Refresh” content=”1; url=https://www.systutorials.com/”> </head> <body> This page is redirected to: <a href=”https://www.systutorials.com/”>systutorials.com</a>.<br /> </body> </html>

Emacs Tips and Howtos

Posted on

With Emacs, I feel happy. I love the rich functions of Emacs, such as compiling, quickly jumping to the lines with compilation error and debugging with gdb, and more. I ever wrote small tips posts about Emacs before. But it is a good idea to put them together and keep adding new ones. Here comes
Read more

How to Flush Linux File System Caches

Posted on

We may drop the file system caches on Linux to free up memory for applications. Kernels 2.6.16 and newer provide a mechanism via the /proc/ to make the kernel drop the page cache and/or inode and dentry caches on command. We can use this mechanism to free up the memory. However, this is a non-destructive
Read more

Vim as KMail’s External Editor

Posted on

Vim is my favourite text editor and I also prefer to use Vim to compose Email. I ever used Vim as Thunderbird’s External editor with the help of plugin. I started to use KMail as my email client on KDE and I find it is not hard to configure KMail to use Vim as email
Read more

How to Take Screenshots in MPlayer

Posted on

Taking screenshots in mplayer is simple. mplayer can also take continuous snapshots. Enable screenshot filter When we want to take screenshots when playing video, first we need to set the “-vf screenshot” option: $ mplayer -vf screenshot video.file If we want to enable the screenshot filter by default, we may put the option by adding
Read more