Convert Webp image to png under osx/linux

You can find the open source project here : http://www.webmproject.org/code/

To build the tool from source

You can find the dwebp utility under “examples” folder

You can test it out using the test.webp in the same folder

 

Getting started with Tex/Latex on Mac/Linux

This is some notes I’ve learnt after hours and hours trying to figure out how Tex/LaTex works! I found it very hard to find a beginner’s guide, so I decided to write down what I’ve learnt in the simplest way I can explain. Continue reading “Getting started with Tex/Latex on Mac/Linux”

Install Tex on CentOS linux

Actually it’s pretty easy with Yum group install, a lot of people didn’t even notice this

There you go! run “tex” or “latex” in the shell and it’s up and running.

Sometimes you also need dvipng to compile Tex into PNGs

Something about yum groups

if you want to see what packages is in this group, you can run:

If you want to see what other Package groups in yum, you can run

 

Define a Catch-all Named Virtual Host in Apache

Let say you have 2 virtual hosts A.com and B.com on your web server, do you know that it is possible that your visitor may accidentally access A.com while browsing B.com? As a best practice, defining a catch-all Virtual host can prevent such scenario. Continue reading “Define a Catch-all Named Virtual Host in Apache”

Renaming files with case change in a Git Repository

Changing the filename with case change only using the unix command “mv” will not be detected in Git.

The general advice is using the git sub-command “git mv” to rename files, when I type this I saw the below error

It looks like the Mac file system is not case-sensitive, hence the error. The workaround is that, rename the file twice

No complain from Git! Enjoy!

PHP “Invalid library” error related to ‘mcrypt.so’

While I was compiling PHP from source to install the latest PHP version 5.5.4 on the OSX (10.7.5 Lion). (BTW, try not to do this at home because this can be a tedious process! )

I got the following error:

PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) ‘mcrypt.so’ in Unknown on line 0

My php.ini is from previous version, and it is located at /etc/php.ini Continue reading “PHP “Invalid library” error related to ‘mcrypt.so’”

Compiling git from source on CentOS

Prerequisite

You need the Perl libraries in order to compile git, you also need the “gettext” package if you encounter the “msgfmt” error

Download

Go to this page to select the latest git, and download it

https://code.google.com/p/git-core/downloads/list

Installation Steps

There will be an error Continue reading “Compiling git from source on CentOS”

“Can’t locate ExtUtils/MakeMaker.pm” while compile git

While I was trying install the latest git by compiling the source, I got the following error

Turns out the Perl headers are missing, using yum to install it solve the problem

Update 2015-03-05:

Some said it’s related to the CPAN module, I have no idea what it is, if the above not work, try also install the CPAN by:

Install Memcached with PHP extensions in 5 mins (CentOS)

Memcached is a distributed Memory caching system, it is probably the de facto standard of caching facility for high performance web applications. In short, it is a key-value store which runs entirely in the memory, so it’s extremely fast and also proven to be reliable to handle high traffic.

Steps to install on CentOS (just works!)

Run the following commands one by one in the terminal, this will install the memcached server, and the PHP “Memcahe” classes needed to be used by Continue reading “Install Memcached with PHP extensions in 5 mins (CentOS)”

Linode VPS doubled the storage!

Linode doubled the storage space for all customers, according to their company blog post. I can’t believe it, they actually give away resources for free! (well…not exactly free, but they charge absolutely NOTHING for existing customers). Pretty Impressive!

The new Linode lineup:

  • Linode 1GB disk space increased from 24GB to 48GB
  • Linode 2GB from 48GB to 96GB
  • Linode 4GB from 96GB to 192GB
  • Linode 8GB from 192GB to 384GB
  • Linode 16GB from 384GB to 768GB
  • Linode 32GB from 768GB to 1.5TB
  • Linode 40GB from 960GB to 1.875TB

In fact, this is not the first Free upgrade they offer, not long ago they doubled the memory, for me, from 512MB to 1024MB!  This blog is running on a VPS provided by Linode.com, I have been using them for almost a year now. Their service is exceptional I would say, Fast setup time (within minutes), stable network, Easy-to-use yet featured-packed Dashboard and Great Support services. And most importantly for we customers, it’s surprisingly cheap. I recommend all of you to use Linode when you consider a VPS/Cloud Server. They’re not the fastest server in my region (I live in Hong Kong), there are tones of local providers I could choose from, but I still choose Linode for their premium service.

Links:

  1. Go to Register Linode with my code
  2. Linode Offical Website
  3. Linode Blog » Storage Space Doubled!