Money management

Someone on HN asked for some money management advice and so I’d thought I’d copy and paste it here with some edits.

I’m from Singapore so some of the points below may not apply to you but here’s what I do in case it helps.

I bought an iOS app which I use to track my income and expenses. This doesn’t help me save money except track how much I’ve spent on my credit cards so I don’t overspend and will have enough money to pay back the banks at the end of every month and not incur any hefty interest.

Credit cards are useful for getting discounts on things. I get a 5% discount when I shop for groceries at a particular store. When the annual fee comes, I call up the bank and ask for a waiver. They usually agree to waive it off.

I have 2 bank accounts with different banks. The first one which is where I use for spending on everyday needs and depositing my salary. This bank, POSB, is known for having lots of ATMs and conveniently located branches. But lousiest interest rate. I keep a buffer of around $1000~2000 in this account in case I need to spend extra in a single month.

The second one is for savings it’s MayBank and gives me a better interest rate but not a lot of ATMs. I setup my first bank account to automatically transfer $500 every month to this savings account. This recurring transfer is also setup on the iOS app I mentioned earlier.

I also have a strong discipline not to touch the amount in my savings account unless I really reaaaally need money. I might be able to grow more money investing this sum but it usually means I can’t touch it for a long period of time, say 5, 10 or 20 years. What if something goes wrong and I need the money badly?

I have a savings insurance plan which after paying a small monthly sum for 20 years, I end up with a huge sum more than the amount of premium paid when it matures.

On google docs, I noted down what my regular expenses are, like transport, food, household bills. So I know how much extra I will have after those.

Don’t be tricked by discounts that tell you how much you save if you buy that product. You save more money not buying it. It’s different if the product is a daily neccessity or you think will be beneficial.

If I were you, I’d build up a substantial amount of savings first before investing. An amount that will allow me to go jobless for a few months.

Or allow me to do things that’s beneficial to myself in the long run such as buying a camera to learn about photography. It’s what they call “investing in yourself”

Work/Play Balanced

I work 52 hours a week.
Took up 2 freelance projects.
Attend Japanese lessons every Saturday morning.
Have a few personal web projects of my own to work on too.

But still, at the end of everyday, I feel happy.
Because I enjoy everything I do listed above.

It’s a good time to be a web developer.

I do have other forms of fun too. Friday evenings, Saturday noon onwards till Sunday night is strictly reserved for gaming and movies.

Hosting websites on an AWS EC2 micro instance

A few months ago, I signed up for an account with Amazon Web Services to take advantage of the first year free usage on EC2.

It was a great learning experience as I get to configure everything in detail.

With shared hosting, someone else does the setup and maintenance for you. You can configure a few things in detail but you can’t have full control. It’s like public transport, you cannot change the parts in the vehicle, but you can choose where you want to sit, but you have to share the ride with a lot of strangers.

And it sucks if you have to share it with a serial fartist. i.e. Some silly person who took down the whole server with poorly written codes that take up lots of CPU, or whose website is the target of a DDOS attack and all other websites on the same server got brought down with it.

There’s also co-location and dedicated hosting but those are not affordable to the average web developer.

Then comes the age of cloud computing.

You get full control of a server at the cost slightly higher than shared hosting. You have dedicated CPU and RAM resources so no other server on the same physical machine as you can affect you. (Though I’m not sure what happens if those servers get DDOSed).

Long story short, my shared hosting account with DreamHost was expiring and so I migrated my remaining sites to my AWS micro instance server and here’s the things that happened and what you need to do if you want to run multiple websites on a micro instance as well.

At first, I did not configure my Apache and MySQL installations to work on low RAM machines (micro instances get only 613MB of RAM). They came with the default configuration settings that are meant for dedicated machines that have higher amounts of RAM.

A micro instance does not have a swap file configured. You have to do it yourself and here’s a simple guide:

Switch to root and follow these steps to add the swap space -

Type the following command with count being equal to the desired block size:
dd if=/dev/zero of=/swapfile bs=1M count=1024

Setup the swap file with the command:
mkswap /swapfile

To enable the swap file immediately but not automatically at boot time:
swapon /swapfile

To enable it at the boot time, add the following entry into /etc/fstab:
/swapfile swap swap defaults 0 0

 

Source: Adding swap space to Amazon EC2 Linux Micro Instance to Increase the Performance

Next, edit your apache config file and look for the Server-Pool Size Regulation section.

Most likely you are using the prefork MPM. Reduce the MaxClients to about 10. This varies depending on how much RAM each process takes. From my observations, my httpd processes take up about 40M of RAM at most. So I use 10, which allows me to have 10 running httpd proccesses all taking up 400M of RAM.

It would also be a good idea to reduce the MaxRequestsPerChild to something around 1000 in case of memory leaks. Situations where a process takes up more than 40M of RAM and keeps growing.

Better explanation here.

Without the above. My apache kept spawning child processes so much that it used up all available RAM and my MySQL process got killed off frequently. That means all my sites that are database driven are immediately crippled.

On a related note, back when I was a child, I loved how I could change parts on those Tamiya cars which gave me the illusion that it would run faster. Looks like my fetish for performance tuning is still there.

Erik’s guide to planning social gatherings in Singapore

You love to meet up with your friends and chat over dinner or drink.

You think organizing a meetup is as easy as creating an event in Facebook, adding people to it and just wait for the day to come.

And one day before the event, you check the event page on Facebook only to find that no one has responded or put their attendance as maybe.

What went wrong?

Nothing. It’s simply in Singaporean’s blood to “bo-chup” (don’t care attitude).

1) Decide a default location and time.

If you ask everyone about their opinions, you would most likely get none. And if you get opinions, great! Change it accordingly.

Those who do not respond are usually fine with any place.

2) Plan in advance. At least 2 weeks or even better, 4.

Most people usually have plans made for the week and the next.

Planning in advance shows that you really want to meet up with those invited. It’s like how people would book advance tickets for a show/performance they like as soon as the sales for those tickets begin.

And if you get the excuse that you’re planning way too soon, ignore it. It only goes to show that that person wants to reserve his/her time on that day for something else, and values that event more than meeting up with you.

3) When confirming attendance, call them or SMS them.

I’ve never seen a successful meetup planned using Facebook unless it’s a small group of very very close friends, or you’re someone so important that people want to be around you 24/7 and even when you go to the toilet.

Start confirming at least a week before so you know the group size and make reservations at the restaurant accordingly.

For those who sound unsure, tell them that you are making reservations at a certain date and you need to hear an answer from them by then.

4) Expect late-comers and prepare for it.

Despite Singapore being so small it takes less than an hour to travel from one end of the country to the other by car, people will still be late. But they’re not entirely to be blamed. Our “world-class transport system” has to have world-class failures too sometimes.

Plan your meetup in such a way that those who arrive on time won’t have to wait for those who are late.

If it’s a dinner meetup, go into the restaurant first with whoever is already there and start ordering and chat.

Or meet up at a game center first where people can play some games while waiting.

The last few movie gatherings I did for my anime club, we gathered at a fastfood restaurant so we can have dinner and chat before the movie starts.

Troublesome isn’t it? But after everything’s over, everyone will appreciate you for putting in all that effort to get them together. That alone is rewarding enough.

Robin Hood Taxes

I once wondered why governments need to make things so complicated with complex tax systems and all that.

When the government gave out relief on GST to citizens a while ago, I thought to myself, “If you’re going to give the money back anyway, why not abolish GST in the first place?”

The answer came to me today as I studied the Singapore Budget 2012.

It’s like the Robin Hood style of stealing from the rich to give to the poor. But in this case, taxing the rich more, taxing the poor less.

And to do this, taxes are enforced for most financial transactions and then tax reliefs are given to people based on the size of their homes (rich people usually live in larger homes). Not 100% accurate but the gist of it is somewhere there.