How to open .xz file in Linux/Unix?

.xz is a lossless file compression program that uses LZMA2 compression algorithm. xz is sort of stripped down version of 7-Zip program, although it has its own file format .7z

.xz compresses single file input and does not bundle multiple file in single archive. It is therefore a regular practice to use an archiving technique along with .xz compression. In Linux/Unix it is popularly, tar.

How to open/decompress/extract .tar.xz file?

$ tar -xJf yourfile.tar.xz

-J is the flag to handle .xz files in tar program.

Although, modern tar program can automatically determine what compression technique is used and apply thereby. You can simply run the following and it should work

$ tar -xf yourfile.tar.xz

Converting mbox to maildir

mbox and maildir both are popularly used techniques to store mails. The simple way to understand the difference is, mbox uses a single directory to store all mails while maildir would utilize a directory structure to store mails. Most of the cases, advance mail receiving techniques IMAP over POP3 uses these sort of folder based concept to provide enhancement in mail organizing.

If you are having a POP3 account using mbox, you can use an open source tool called mb2md to convert it to maildir.

Full reference and how to use the tool is available here:
http://batleth.sapienti-sat.org/projects/mb2md/

How to convert mbox to maildir using mb2md?

First download the mb2md script from the developer

$ wget http://batleth.sapienti-sat.org/projects/mb2md/mb2md-3.20.pl.gz
$ gzip -d mb2md-3.20.pl.gz
$ chmod 755 mb2md-3.20.pl

Now, converting is simple. Use as following:

$ mb2md-3.20.pl -s /locationofmbox -R -d /destinationofmaildir

-s defines the source of the mbox, the location would depend on the type of environment you are using.
-R defines recursively do for all subdirectories
-d defines the destination of maildirectory inbox.

How to convert mbox to maildir in a directadmin instance manually?

For Example, if you are using Directadmin control panel, the mbox spool is located under /var/spool/virtual/domain.com/user. You would want to run something like this to convert the mbox into maildir in a directadmin control panel:

$ mb2md-3.20.pl -s /var/spool/virtual/domain.com/user -R -d /home/username/imap/domain.com/user/Maildir
$ chown -Rf username:mail /home/username/imap/domain.com/user/Maildir

rtorrent: symbol lookup error: rtorrent: undefined symbol

How to fix the error “rtorrent: symbol lookup error: rtorrent: undefined symbol”?

If you have installed rtorrent using RPMForge Repository, you are possibly seeing the error with libtorrent “0.13.2-1”. There is a conflict between the latest libtorrent and rtorrent. The easiest way, I have found to solve the error is to downgrade the libtorrent version using the same repository. Run the following to downgrade the libtorrent:

yum downgrade libtorrent

This should downgrade your libtorrent version to 0.12.9-2, which seems to work fine with rtorrent 0.8.9-2.

How to open .gz file in Linux/Unix?

You need to use gzip/gunzip program to open/extract a .gz file. It is based on DEFLATE algorithm. All the Linux/Unix comes with default gzip/gunzip program as it is used as primary compression technique in Linux/Unix based system.

How to extract a .gz file?

gunzip yourcompressfile.gz

or

gzip -d yourcompressfile.gz

-d refers to decompress the gzip file.

To view the latest file, type

ls -l

How to extract tar.gz file?

tar.gz files are tar files compressed with gunzip. You can use the tar program in Linux to extract a tar.gz file as following:

tar -xvzf yourfile.tar.gz

Here, x = extract, v = verbose, z = gzip, f = force

If the tar file isn’t compressed with gunzip, then you need to exclude the ‘z’ option which would be as following:

tar -xvf yourfile.tar

wp-supercache plugin for MH servers

I had written about using a cache plugin with all the wordpress blogs in order to reduce the CPU usage before. Although, some of our clients were complaining about issues with the most popular “wp-supercache” plugin with couple of our servers. We use some custom security protection which might block couple of wp-supercache commands. I here therefore, uploaded a workable version of  latest wp-supercache 0.9.9.9 that works perfectly with our servers. You can download the latest version of wp-supercache compatible with our servers here:

http://mellowhost.com/downloads/wp-supercache.tar.gz

Wp-supercache is a property of its original author. More details about this plugin is available here:
http://wordpress.org/extend/plugins/wp-super-cache/

How to protect your WordPress blog from web injection

I have been thinking to write this post for long time, although, couldn’t get time to write details about this major security issue. From my experience, I have seen a big percentage of users are using WordPress and a certain percentage always face some sort of Web Injections (Iframe for example) with any shared hosting provider. This post would go into deep to study why these web injections are occurring and how can you protect your wordpress blog from these sort of issues.

Continue reading “How to protect your WordPress blog from web injection”

Improving MySQL database performance!

Most of the shared hosting users use different content management system for their websites. There are different types of content management systems. These content management systems use mysql database most of the time. A CMS can have degraded performance when the user’s database gets fragmented. Mysql Database fragmentation appears when you make lots of changes on your database cause lots of writes and updates. Periodically, these changes cause memory fragmentation on the database, mostly MyISAM storage engine performs tremendous slow on a fragmented condition! This tutorial should have the advises for shared hosting users, how often they should defragment their databases and how!

Continue reading “Improving MySQL database performance!”

How “Niceness” impacts shared servers!

A very well known word in linux server is “nice” value. I have seen many people discussing about the effectiveness of Apache/Mysql tweaking, but eventually, if the throughput of your linux system isn’t good enough, apahce/mysql tweaking can fail. In this article, I am going to try explaining how “Nice” value of linux system can impact the performance of linux shared servers.

Continue reading “How “Niceness” impacts shared servers!”

How to stop wp-cron.php from firing!

Recently, I have written an article about reducing the cpu usage for a wordpress blog. My post contains some information about the wp-cron.php, but it doesn’t explain how you can stop wp-cron.php from taking high CPU. Couple of our twitter followers and facebook clients were asking for a post describing how they can stop wp-cron.php from taking high CPU or firing up. Here are some small tricks to reduce the CPU usage from wp-cron.php.

Continue reading “How to stop wp-cron.php from firing!”