Archive | March, 2012

How To Install The Latest APC 3.1.9 On Ubuntu 10.04 LTS & W3 Total Cache Optimization

Yah another geeky post – woohoo! Anyway, when you are running high traffic WordPress sites – it’s very common to use W3 Total Cache (known as w3tc usually).

And with this you need some kind of in memory cache to store objects/db queries etc – the choice for a single server setup is generally APC as it’s part of the PHP core now (used to be eAccelerator/Xcache were contenders too).

Anyway never use APC for page caching – use disk enhanced and make sure your rewrites are working properly – your site will fly. For Object Cache and Database Cache – you should use APC (if you have a multi-machine cluster then use memcached).

The problem you might face (especially on Ubuntu 10.04) is that it uses a fairly old version of PHP and thus APC (3.1.3). I was facing horrible fragmentation with this setup and it will effect server performance over time. I could see from my monitoring that it was reaching over 20% fragmentation, this is not super bad – but over 10% is enough to worry for me as I’m a performance freak.

Munin php-apc graphing

I tried various different tweaks (ttl 0, ttl 7200, ttl 3200) but it wouldn’t go down. I eventually figured out I might try updating apc, rather than sticking with the one installed using: aptitude install php-apc.

Assuming you already have php-apc installed and configured, this single command will remove it, and install the latest version of APC.

sudo aptitude remove php-apc; sudo aptitude install php-pear libpcre3 libpcre3-dev; sudo pecl install apc

Then all you need to do is:

sudo /etc/init.d/apache2 restart

Or for nginx/php-fpm (my preference now):

sudo /etc/init.d/nginx stop; sudo /etc/init.d/php5-fpm stop; sudo /etc/init.d/nginx start; sudo /etc/init.d/php5-fpm start

And that’s it, now you’ll have the latest version of APC running and you should see a LOT less fragmentation (mine is hovering about 4% now instead of 20%).

php-apc fragmentation

I’ll keep an eye on it, perhaps change the apc.ini settings a little more (usually found in /etc/php5/conf.d/apc.ini) – for reference if you want those, here they are 馃檪


extension=apc.so

apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 128M
apc.optimization = 0
apc.num_files_hint = 2048
apc.user_entries_hint = 2048
apc.ttl = 7200
apc.user_ttl = 3600
apc.gc_ttl = 600
apc.cache_by_default = 1
apc.filters = "-/home/username/domains/yoursite.com/public_html/apc.php$"
apc.mmap_file_mask = "/tmp/apc.XXXXXX"
apc.slam_defense = 0
apc.file_update_protection = 2
apc.user_request_time = 1
apc.enable_cli = 0
apc.max_file_size = 2M
apc.stat = 1
apc.write_lock = 1
apc.report_autofilter = 0
apc.include_once_override = 0
apc.rfc1867 = 0
apc.rfc1867_prefix = "upload_"
apc.rfc1867_name = "APC_UPLOAD_PROGRESS"
apc.rfc1867_freq = 0
apc.localcache = 1
apc.localcache.size = 1024
apc.coredump_unmap = 0
apc.stat_ctime = 0

Enjoy!

Tags: , , , , , , , , , , , , , ,

Continue Reading 2 CommentsInternet & Tech, Sys Admin & DevOps

Happy 34th Birthday To Me!

Yah it’s my birthday again – wooohoo!

This is actually a scheduled post, because right now I’m somewhere in the World – and it’s a surprise (this was written March 18th and I have no idea where I’m going).

I guess you’ll most likely see where I’m headed on Twitter, so follow me there – @ShaolinTiger

Here’s a picture of me enjoying a beer on the beach in Koh Lipe last November.

Koh Lipe 2011

So yah, happy birthday to me and thanks to my awesome wife Kimberly for taking me away on a surprise birthday holiday!

Tags: , , , ,

Continue Reading 4 CommentsSite News

NIVEA Black & White Anti-perspirant Deodorant

Honestly, you really don’t want to be caught out with sweaty pits – it’s not a good look. Do you want to be this dude?

Armpit Sweat Stains

Or even this rather famous lady (Yes it’s Halle Berry who gets a mention here):

Halle Berry Armpit Sweat Stains

We all sweat, but we really don’t need to show it off…or let people smell it either. That’s why we have such wonderful inventions like deodorant and antiperspirant!

As a blogger (and generally happening guy) I go to a lot of events, and a lot of people take pictures of me..the last thing I want is something publishing a picture in a magazine or on their blog of me with a massive sweat stain on my shirt. So yah we need to wear something to keep us safe, smelling good and looking good – the next problem we will encounter is the stains many deodorants leave behind on your clothes.

So whilst you may smell good and won’t have sweat stains, you could end up with something just as bad (or worse) like this chap, who has the white deodorant residue stains you tend to get on dark (especially black) clothing:

Deodorant Residue

There are various brands of deodorant that claim they don’t produce the white residue on your clothing, but honestly that’s not the worst problem! For me the worst type is the yellow stains some products leave on your white shirts – those are truly gross.

You know the type caused by the chemicals in the deodorant and the sweat mingling, it really looks very unpleasant:

Yellow armit stains

Thankfully both of these issues can be avoided with a new product from NIVEA, NIVEA For Men Invisible For Black & White Anti-perspirant deodorant.

Only NIVEA Black & White can prevent white stains on black tops/shirts and reduces yellow stains on white tops/shirts, because I use NIVEA Black & White, I avoid looking like a tool in pictures 馃檪

ShaolinTiger - NIVEA Black & White

Spray it on with confidence, don’t be afraid 馃檪

ShaolinTiger - NIVEA Black & White

Tags: , , , , , , , ,

Continue Reading 3 CommentsAdvertorial

Future Music Festival Asia (FMFA) 2012 – With Chase & Status And Pendulum

You should know by now, I’m a MASSIVE electronic music fan – especially Drum and Bass.

One of my favourite acts is Chase & Status, a pair of fairly nerdy looking white dudes from London – followed by Camo & Crooked and then probably Pendulum. You can imagine my surprise (and pure delight) when I saw the lineup for Future Music Festival Asia 2012 (hereon known as FMFA) included both Chase & Status and Pendulum!

Imagine my dismay later..when they scheduled them both on at the same time…WTF? Seriously – there’s 2 DnB acts on in the WHOLE festival and 5 different stages – and they put them both on AT THE SAME FUCKING TIME. Pendulum was on for 2 hours (8.30pm-10.30pm), but was only a DJ set and Chase & Status was LIVE (8.30pm-9.30pm)! So yah!

We headed there around 7pm just as the sun was going down, I got my best junglist massive outfit on – ready to rinse out.

Junglist Massive

Yah my cap should have been Burberry, but I don’t have one – so neh. We chilled for a while first whilst the sun went down, grabbed a couple of beers and kicked back on the grass.

FMFA2012 Sunset

We were waiting quite a while, as the schedule seem to have gotten knocked back quite a while.

Waiting for something to happen..

The first act we caught was the rather late starting Sneaky Sound System, they were really really good live – the singer was incredible (both her vocals and her stage presence). Her name is Connie Mitchell and man can she move.

Sneaky Sound System - Future Music Festival Asia (FMFA) 2012

We were a fair way back at that point and it was a nice warm up to the festival, but really I was waiting for 8.30pm for Chase & Status to come on..they were delayed though and only started after 9 I think. I was happy to see the DJ decks rolled off and a full drum kit exposed with guitars and all sorts coming out – this meant 1 thing..

Chase & Status were going to be playing their music live! We headed right down into the chaos at the front, right next to the fence.

Chase & Status FMFA2012

Yah drum and bass played live on a drumkit – you can’t beat that shit seriously. They started out banging straight away with insane Dubstep and Drum n Bass tracks assaulting us non-stop. This is how sweaty you look after dancing and jumping to awesome dnb for half an hour or so.

Me & Kim at FMFA 2012

Then a female vocalist came out to perform Heartbeat and Time, I didn’t really catch her name – I think it was Holly something. Time was mind-blowing live.

Chase & Status FMFA2012

Here’s a short clip of it, apologies for the sound quality but the camera was clearly overwhelmed by the epic basslines. Listen to the original here.

The moshpit in front was getting pretty mad too, I wanted to join in…but I was scared I’d crush them all. This was during Fool Yourself – listen to the original here.

I didn’t take all that many pics or videos because I was busy mashing it up, junglist stylee. Their set finished at 10:08pm – it was legendary.

Chase & Status FMFA2012

After that we headed down to the other stage to catch the end of Pendulum, it was a DJ set though so it’s not the same – but Pendulum does have some mad tunes (like Watercolour). I would have liked to get down the front and mash it up for an hour – but due the timing – it wasn’t happening.

Just hung out at the back and caught the last 2-3 tracks he dropped.

Pendulum FMFA2012

It was ok, wondered around for a while – went to see Tinie Tempah – thought he was shite and left – headed back down to wait for Chemical Brothers to start..

There was a whole lot of confusion down there, no lights, no spotlight on the stage, no intro, no wording on the backdrop, no emcee – no one actually had any idea if Chemical Brothers had started playing or not.

And honestly whoever was playing was pretty shit, the music was meh. We hung around for half an hour or so, then headed off home. I heard Cosmic Gate and Wombats were good – but I wasn’t going to wait around through all that monotony till 2-3am to catch them both.

Got back in time for some awesome frog porridge in SS2 then off home to bed.

Honestly I would have driven all the way there, paid and gone home happily after an hour just to see Chase & Status live – it was that good. I hope I see them again…soon!

Tags: , , , , , , , , , , , , , ,

Continue Reading 2 CommentsMusic, Parties & Gatherings

Running Unattended/Automatic Security Updates on Ubuntu 10.04 LTS Lucid

I thought I may as well share/dump some of the tech stuff I learn on here because a) A lot of the stuff I find on Google is complete crap and b) If I forget how to do it I can just search my own blog (w00t) c) It might be useful to someone else.

Anyway, the objective of this exercise is to install security updates on Ubuntu automatically – commonly known as unattended updates (without any operator intervention). It’s not considered safe to install ALL updates unattended – just in case something goes wrong, but for security updates it’s important to install them ASAP.

And it saves you logging in to however many servers you manage (100+ for me currently) and running sudo aptitude update; sudo aptitude safe-upgrade; on all of them.

I wanted to achieve this without installing any additional software – so it can run on a bare-bones install (I’m a server minimalist).

In this case it’s for Ubuntu 10.04 LTS (we only use LTS versions of Ubuntu for production) but it should work on any Debian based variant. Ok first up:

sudo nano /etc/cron.weekly/apt-security-updates

When you have that non-existent file open, paste this inside:

echo "******START********" >> /var/log/apt-security-updates
date >> /var/log/apt-security-updates
aptitude update >> /var/log/apt-security-updates
aptitude safe-upgrade -o Aptitude::Delete-Unused=false --assume-yes --target-release lsb_release -cs-security >> /var/log/apt-security-updates
echo "Security updates (if any) installed at:" >> /var/log/apt-security-updates
date >> /var/log/apt-security-updates
echo "******END********" >> /var/log/apt-security-updates

Then make that file executable with the following command:

sudo chmod +x /etc/cron.weekly/apt-security-updates

What that file basically does is runs aptitude update and aptitude safe-upgrade and logs it all to a file – /var/log/apt-security-updates – so just in case if something goes wrong – you know which packages to look at.

Because it’s logging to a file, just one last precaution – so you don’t run out of disk space – is to add it to logrotate.

So what we do is create the following file:

sudo nano /etc/logrotate.d/apt-security-updates

Then paste this in:


/var/log/apt-security-updates {
rotate 2
weekly
size 250k
compress
notifempty
}

And that’s it, your machine will get updated with the latest security updates once a week and your HDD won’t explode because of huge log files.

Tags: , , , , , , , ,

Continue Reading No CommentsInternet & Tech, Sys Admin & DevOps

St. Patrick’s Day 2012 – The Friendliest Day of the Year!

I’ve appreciated St. Patrick’s day for many many years, I first really got to experience it properly when I studied in Liverpool – there’s a large Irish contingent there as it’s a port city.

It’s one day of the year where everyone loves everyone else, the English, the Scots, the Irish all get together in the pubs and share a few pints of Guinness!. That’s why they call it the Friendliest day of the year!

If you aren’t aware of St. Patrick’s Day, you can read more here – basically speaking St Patrick’s Day is an Irish celebration occurring on March 17 of every year and is one of the most observed celebrations around the world, enjoyed in over 100 countries worldwide.

You know it’s gonna be fun!

St Patrick's Day Malaysia 2012

On the 17th March 2012, there is going to be a crazy St. Patrick鈥檚 Street Party at Changkat Bukit Bintang. Apparently last year there were over 3000 people in attendance, and this year it’s going to be even bigger! The streets of Changkat Bukit Bintang will be transformed into an iconic St Patrick鈥檚 street party from 6pm till late! So do bring your mates and head down for a few pints of the black stuff.

St Patrick's Day

You know there’s going to be music, comedy and plenty of silly hats..and plenty MORE pints of Guinness!

St Patrick's Day

I’ll see you all there! Do pledge to join “The Friendliest Day of the Year” – Changkat Bukit Bintang Street party on Facebook here – there’s already over 30,000 and they are aiming to get 100,000!

St. Patrick’s Day Promo!

Every purchase of four glasses of Guinness Draught on any day in the month of March, entitles you to 1 limited edition Guiness St. Patrick鈥檚 Shot Glass. There are 5 designs available so make sure you try to get them all!

Tags: , , , , , , , , ,

Continue Reading 1 CommentAdvertorial

KONY 2012 – Make a Difference

First and foremost – this is incredible film making.

KONY 2012 from INVISIBLE CHILDREN on Vimeo.

Secondly, it’s an amazing cause – and yes we can all make a difference.

You can join Invisible Children on Facebook here:

https://www.facebook.com/invisiblechildren

Join the cause here:

https://kony2012.com/

And donate here:

https://www.stayclassy.org/checkout/donation?eid=14711

Tags: , , , , , , ,

Continue Reading No CommentsSerious Issues