Note to self: How to create new database and user in MySQL

Note: These ‘Note to self‘ series of posts are mainly for me to remember stuffs that I always forget. It might be handy to some, however.

Okay Ross, here’s how you create MySQL user and assign him/her to a specific database.

$ mysql -uroot -p
 
mysql> CREATE DATABASE 'DATABASE_NAME';
mysql> GRANT usage ON *.* TO 'USER_NAME'@'HOSTNAME' IDENTIFIED BY 'USER_PASSWORD';
mysql> GRANT ALL privileges ON 'DATABASE_NAME'.* TO 'USER_NAME'@'HOSTNAME';
mysql> FLUSH privileges;

Monosaurus: One-page Responsive HTML5 Template

Monosaurus is originally a template that I made in order to quickly start any one-page website. This includes some kind of microsite, event site, or a portfolio site. I thought of putting this template out in the wild and hopefully it will benefit some people out there.

Read more →

How to renew lapsed (expired) motorcycle road tax in Malaysia

With my intention to wake up the red devil, the very first thing that I have to do is to make the bike road-legal. This means, I have to get a new insurance and road tax for the bike. Since my bike’s road tax expires on December 2012, it has been more than a year, therefore I can’t renew my road tax the usual way.

Luckily, there are JPJ officials among my friends, so rather than get myself confused, I asked his insight for the actual process.

Read more →

Gratitude: Day 7

Looks like I’m at the end of the 7-day streak. Making these series of posts have made be sit back and realise that there are many thing that I take for granted, without me noticing. There are much more things to be grateful about, more than what these seven days can cover.

And now, for the final list:

  1. I am glad to be part of this 7-day gratitude project, many thanks again, William!
  2. I am grateful for the fact that, despite the terror and bizarre happenings in the world today, there are still contagious amount of kindness that made me believe that there are still hope for humanity
  3. I am very grateful that I am surrounded by the very same people that spreads this contagious kindness

There are many more things that I am grateful about. Some of which I am unable to pen down in words. Maybe someday I will talk about it.

Gratitude: Day 6

Woot! I’m almost at the end of the 7-day streak.

  1. I am grateful for my close friends, who despite me being seemingly off-contact and silent minding my own business, always drop by and say ‘Hi’ and checks on me
  2. I am grateful that I get to see the sunrise and sunset everyday, foregrounded by the infamous Federal Highway traffic jam.
  3. I am grateful that I have enough of what I need for myself, with spares for people and loved ones around me, in case of a need.

Gratitude: Day 5

Day Five. I’m almost there! Here’s for today:

  1. I don’t know what you call these things. But I love that it got invented. Solves all my messy bag trouble!
    IMG_0313
  2. Nescafe. Period.
  3. Lego blocks. It satisfies my inner desire to build things.

Customize WordPress User Profile Fields (without using a plugin)

If you take a look at your WordPress edit profile page, you’ll notice that there are some default fields. What if you want to add or remove (some of the) existing ones, preferably without a plugin and without hacking the core files?

Check out these steps on removing and adding some of the fields:

Read more →

Gratitude: Day 4

Today will forever be remembered by that fateful day of 9/11. Pay a little tribute to the victims and heroes of 9/11, shall we?

Continuing from yesterday, here are my 4th set of gratitudes:

  1. There are more awareness on famine, suffering and diseases around the world today. These have made many more who are able to assist. More avenues of help are open. (Those who take advantage of these events, shall die a horrible slow death). Most important of all – more are getting help.
  2. I am surrounded by positive people around me. They see obstacles as challenges, shut doors as options of another, and they keep each other motivated. The mindsets of people around me are astounding. They work collectively to find a solution, not to mourn at the problem.
  3. I am glad that there are people up there that are trying different approach to do things, and not doing the same thing over and over and expecting different results like their ancestors.

Gratitude: Day 3

I must confess, people (or, uhm, humans) are not very high on my list of things that I like. I, however, find them endlessly fascinating and observing them is something that I would do all the time. I am, after all, one of them.

Today, it’s Day 3. Let’s continue from yesterday:

  1. Malaysia. My home country, not only you give me a diverse culture to live in, you too, provide me with endless kinds of food that have wide variety of taste. I just couldn’t imagine one day without the food here. Oh and not forgetting the comic relief of the politics and happenings around. Haha!
  2. My Family. I apparently inherit the sarcasm, the tendency to troll and all the pun skills from them. They are the only people who gets to see me as who I am (well, there’s one more now) and have always been there for me no matter what (of course, who would deny the request of the supreme eldest son?)
  3. For being born with an inquisitive mind. I know curiosity kills the cat, but then again, I am not one. Now if only I can read and consume knowledge faster.

Simplifying SSH Connections on Mac OSX (and Linux) with .ssh/config

If you’re in an environment where you need to constantly SSH into several development, test and production servers and didn’t know about this trick, you’ll find this handy.

The issue I have with connecting to various machines remotely is that they are all on different ports, using different keyfiles and using various IP address that I can hardly remember. Typically, I’ll use something like this command to connect to each of them:

ssh -i ~/.ssh/keyfile username@127.0.1.1 -p 18098

Now imagine tens more of them with various IP address, port number and keyfile. After a while you’ll either end up writing an alias in your .bash_profile, or start saving all these information in a notepad. Although both options are fine (if you take proper precautions), I love the simplicity of a magic file called ‘.ssh/config

The Setup

Basically, create a file called ‘config‘ in your ‘.ssh‘ directory in your home directory (you can type cd ~/.ssh to get there quickly). Now for every connection profile you have, you can put these information in the file:

Host Production
    Hostname 127.0.0.1
    Port 18098
    User username
    IdentityFile ~/.ssh/keyfile

Once you’re done, you can simply connect to this host by typing:

localhost $ ssh Production

Repeat this sets of configuration for every host you have, and you’re set!