Code

 

As possibly the only NetBeans users coding in PHP in Singapore, I would like to announce in a somewhat lonely fashion that NetBeans 6.8 has been released. Despite being ridiculed for the past two years [insert laughter] for my unusual support for coding PHP with NetBeans IDE, I can never get used to something other than NetBeans so there’s probably something NetBeans did right after all.

If you’re on NetBeans 6.7, I urge you to upgrade. If you aren’t a NetBeans user, do give NetBeans a chance. It’s (probably) slower and Java-ish but the excellent code completion support more than made up for it. Oh yeah, and it’s free too.

Try NetBeans 6.8.

 

Opensource hero Richard Stallman gets hungry and will code for foot:

Richard Stallman Eats Something From His Foot

During a lecture Q&A session Richard Stallman appears to pick something off his foot or toe, places it in his mouth and chews on it. Disgusting!

 

Google now does DNS resolving too. You can switch if you’re using OpenDNS.

Introducing Google Public DNS: A new DNS resolver from Google

Today, as part of our efforts to make the web faster, we are announcing Google Public DNS, a new experimental public DNS resolver.

The DNS protocol is an important part of the web’s infrastructure, serving as the Internet’s “phone book”. Every time you visit a website, your computer performs a DNS lookup. Complex pages often require multiple DNS lookups before they complete loading. As a result, the average Internet user performs hundreds of DNS lookups each day, that collectively can slow down his or her browsing experience.

  • Speed: Resolver-side cache misses are one of the primary contributors to sluggish DNS responses. Clever caching techniques can help increase the speed of these responses. Google Public DNS implements prefetching: before the TTL on a record expires, we refresh the record continuously, asychronously and independently of user requests for a large number of popular domains. This allows Google Public DNS to serve many DNS requests in the round trip time it takes a packet to travel to our servers and back.
  • Security: DNS is vulnerable to spoofing attacks that can poison the cache of a nameserver and can route all its users to a malicious website. Until new protocols like DNSSEC get widely adopted, resolvers need to take additional measures to keep their caches secure. Google Public DNS makes it more difficult for attackers to spoof valid responses by randomizing the case of query names and including additional data in its DNS messages.
  • Validity: Google Public DNS complies with the DNS standards and gives the user the exact response his or her computer expects without performing any blocking, filtering, or redirection that may hamper a user’s browsing experience.

(Source: Google)

Just use the following name servers:

nameserver 8.8.8.8
nameserver 8.8.4.4

Nice numbers. They got those from Level 3.

 

I’ve been looking at the pricing of Amazon EC2 (Amazon Elastic Compute Cloud) running as if it were a VPS. I intend to run it continuously for as long as possible. I likely only need a small instance as described here.

Specification of EC2 Small Instance

  • 1.7 GB memory
  • 1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit)
  • 160 GB instance storage (150 GB plus 10 GB root partition)
  • 32-bit platform
  • I/O Performance: Moderate

These are some notes I have made for Amazon EC2. All prices are in US dollar and does not include bandwidth costs as those are far too varying.

I only need the smallest Linux/UNIX instance and the pricing is $0.085 / hour for a server instance in North Virginia, USA without reserving an instance. (There’s going to be one in Singapore next year.)

I can choose to reserve the server instance for 1 or 3 years and pay $227.50 or $350 respectively and pay for $0.03 / hour for a similar instance.

To put the cost into perspective:

For 1 year

  • Without reserved instance: $0.085 * 24 * 365 = $744.60 ($62.05 / month)
  • With reserved instance: $0.03 * 24 * 365+ $227.50 = $490.30 (~$40.86 / month)
  • Percentage saving after 1 year: (744.60 – 490.30) / 744.60 = ~34.1%

For 3 years

  • Without reserved instance: $0.085 * 24 * 365 * 3 = $2233.80 ($62.05/ month)
  • With reserved instance: $0.03 * 24 * 365 * 3 + $350 = $1138.40 (~$31.62 / month)
  • Percentage saving after 3 years: (2233.80 – 1138.40) / 2233.80 = ~49.0%

I’m currently on Slicehost and Rackspace Cloud. They’ve been pretty good so far but Amazon’s cloud computing offering is beginning to look quite tempting.

 

This isn’t exactly the latest news but — Amazon Web Services expands to Singapore. Expansion to Singapore would keep Singapore web hosting prices a lot more competitive. Amazon is bringing to Singapore:

  • Amazon Elastic Compute Cloud (Amazon EC2),
  • Amazon Simple Storage Service (Amazon S3),
  • Amazon SimpleDB,
  • Amazon Relational Database Service (Amazon RDS),
  • Amazon Simple Queue Service (Amazon SQS),
  • Amazon Elastic MapReduce,
  • Amazon CloudFront.

Yes EC2 is coming to Singapore over the second half of 2010. I am considering migrating some stuff over to Amazon due to its pricing.

Amazon Web Services Announces Expansion into Asia in the First Half of 2010

Amazon Web Services LLC, an Amazon.com company (NASDAQ:AMZN), today announced an expansion of its services into an Asia-Pacific region in the first half of 2010, enabling businesses to deploy compute and storage resources in close proximity to their end-users in the region. Software developers and businesses will be able to access AWS’s infrastructure services from multiple Availability Zones in Singapore in the first half of 2010, then in other Availability Zones within Asia over the second half of 2010. AWS services available at the launch of the Asia-Pacific region will include Amazon Elastic Compute Cloud (Amazon EC2), Amazon Simple Storage Service (Amazon S3), Amazon SimpleDB, Amazon Relational Database Service (Amazon RDS), Amazon Simple Queue Service (Amazon SQS), Amazon Elastic MapReduce, and Amazon CloudFront. (Source: Amazon)

Amazon has yet to release the pricing for Singapore but I’m guessing it would cost about USD0.20 per hour. Hosting hasn’t been that cheap in Singapore currently. If they charge less than USD$0.14 per hour for a small Linux EC2 instance, I would start advocating people to switch. Currently in US, Amazon charges USD$0.085 per hour. VPS hosting in Singapore is still kinda expensive for whatever reasons. Running a website really shouldn’t be that costly.

 

I haven’t been generous enough to spend money on higher RAM for my blogs. I started to notice slow downs in the blog recent, particularly caused by a particular plugin that does related posts. I found out by checking on slow queries log. Here’s how to get MySQL to log slow queries:

If you are using Ubuntu of Debian-based operating systems, it’s found in /etc/mysql/my.cnf. You may need to use

sudo nano /etc/mysql/my.cnf

Press CTRL + W, that’s search in nano. Find “slow” for the section for logging slow queries.

# Here you can see queries with especially long duration
#log_slow_queries        = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes

I uncommented “log_slow_queries” and “long_query_time”. I put long_query_time to 8. That requires a bit of experimentation. It depends on your environment.

I run the following command to check the slow queries:

sudo cat /var/log/mysql/mysql-slow.log

After you change the configuration in my.cnf, you need to restart. You can do so using:

sudo /etc/init.d/mysql restart

Hope it helps.

 

Addons.Mozilla.org is currently using CakePHP but they will no longer in 2010. They decided to adopt Django. (Source: Micropipes.com)

 

WordPress powered and Django inspired.
Love and elephants come after.
RSS: Posts and comments.