Robert de Bock

Kismac and a D-Link DWL-G122 wireless USB network card.

If you are lucky, you own an Intel MacBook, or even an Intel MacBook Pro. The only disadvantage is that it's difficult to scan and recover passwords for wireless networks secured by WEP using KisMac. You would need extra hardware to do that. I bought a D-Link DWL-G122 H/W Ver: C1 F/W Ver: 3.10 from Expansys in The Netherlands. (It actually came from France.) Costs around € 30,-. Here is how to use it in KisMac.

  1. Don't install any drivers! You will only be using this device in KisMac which provides its own drivers. If you did install it, see at the bottom of this article how to uninstall it.
  2. Download KisMac, the "USB-Drivers" version.
  3. Start KisMac and go to Preferences.
  4. Remove all Capture devices and add "USB device, passive mode". Enable all channels. Enable "use as primary device".
  5. Click "Start Scan". This will scan your area for available networks.
  6. Take note of the channel ("Ch", second column) for the network you would like to focus on. KisMac should be configured to only check that channel, so deselect all, except for the channel your are focused on.
  7. Restart the scan. You will collect packets much faster when using a single channel.

Play with all the other settings and have fun recovering your WEP password.

Uninstalling the D-Link DWL-G122 driver

I know these are not the official steps to uninstall the driver, but following these steps made KisMac work for me again. Be aware, these are the steps that I have followed, they might not work for you, or even break things. Know what you are doing!

  • rm -Rf /System/Library/StartupItems/DWLG122
  • rm -Rf /System/Library/Extensions/RT2500USBWirelessDriver.kext /System/Library/Extensions/RT73USBWirelessDriver.kext
  • rm -Rf /Library/Receipts/D-Link\ DWL-G122.pkg/
  • rm -Rf /Users/*/Library/PreferencePanes/DWL-G122WirelessUtility.prefPane
  • reboot

Optimizing your (drupal) website for Google

SEO is hot! Lets take a look at what you need to do to your (Drupal, or any other) website to be optimized.

If you use Drupal, keep these guidelines in mind:

  1. Don't worry. Drupal does quite well on SEO tricks. (Estimated importance: 30%)
  2. Focus on Site Information. (admin/settings/site-information) Make sure everything there is correct, and reflects exactly what you want to do with your website. (Estimated importance: 10%)
  3. Focus on good content. Good content will attract the visitors you are searching for. A blog or article section helps here. (Estimated importance: 40%)
  4. Optionally: Use URL-paths to make pretty URLs like /articles instead of /node/123. URL paths are part of the Drupal core. (Estimated importance: 10%)
  5. Optionally: Use the Drupal Google Sitemap module and Google Webmaster tools to let Google know what is on your website when you add content to your website. (Estimated importance: 1%)
  6. Optionally: Use the Drupal Nodewords module to enable the use of meta tags. (Estimated importance: 1%)
  7. Check Xinu Returns. This will help you filtering out common mistakes. (Estimated importance: 8%)

Always keep these basics in mind:

  1. Use text to display text, not images.
  2. Navigation should be simple.
  3. Send all traffic to one domain.

After hours of researching this topic myself I have concluded that Drupal does not require you to focus on SEO much. Instead, spend your precious hours writing good content. Focus on what visitors can find at your website, not on how to please Google.

Using multiple domains with Drupal

If you have multiple domains, all going to the same website, you can redirect traffic to your 'primary' or 'default' domain instead of serving the same content on all domains. Google measures your websites authority over the number of links to you website, if you have several domains, some using www. some not, then that authority is spread across all those (sub-)domains.
Another reason to use 301 redirects is that google maps uses a key, that is dependant of the url of the client. Not using this trick, would result in error-popups about an error in your API key on your visitors computer.

So; use 301 redirect to send all visitors to one default domain. Here is how to set it up, it should work for any website, but I have tested it on drupal

Open the .htaccess file that comes with drupal. (Be aware each update of Drupal will overwrite that file!) You will find these lines somewhere:

<IfModule mod_rewrite.c>
  RewriteEngine on

  # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

Read what is described and add a few lines. You can use regular expressions to tell the Rewrite Engine what to match.

  RewriteCond %{HTTP_HOST} ^www\.meinit\.nl$ [NC]
  RewriteRule ^(.*)$ http://meinit.nl/$1 [L,R=301]

  RewriteCond %{HTTP_HOST} ^www\.meinit\.eu$ [NC]
  RewriteRule ^(.*)$ http://meinit.nl/$1 [L,R=301]

  RewriteCond %{HTTP_HOST} ^www\.meinit\.com$ [NC]
  RewriteRule ^(.*)$ http://meinit.nl/$1 [L,R=301]

  RewriteCond %{HTTP_HOST} ^www.drupal\.nl$ [NC]
  RewriteRule ^(.*)$ http://meinit.nl/$1 [L,R=301]

  RewriteCond %{HTTP_HOST} ^www.robertdebock\.nl$ [NC]
  RewriteRule ^(.*)$ http://meinit.nl/$1 [L,R=301]

  RewriteCond %{HTTP_HOST} ^meinit\.eu$ [NC]
  RewriteRule ^(.*)$ http://meinit.nl/$1 [L,R=301]

  RewriteCond %{HTTP_HOST} ^meinit\.com$ [NC]
  RewriteRule ^(.*)$ http://meinit.nl/$1 [L,R=301]

  RewriteCond %{HTTP_HOST} ^drupal\.nl$ [NC]
  RewriteRule ^(.*)$ http://meinit.nl/$1 [L,R=301]

  RewriteCond %{HTTP_HOST} ^robertdebock\.nl$ [NC]
  RewriteRule ^(.*)$ http://meinit.nl/$1 [L,R=301]

As you can see, this single website can be accessed using the domains:

The approach described above is very simple, you could also use regular expressions to make one RewriteCond line, but to keep it readable when adding a domain, or upgrading Drupal, I have chosen to split each domain into a new line. You could also introduce loops that redirect from "a" to "b" to "a", etc.

Ergonomic keyboards reviewed

On a daily basis I use ergonomic keyboards, as "straight" keyboards make my wrists go painful. If you are in pain, read this article.

Years ago I started out with straight keyboards, and realized an ergonomic keyboard could improve my typing speed. For me the reason for slowly switching to ergonomic keyboards, was related to typing speed, not RSI, (repetitive strain injury) or pain in the wrists, shoulders, arms or fingers.

Microsoft Natural keyboardLikely the most used is the Microsoft Natural Keyboard Elite. This is a PS2 model, which is largely deprecated by now. Microsoft still sells USB versions with fancy multimedia keys. This keyboard however has helped me for years, was cheap and durable. As it is still quite common in office environments, try using this keyboard instead of straight types. It only takes a day or so to get used to it.

Logitech Comfort keyboardThere are some similar keyboards like Logitech Comfort Laser and possibly other. I have not tried them all, but since their design is quite similar, I assume that the experience is almost the same.

Kinesis Advantage KeyboardMy latest (and best, but most expensive) keyboard is the Kinesis Advantage keyboard. As you can see, this is a different type of keyboard. The hollow cups that capture the keys help to get your hands in the correct position. You use this keyboard as a QUERTY type keyboard, the only difference are the "special" keys: back space, space, delete, home, end, ctrl, alt, enter, page up and page down. You control these special keys with your thumbs.
This keyboard does require some getting used to, but it's well worth it. After a week, and some hours of training (comes with the keyboard) you are able to type at acceptable speed again.
Keys are (re-)programmable, which means you can copy keys to another location. As I use Linux the most, I have copied the alt key over the windows key. The keyboard comes with a few physical keys that you can replace, like ctrl, alt, windows and those type of keys.
There is a two-port USB hub integrated. You could connect mice and touch pads.
The angle between the two keypads could have been a little bigger. Sometimes it feels like the hollow cups are a bit too straight. Another thing, the top row of keys (esc, f1, f2, etc) is some sort of sticky rubber. Especially when using the escape key often, I accidentally hit f1. These keys are not positioned optimally, but I have accepted this con.

Datahand keyboardAnother keyboard is the Datahand. This keyboard is the most expensive of all listed keyboards, and looks so alien that it shocks potential buyers like me. I have one colleague though that uses it and is very happy with it. This keyboards also drives the pointer/mouse on the screen. Likely if you suffer the worst type of pains/RSI, this keyboards could safe your job.

Intergrating Google maps into a drupal website

It might just be me that does not fully understand how to use the Google Maps module for Drupal, so let me guide you on how to setup this module within your Drupal website.

First step: Download and install the two modules GMap and Location. After the files are installed, activate the modules "Gmap", "Gmap location" and "Location".

Second step: Go to the Google Maps API signup page and obtain a key. This key is the approximately 85 characters long.

Third step: Paste that key into the setting of Gmap, located at /admin/settings/gmap.

Fourth step: This might be optional, but was required for me; Enable the "GMap filter" in your filters, located at /admin/settings/filters

Fifth step: Create content with the gmap tag. Here is one example for which the code looks like this: (replace "WORD" by "gmap", sorry, drupal translates really well!)

[WORD|id=map1|center=52.094642,5.119704|zoom=5|width=100%|markers=52.094642,5.119704]

Javascript is required to view this map.

What you see is the neighborhood where I live, Utrecht. I used Webgeer media's website to guide me a bit.

Use bash (or sh) to hang a machine

Here is a simple trick, stolen from a mailinglist archive.

Be aware; this command hangs your box! Unless you have ulimited yourself.

:(){ :|:& };:

Now, it that the absolute minimum to hang a box? I guess so, but if you know similar shell fork-bombs, let me know.

Things war is good for

Here is an nice image (shamelessly stolen from a website with weird graphs) that represents what war is good for. Some highlights:

Using tar and ssh to efficiently copy files preserving permissions

Have you had situations where disk-space is sparse, so making full tars (although compressed) is impossible? Here is an ssh trick that could help you copy over files without using too much diskspace.

This trick will tar a directory from a computer, but the file that it would normally create, is standard out, so it is redirected back to the script on the computer you are working on. The computer you are working on extracts the information directly, so there is no location where (redundant) files are stored.

ssh [email protected] "tar czpf - /some/important/data" | tar xzpf - -C /new/root/directory

You are now directly copying data from the "machine-where-precious-data-is" to the machine you are working on, using the benefits of tar (preserving permissions, links, etc) but not being hindered by the difficulties of tar. (making these possibly large files and so on.)
I used this trick to copy users directories from one machine to the other.

An alternative command, reverse and not crossing filesystem boundries:

tar cpf - /some/important/data | ssh [email protected] "tar xpf - -C /some/directory/"

NFS server on OpenBSD, client on Mac OS X

Here is a small reciepe on how to setup an OpenBSD (I used 4.2) NFS server and have a Mac OS X (I used 10.5.1) client connect to it.

First setup the OpenBSD server to server /mnt/sd0a over NFS:

# echo "portmap=YES" >> /etc/rc.conf.local
# echo "nfs_server=YES" >> /etc/rc.conf.local
# echo "/mnt/sd0a -network=192.168.1 -mask=255.255.255.0" >> /etc/exports
# portmap
# nfsd -tun 4
# mountd

Now test the share on you Apple:

# mount_nfs -P 192.168.1.254:/mnt/sd0a /private/tmp/test/
# df -h /private/tmp/test
# umount /private/tmp/test

Now because apple used automount by default (check /etc/auto_master on your Apple) you can find the OpenBSD NFS server in the finder:
A screenshot of the finder showing the shared mountpoint.

Screencast: Installing OpenBSD 4.2

A screenshot of the OpenBSD installer.

Another screencast of how to install OpenBSD 4.2 in parallels on an Apple.

Explained is how this installer can be used, how sets can be downloaded and end up with a small working OpenBSD installation. This video is targeted for audience that does not know how to install OpenBSD. If you have some experience with installing OpenBSD, don't waste your time by watching this video.

Syndicate content