Main menu:


August 2015
M T W T F S S
« Jun    
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Archives

The mystery of growing folder sizes

I tested something yesterday. I booted to my rescue USB disk and mounted the disk where I have Linux installed.
I ran cp -rap usr usr-new which preserves everything including symlinks, ownership, permissions, etc…
Then ran a script that md5sums all the files in usr and usr-new.

cd usr && find -type f -exec md5sum “{}” ; > ../md5sum.usr

cd ../usr-new && find -type f -exec md5sum “{}” ; > ../md5sum.usr-new

The checksum files were identical which means the new copy is intact.
But…running du -s -BK in both folders revealed that the old folder is almost 2MB larger in size.
After some investigation, I learned that a directory in Linux filesystems carries a list of the inodes pointing to the files in that directory. Apparently ext4 doesn’t delete pointers to files from a directory when the files are deleted. It just zeros the pointers. So an empty folder called test is 4K in size on disk but after adding and deleting thousands of files, the folder can grow with time. On a system that keeps getting updated frequently, that means ~2MB of lost space per year which is not much but nevertheless an interesting observation.

Some of my favorite new music

Needless to say, I am a big fan of certain styles of music such as classical (Richard Clayderman, etc…) and symphonic metal such as Nightwish. Old Disney movie tunes will always have a special place as well.
I was looking for music on youtube and I discovered a very talented Finnish artist called Henrik Airaksinen. He goes by the name ‘BlackSheep806′ and he composes various styles of piano and violin music. I never heard of this person till now but his music is amazing. You can listen to some of it on his website. My favorites are Sound of an Angel and Ocean Soul.
He also has a Facebook page but it doesn’t look like he posts very often.

Artificial Selection

This is a rather interesting. Basically people have been hunting and killing elephants for their tusks since ages. Ivory is then carved from the tusks and sold. Elephants with larger tusks are hunted first and therefore have less chance to survive and breed. The ones that do remain have smaller tusks and according to ENN, the average African elephant’s tusk size has gone down by half in the last century and a half.
I would guess we will eventually end up with mostly tusk-less elephants since there is (hopefully) no use for hunting them. Fascinating simulation of evolution.

Ain Mreisseh, Beirut

I took two pictures this afternoon in Ain Mreisseh, Beirut. The angle is bad but it is easy to see where the mountains meet the ocean shore on the other side of the bay and some snow left on the mountain top in the first picture (Click on the images for large versions).

Ain Mreisseh, Beirut

Ain Mreisseh, Beirut

Suggestions for Mystery Comedies

I am trying to find recommendations for mystery style films. They don’t need to be comedies although that is always a plus.
Some of my favorites are old Hitchcock movies, and things like Clue and Death by Murder. I prefer pre-2000s thriller or mystery movies because they had better emphasis on acting and effects.
Any suggestions are very welcome. Thank you!

Happy New Year, 2015!

Happy New Year to everyone who is reading this post :) . I hope everyone gets to spend the holidays with their families and have a wonderful year!

Happy New Year!

Lamborghini set to release a 6000 dollar phone

Lamborghini is set to launch an android mobile phone called the 88 Tauri. The phone is rumoured to run Android KitKat 4.4.4 on a quad core processor with 3GB ram and will cost 6000 US dollars.
For that price, they really need to support it with updates for at least 4 to 5 years.
The specs are nice and it should be able to handle the next few Android versions. I was surprised to hear it won’t ship with Lollipop.
I also wonder how many they will actually sell. Not many are going to buy a 6000 dollar phone that doesn’t even run the latest Android release. Manufacturing them will be tricky since I assume they will outsource the production similar to what Nokia will do with the N1 tablet.

There is a video and pictures on Lamborghini mobile website. The phone is elegant and nice looking but a bit bulky.
It looks more like a collector’s item to me :) .

Family Guy and The Simpsons crossover

I finally got around to watching the first five episodes of the 13th season of Family Guy. The first episode was a double length special feature where the Griffins ended up in Springfield while looking for their stolen car.

The episode was generally very funny but I could tell they went out of their way to show every cliche Simpsons joke such as “eat my shorts”. The fight scene between Peter and Homer was epic!

There was even a scene during that fight were we saw Homer as a Family guy character and Peter as a Simpsons character :) .

Peter Griffin and Homer Simpson

Website is now fully HTTPS!

Big thanks to cloudflare for this. They are slowly switching all plans, including the free plan, to https by giving away free SSL certificates. I am now on Full SSL. That means connections between my website and visitors, and between cloudflare and my webhost are fully encrypted.
This is wonderful news because it means over two million websites will now be more secure.
All links on my website should now redirect from http:// to https:// :) .

WordPress websites under attack…again

Last year, it was the wp-login.php brute force attack where bots kept trying to log on to websites by guessing the user name and password.
A basic step in protecting a WordPress website is not to have a user called ‘admin’.
For the last two weeks, there has been a wave of new attacks.
The new brute force attack tries to exploit XMLRPC in WordPress.
I was seeing thousands of requests to /xmlrpc.php per minute today.
I immediately went to cloudflare control panel and changed the Basic protection level to “I am under attack”. This gave me some breathing space while I figured out how to deal with this.
My first guess was to simply deny http access to that file.

<Files "xmlrpc.php">
Order Allow,Deny
deny from all
</Files>

However, this isn’t very effective as it will generate a mass amount of 404 pages which WordPress still has to process. It is no better than deleting the file itself.
As a final resort, I used a htaccess rule to redirect access away from the file.
The advantage of this is no high CPU or memory usage.
I added the following code to my .htaccess file

RewriteRule ^xmlrpc\.php$ "http\:\/\/0\.0\.0\.0\/" [R=301,L]

This is not an optimal permanent solution but it will have to do for now unless someone has a better suggestion :) . The attack itself lasted over 8 hours.

Update: The vulnerability that caused this denial of service has been fixed in WordPress 3.9.2 and the above workaround should no longer be needed.