Robert de Bock

Google Maps Mobile knows where I am (approximately)

This feature can change the mobile market, just as built-in camera's have, possibly more! If you download Google Maps for your mobile phone, you can use My Location. It does not use GPS but uses GSM antenna information to know where you are. This is not as accurate as GPS, and costs data, but if you have no GPS and have a data-plan, this is a cool feature. Take a look at this video:

Now what could be the next steps:

    Integrate with friends locations. Know where your friends are! Imagine being at a party, checking your phone to see if any other friends are there!

    Wardriving with only your mobile phone. If your phone supports WLAN, use it to scan access-points.

    Chatting to strangers nearby. Imagine a chat program that enables you to find people that have "Chat with anybody" set as a preference.

    Geocaching. GPS is more accurate, so this would require more descriptive hints, but it's possible!

Here in The Netherlands it tells me it is accurate within 1700 meters/1.1 mile, but the dot is acutally only 400 meters/0.25 miles away. I guess that mobile geographic application will dominate the future.

Using $GENERATE for PTR and A records

I was looking how to generate A records with the bind trick $GENERATE. There are lots of small articles available about setting up reversed lookups, but I could not easily find how to use this trick with A records. Therefore, here are my lines:

Forward or A record

$GENERATE 32-127 $ A 192.168.1.$

This will generate names like

Reverse or PTR record

$GENERATE 32-127 $ PTR $

This will generate the reverse part, it will enable you to do a host and get back the result.

5 ingredients for a good blog article

After reading many blogs and articles, I have discovered these basic ingredients keep me interested:

5. Short articles don't scare me away
Long articles make me loose interest when I see them. Shorter articles can be much more informative. I only take a minute, maybe 2 to read your article.

4. The essence keeps me interested
Some articles go into (not very interesting) details. This makes me loose interest too.

3. Structured articles help me
I want to be able to see the structure of the article/information within seconds. Using lists (<ol> and <ul>) and headings (<h2> or <h3>) helps.

2. Specialized topics interest me
I don't want to read news-paper style articles, otherwise, I would have bought a news paper. I am on the internet because I can read all these special articles.

1. The title should capture all information
I skim through websites only reading titles. Only if a title interest me, then I will stop scrolling and read that article.
A good example is the titles used at Boing Boing.

Help Network Solutions obtain idiotic domains

I was amused after reading this Network Solutions domain name registration story, I tried it for myself. Check out how easy it is to make Network Solutions pay another few Euros/Dollars:

1. Check if a domain is available

You can use online services, but whois from the command line like this:

$ whois

2. Check with Network Solutions

A stupid web-form on Network Solutions will say the domain is available for you to register. Meanwhile, Network Solutions has registered the domain.

3. Check whois again

As you can now see, Network Solutions has registered the domain. This process takes a few minutes only.

$ whois
   Whois Server:
   Referral URL:
   Status: clientHold
   Updated Date: 21-jan-2008
   Creation Date: 21-jan-2008
   Expiration Date: 21-jan-2009

The domain is in "clientHold" status for a year now. How rude is that? There will be many people shopping/browsing free domains using Network Solutions that are now only able to use Network Solutions to register their domain. (Or wait a year until it is free again...)

Registering a domain costs money, so I suggest you type in many idiotic domain names that nobody will ever be interested in. Some suggestions:

  • Combination of four or more words.
  • Words that are misspelled.
  • Words that do not exist.

How to waste time on the internet.

Have you ever wondered where you spend most of your online time? With the weekend coming up, here is a list of websites and activities that I do regularly.

  • Stumbling! This is a great way to discover new websites, read interesting stories that fit within your interest profile.
  • Reading news. Sites like Boing Boing, Tweakers (Dutch) and RSS feeds on Me in IT.
  • Reading email. I guess everybody does that. Switched to gmail recently, that reduced my time sorting and organizing.
  • Answering (and posing) silly questions. A great website when you have nothing else to do. Pose and answer questions that you have an opinion about.
  • Blog This is a great activity. Write about things that interest you!
  • Updating your contacts or profile on social networks. There are a few social networks that I frequently use: LinkedIn, Hyves (Dutch), Plaxo and Facebook.

Have fun but be sure to switch off the computer after a few hours, go and have a drink in the city, where your RL/physical friends are.

Upgrading Drupal with the least amount of downtime

When you need to upgrade Drupal because the Update Status Module tells you it's required to upgrade, here are the steps to take with minimum downtime:

  1. Backup your files and database. Use tar -cvzf drupal-old.tar.gz /path/to/your/drupal/installation and mysqldump -u USER -pPASSWORD DATABASE > /path/to/where/you/want/to/store/your/database/backup. (Replace the CAPITALS with your username, password and database. I have this step implemented in a cronjob, so do not do this during the upgrade.
  2. Unpack the new Drupal release. I do this next to the directory where my "life" Drupal installation is.
  3. Copy sites/all/themes, sites/all/modules, files/, .htaccess and sites/default/settings.php the the freshly unpacked Drupal release. Depending on what you website contains, this could take a while. The files directory contains all images for example. Sometimes a run a diff for the two settings.php and .htaccess, to check if no major things have been altered in the settings.php. If major things have been changed, copy-paste the required variables.
  4. Set the website off-line.
  5. Make a note of - and disable all third-party/non-drupal modules. This can be quite time consuming, especially for websites that have many modules depending on each other. Making the note can be done before taking the website off-line.
  6. Make a note of the used theme and switch to Garland. You can also take these notes before taking the website off-line.
  7. Move the old directory to something called old. I mostly move it to drupal-x-y where x-y is the release number of that unupgraded Drupal installation.
  8. Switch back to the original theme. Check your note.
  9. Turn on the originally enabled modules. Again, check your note.
  10. Run update.php. Just open your website with update.php at the end. Like this:
  11. Put your website back online.

Here is a "real" session as done in the terminal. The web based commands are described.

This part is to prepare the upgrade, the (old) website is still available.

[[email protected] client]# ls
drupal-5.6.tar.gz  html  logs
[[email protected] client]# tar -xzf drupal-5.6.tar.gz
[[email protected] client]# mkdir drupal-5.6/sites/all/modules
[[email protected] client]# mkdir drupal-5.6/sites/all/themes
[[email protected] client]# cp -Rip html/sites/all/modules/* drupal-5.6/sites/all/modules/
[[email protected] client]# cp -Rip html/sites/all/themes/* drupal-5.6/sites/all/themes/
[[email protected] client]# cp html/sites/default/settings.php drupal-5.6/sites/default/settings.php
[[email protected] client]# cp -Rip html/.htaccess drupal-5.6/.htaccess
cp: overwrite `drupal-5.6/.htaccess'? y
[[email protected] client]# cp -Rip html/files/ drupal-5.6/

Everything is ready now, so login with your account that has ID 1. and take the website in off-line mode at admin/settings/site-maintenance. Take a note of all third party modules enabled and disable all third party modules. Also take a not of the default theme, switch to the garland theme.

[[email protected] client]# mv html drupal-5.5 && mv drupal-5.6 html

Now enable the modules that were disabled before and switch to the original theme. Run update.php. Check if everything is working and put the website back on-line.

When you are logged out during the process of upgrading, login with mysql and execute these queries.

UPDATE variable SET VALUE='s:1:"0"' WHERE name='site_offline';
DELETE FROM cache WHERE cid = 'variables';

And visit to login again.

Top 5 stupidest blog responses

Just for the ignorant blog-commenters out there, here is a list of comments that have already been made, and do not require to be used ever again.

  1. First! - Also don't use Second!, Third! and so on.
  2. I want to have one. today! - In response to new gadget reviews. Who would not like to have one? Use storage sanely, prevent these kind of not-helping-comments. There is even a website dedicated to I want to have one.
  3. OMG - It does not help humanity to express your feelings without adding any information. Remember that adding a few bytes in a comment will consume electrical energy as well! Same for WTF, ROTLF, STFU, LOL and other related terms.
  4. Thanks! - Although the author can be proud of such remarks, it does not add any value to a blog. Just like Yes and No will not add much value.
  5. Nothing to add. - Well, then don't add anything please.

One great inspiration of stupid comments is YouTube. People just have enough time there.

HSDPA from T-Mobile on MBP - Mac os X 10.5.1

After some hours of trying I now have a working connection with my Dutch T-Mobile Web 'n' Walk account. The default software and instructions did not work, the Launch2Net for Mac - T-Mobile Edition does not work as is, but there is a trick available to make it work.

  1. Put the SIM that your received with your Web'n'Walk account in a mobile phone, make it not ask for a PIN. On my Nokia this function can be found under Security Settings - PIN code request: off.
  2. Download and install Launch2Net for Mac - T-Mobile Edition.
  3. Login Items screenshotDisable the NML2NDeviceObserver in System Preferences - Accounts - Login Items for your account. This prevents the Launch2net program to be started when you insert your Express Card into your MacBook Pro. N.B. Use the minus sign to remove that specific item, not the check-box.
  4. Screenshot of Network Preferences on Mac OS X 10.5.1Now go to System Preferences - Network. You will find a new "GlobeTrotter HSDPA Modem. Use the Account Name: tmobile, Password: tmobile. Hit Advanced, Vendor: Option, Model: GSM, APN: internet, CID: 1.
  5. Hit connect and you should be connecting with your Option Express Card modem that came with your T-Mobile mobile internet account.

Some difficulties I found;

  • The SIM needs to be in all the way, not partially. Yes, it sounds stupid but I did not insert the SIM far enough.
  • The Launch2Net from nova media did work, but costs € 75,-.
  • The speed varies from moment to moment; It can go up to 50 kilobytes per second to download something, but 10 seconds later it only does 3 kbps.
  • With this work-around you can't check the reception quality.

What is "load" or "load average" on a linux box?

Most people will know how to display the load on a linux box, use "w"(1), "top"(1), "uptime"(1) and likely a few other commands to display the 1, 5 and 15 minute average of the load. Most people will also know that a high load is "bad" and a lower load is "better". But; what does the load imply, what influences load and what load is acceptable?

What does load imply?

There are many interpretations and explanations on what load actually is. Lets take a look at a few statements.

  • Red Hat: The load average is a number that corresponds to the average number of runnable processes on the system.
  • Spagmoid: load average is the average number of processes in the run queue.
  • Wikipedia: In UNIX computing, the system load is a measure of the amount of work that a computer system is doing.
  • Robert de Bock: The number of processes that are waiting for I/O.

What influences load?

The load is caused by a combination of items:

  • Speed of the CPU and CPU utilization.
  • Usage and amount of memory.
  • Disk usage and the speed of those disks.
  • Use and speed of buses, like the PCI network card, the USB disk and others.

In general; a high load indicates that processes are waiting to be processed. The waiting indicates that a bottleneck exists in the system. That bottleneck could be the CPU, the disk, the (slowness or amount of) memory or any other bus. Tools like "iostat"(8), "top"(1) and "sar" and performance monitoring with applications like "mrtg", "munin" will help you find out what the limitations of your hardware is.

What load is acceptable?

This question depends on a few factors:

  1. What is the purpose of the system? If users work on a system, (like a web server) the load could be more critical than when a system is used to process batches of data. (Like mail servers or cluster nodes.)
  2. How many CPU's does your system have? In general you could say that each processor allows a load of 1.00. So a 8 processor machine, could healthily handle a load of 8.00.
  3. What is the nature of the load? You will have to collect more than just a few minutes or even days to see what happens to the load over time. A sudden burst, where the load increases could be acceptable.
  4. What is your budget? Mine is limited, although I see a high load on my machines from time to time, I accept this high load and know that systems do not run optimally.

Load is treated like a magical number, that is used to report to managers about speed of services. I do not agree with that statement. The only reason to monitor load, is to detect sudden changes. Load does not indicate that a system has a problem if there is no baseline determined.

Performance analysis on OpenBSD

You are running OpenBSD and encounter some problems with response time of a machine? Read on. This article is a small list of tools you can use to find out where the problem could be and how to solve it.

A performance problem could be defined as: The response that end-users experiences is slower than expected. I have had many discussion about what a performance problem actually is. For example; database administrators will not consider a load of 1.00 a problem on a machine with one CPU. Most system administrators will consider this is a performance problem. I guess it all depends on the nature of the service.

Okay, be your manager is still at your desk, waiting for you to perform magic, so let's get to it.

  1. Run "top". It will display what processes eat the cpu. When top(1) is running, hit "o" to select a new ordering method and type "cpu" to find the must CPU consuming processes. Other variables instead of cpu are "size" and "res" to find out about memory usage, "time" to see what process has been running for so long and "pri" to find out what the priority was assigned to a process. Focus on cpu, size and res.
  2. Run "systat vm". systat(1) will give you information on activity of the disks and interrupts. The interrupts will tell you what driver is causing the most interrupts. This could tell you that your network card is being utilized a lot for example.
  3. Run "systat ifstat". This will show you the network activity.

From experience, this is the list of problems that I commonly encounter:

  1. Incorrectly configured network settings, mostly /etc/resolv.conf
  2. Not enough memory
  3. Disks being slower than expected.

If you can't figure out what is wrong, adding memory never hurts.

When you would like to go a step further, try ktrace(1). Start it with "ktrace -p PID" where PID is the process number of a suspicious process. ktrace(1) dumps all output in a file ktrace.out, which can grow "really" fast. Use "ktrace -C" to stop the tracing.
kdump(1) is used to read a ktrace(1) file. Use "kdump -f ktrace.out" to read and print the file ktrace.out generated with ktrace(1). The output is enormous, so pipe it through less(1) or grep(1) to make it readable.

What I see often is system administrator using ping(8) to analyze network performance. I think ping is a very bad tool for this purpose, better use time(1) and telnet(1) or some script to check the service that clients are complaining about.

Syndicate content