Nicholas Tan JeromeTJ


Software Developer
Mountain Biking

Google Plus

Apache down after upgrade to Ubuntu 14.04 (Apache2 from 2.2 -> 2.4)

Posted: December 15, 2014 at 3:31 pm

After uprading the Ubuntu 14.04, my casual “localhost” does not seem to work anymore. Somehow it has to be related with Apache2.

Apparently, I also upgraded my version from 2.2 to 2.4.

According to this

I’m using an invalid syntax “LockFile” that is no longer supported.

Error 1:

apache2: Syntax error on line 214 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/httpd.conf: No such file or directory
Action ‘configtest’ failed.
The Apache error log may have more information.

Read on

Python | how to merge two lists horizontally

Posted: April 25, 2014 at 4:48 pm

Here is the scenario.

I have a list A

>> list_a = [1, 2, 3, 4]

and a list B

>> list_b = [5, 6, 7, 8]

I would want to obtain this:

>> [(1, 5), (2, 6), (3, 7), (4, 8)]

Read on

Git | how to git rm a long list of deleted files

Posted: November 14, 2013 at 10:41 am

Let’s say you deleted one folder that contains many many files. You want to commit this to your repository. Well, you can start to `git rm` every single file, but that is really really tiring. There’s a trick I found on stackoverflow. Basically you list all the deleted files and run `git rm` on each and everyone of them. It goes like this:

git ls-files --deleted -z | xargs -0 git rm

That should do the trick. If you want to know what these commands are…


Read on

tancolor.js | a nice image coloring jquery plugin

Posted: November 12, 2013 at 9:06 pm

This will be an introductory to a little jQuery plugin I’d written. For the impatient, just head to Github for codes and documents or head to the interactive demo page to play with it.


Generally this plugin offers four standard modes, which are grayscale, red, blue and green. These four modes are supposedly to be the standard for mostly used application. This may change depending on feedback from user.


Let’s do some colouring on obama’s picture.






    mode: "grayscale"

Read on

Github | git pull from remote branch

Posted: November 10, 2013 at 5:12 pm

This is something that I numerously look up on the internet, but still fails to remember it. Let’s say you are working on a repository and you cloned it. Then you noticed it only contains master branch, but you need to access other branch as well. How do you go about it? “git pull –all” doesn’t work here.

Read on

The Command to find them all

Posted: October 24, 2013 at 9:41 am

This will be an excerpt on a command that I find very useful, but at the same time never could remember it.

find . -name "*.py~" -exec rm {} \;

Read on

Starting to use list comprehension in Python

Posted: October 11, 2013 at 3:55 pm

It had been almost a year that I am actively programming in Python and lately I need to refactor a code that I did a year ago. I bet many of you had gone through what I am experiencing now. Not to mention that WTF/s. The objective of writing code a year ago is different now, it used to be getting the code work and everything will be fine. Now, there’s an urge to write better and maintanable code. I noticed I had been using list comprehension more intensively. There are several use cases that I will discuss here, mostly a pretty common scenario.


List comprehensions provide a concise way to create lists. Common applications are to make new lists where each element is the result of some operations applied to each member of another sequence or iterable, or to create a subsequence of those elements that satisfy a certain condition.


Read on

Pure CSS3 Carousel

Posted: October 8, 2013 at 4:10 pm

I have been having a lot of fun lately with HTML5 and CSS3 animations, which I have to admit, these latest API or features pushed the web development up to a whole new level. As I need to redesign an old website, I wonder whether there’s any easy way to take advantage of these new stuff to implement an image carousel without using plugin. I personally do not like to use plugin, don’t get me wrong, not that the plugins are bad, but when there’s something not working, you either need to start hacking that plugin, or you beg the author to fix it, either way is not what I like to encounter.


Out of curiosity, I search on the internet regarding “Pure CSS3 Carousel”, and I found a stackoverflow post. The accepted answer has no code example, but only a list of plugin recommendations. It also mentioned that purely CSS3 is easy to code.


This is really easy to code yourself…


Let’s start with this really easy code.

Read on

Getting Started with STK500 on Ubuntu

Posted: September 30, 2013 at 11:00 am

Well, the last time I did something on STK500 was back in 2009 and it really has been a while. Back then, I did my embedded project using AVR Studio in Windows due to my lack of knowledge in Linux. I think it’s time to start some hobby projects that I’d been discussing with my colleague, he’s definitely someone who can solder very well. My first encounter here with STK500 again will definitely NOT be in Windows, although I have to admit, AVR Studio had evolved to be a very decent IDE. But heck, I’m going to do it in my Ubuntu 12.04 and slashes through the hurdles.


Read on

How to setup Github User Page with Pelican

Posted: September 28, 2013 at 11:45 am

Github Pages has been introduced for a while and it’s a good tool for static websites or just as blogs. Here, I will show how to set up a working static blog on github pages using Pelican.┬áPelican is a static site generator, written in Python. It strikes as a very interesting method as you can write your content purely in your favourite editor (in Markdown Flavour) and commit your post or style changes using Git. Each and every revision of your changes will be saved in this revision control system. If you are not into GUI Editor system, you might just find yourself your favourite tool.


This is a guide that just works without needing to clone anything.


Read on