Happy Nepali New Year 2071

Today is the 1st day of the year 2071, yes 2071. Its Nepali new year. Nepal follows a different calendar than Gregorian calendar. The number of days in a month are also not predetermined meaning they keep changing every year unlike the Gregorian calendar.

One of the fun times I have is when I am showing paper with my Nepali date of birth. Everyone seems to think I am from future :D

Once again,

Happy New Year 2071!!

How to set SSL version when sending requests via SoapClient?

Every now and then you are required to work on a API which is pretty big. However, the SSL version they have used is depreciated one so you cannot use standard SoapClient class to communicate with them. The following snippet allows you to create your wrapper class which extends SoapClient and allows you to execute a curl request with the correct SSL version. Thus allowing you to make a successful communication with that API

class WrapperClass extends SoapClient {
    protected function callCurl($url, $data, $action) {
        $handle = curl_init();
        curl_setopt($handle, CURLOPT_URL, $url);
        curl_setopt($handle, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml", 'SOAPAction: "' . $action . '"'));
        curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
        curl_setopt($handle, CURLOPT_SSLVERSION, 3);
        $response = curl_exec($handle);
        if (empty($response)) {
            throw new SoapFault('CURL error: '.curl_error($handle),curl_errno($handle));
        }
        curl_close($handle);
        return $response;
    }

    public function __doRequest($request,$location,$action,$version,$one_way = 0) {
        return $this->callCurl($location, $request, $action);
    }
}

Read More

Adding SWAP Memory in Linux

Linux divides its physical RAM (random access memory) into chucks of memory called pages. Swapping is the process whereby a page of memory is copied to the pre-configured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory and the swap space is the amount of virtual memory available.

The following is what you can do to add new swap space to your system:

To list swap partitions and swap files use:

more /proc/swaps

Follow the steps to configure swap space:

Read More

Mr Zoom

You have been with us in all the ups and downs in the last 3 years. You were there when we were renting, you were there when we were road tripping, you were there when we went to QLD. You have brought fun and joy to our lives, but now its time for you to do the same to another family.

We will miss you Mr Zoom, there will be no other car like you. We will miss the zippy drive and easiest parking. I am sure we will struggle with city parking from now on :'(.

Thanks for all the good times and hope your new family will take good care of you.

Adios!
Read More

Building a LAMP system using Puppet

I have always been interested in sysadmin, however the thing that annoyed me was trying to remember the config file contents. Back in the day when I used to work for Boss Pacific Information Systems, I would find the idea of setting up servers very interesting. In the mean time, the tedious task of remembering which config file to change and what to change was a bit daunting.

Recently, I have been introduced to Puppet script which has been used in my work environment has proven its importance.

“Puppet manages your servers: you describe machine configurations in an easy-to-read declarative language, and Puppet will bring your systems into the desired state and keep them there.”

This tutorial will show you how to create a simple puppet script to build a LAMP system which is the base for any web system. The components required for a web system such as apache, mysql etc are all available as modules from Puppet Forge
Read More

Rough-it up

My mate Mushroom roughing it up at the park this morning. May be its something that comes with white fur, you just want to rough it up and get dirty.

Luckily, today was his grooming day. He had a good clip and bath and this is what he looks like now.
20130818-215444.jpg

Read More

Aww the love

We left our beloved mushroom behind at home for few days to go and explore beautiful cairns. Come back and now he is terrified that we will leave him again and will be gone for few days. So he tries to pull every trick in the book to make us stay home. Breaks my heart :(

This morning he managed to have his face dirty, mind you, this dog is a princess and do not like dirt and being dirty.

PS: we had lovely couple house sit for us and look after Mushroom while we were away.

via Mushroom | Rujuna’s Blog.

Mushroom all groomed

Mushy before his grooming. I still remember the day. He purposefully got dirty so that we would stay home with him ;)

That’s him all clean. He smelt so good but we could hardly recognize him after his make over. Hope we haven’t stolen others’ pet. We just picked which ever was the cutes ;P

PS: he can now see the world without that fur photo-bombing his every vision :)

via Mushroom all groomed | Rujuna’s Blog.