How to Delete Files in Directory in Linux

If you want to delete files within a directory in Linux, you can use this simple command

rm -f /your/directory/*

If you want to delete files and directories recursively within a directory in Linux, you can use this command instead 🙂

rm -rf /your/directory/*

Empty a File Using Linux Command

Today i received an e-mail notification from cpanel that a partition in my server is almost full.
First i checked largest directories / files using this command :

du -h --max-depth=1 /some/path

Then i noticed that they were some log files which took space in my partition 🙂


How to Remove Directory and Subdirectories Recursively in Linux

Sometimes there is occasion where deleting files from Cpanel takes a very long time to finish.
For example because there are too many files under a directory.
In this situation we can use SSH to delete a directory and all files and subdirectories under that directory.

We can use the command below.
But be careful, do not enter wrong path.
You may delete the wrong directory. 🙂

rm -rf /your/directory/
Reviews Wordpress

PremiumPress – Coupon Theme Review

I purchased the VIP Club membership in PremiumPress, so i have access to all of their themes. Initially i was interested with their Auction Theme, which i need for my project. But i saw that their other themes looked good too, so i bought the bundle package.

Now i will review their coupon theme. As side note, i also have tried to install their auction theme.
Installing the theme is easy. But at the first time of the installation, you will be asked to import dummy data.

I suggest you to import the dummy data so that your theme will be filled up with the default setting which is close to the theme live demo. I initially tried to not install the dummy data, and i was very confused because the theme has lot of panels, and setting pages 😀

Web Server

How to Redirect a Directory Using Htaccess

There is occassion where you want to do a silent redirect (not a 301 redirect) from a directory to another directory.
Doing silent redirect will make browser to assume that this redirection is a brand new URL, not like 301 redirect which tells browser to open (redirected to) another URL.

We can use htaccess to do this 🙂

Web Server

Redirect Single URL with Htaccess

Sometimes you want to change some of your URL. For example you renamed your old html file. Or you have removed some of your old files and you want to redirect them to a new URL.

But maybe other websites have linked to your old URL. You can’t contact them to change the URL, or you are too lazy to contact them, or maybe there are just so many backlinks pointed to the old URL so it is quite hard to change them all.

To avoid losing link juice from other websites, we must redirect the old URL to the new URL, with permanent redirection.

PHP Programming

Integrate reCAPTCHA v2 Into Pligg

Pligg supports some CAPTCHA, including Solve Media, and old reCAPTCHA.
Now i will write how to use reCAPTCHA v2 (click captcha) into Pligg.

First, you must get Google reCAPTCHA keys.
Second, open your Pligg admin, set the site & secret key under “CAPTCHA” sub menu and click “configure” next to reCAPTCHA.

Database Server


In some situation, like suggested in some mysql optimization script, you may want to regularly run “FLUSH QUERY CACHE”.

First, open your terminal and try to run this command :


If there is no error, you can add that command in your cron job, such as this command to run it every 10 minutes :

*/10 * * * * mysql -e 'FLUSH QUERY CACHE'

Setting MySQL innodb_buffer_pool_size

I was confused how big i should set my “innodb_buffer_pool_size” value.

Then i find this post in stackexchange.

I can run this query to get what is the suggestion of “innodb_buffer_pool_size” value.

(SELECT SUM(data_length+index_length) Total_InnoDB_Bytes
FROM information_schema.tables WHERE engine='InnoDB') A;

The result will be in GB.


iOS 9 Stuck in Slide to Upgrade

Recently i just tried to upgrade my 2 devices :
First, iPhone 5s from iOS 7 to iOS 9 using Wi-Fi.
Second, iPad 2 from iOS 8 to iOS 9 using Wi-Fi.

Upgrade of the iPad went successful.
But on iPhone upgrade, i was stuck in “Slide to Upgrade” step.
I could not do anything. I slided thousand times. Nothing happened.