Blog

  • Enable vertical tabs in Google Chrome

    Note: Google unfortunately chose to remove the Side Tabs feature in Chrome 16. The instructions below will not work.

    ***

    I am a big fan of using vertical tabs in my browsing. Vertical tabs have several advantages:

    • Their titles are always readable, even with 40 tabs open.
    • They free up precious vertical space for content. This is especially important on widescreen monitors.
    • They are easy to click on, being consistently big and predictably positioned.

    I got addicted to them back when I used Opera. They followed me to Firefox with its excellent Tree Style Tab extension (and the Vertical Tabs extension in Firefox 4). Now that Chrome tempts me to switch with its amazing performance, it’s great that I can configure it to have vertical tabs too.

    There are two steps to enabling them.

    First, enter about:flags in your address bar. Enable “Side Tabs” and restart Chrome.

    Second, right-click on a tab and choose “Use side tabs”.

    Welcome to the wonderful world of vertical tabs!

  • Find a list of views marked inoperative

    When you drop and recreate a table, DB2 marks any views that query it inoperative. You will get the following error message if you try to query one of them:

    View or materialized query table "TRENDADM.IWM_CONVERSION"
     cannot be used because it has been marked inoperative..
     SQLCODE=-575, SQLSTATE=51024, DRIVER=3.61.65
    

    This has changed somewhat in DB2 9.7 with the introduction of DB2_DDL_SOFT_INVAL and auto_reval configuration settings. There are also ways to avoid it using transactions, CREATE OR REPLACE statements, and other measures.

    However, suppose you do have some inoperative views, and you’d like to get a list of them. The following query will fetch the list:

    SELECT viewname, viewschema, valid
    FROM
    	syscat.views
    WHERE
    	viewschema = 'TRENDADM'
    	AND valid <> 'Y'
    ;
  • Adopting a new WordPress theme

    New theme thumbnailAfter a pointer from rc3, I read an interesting article earlier today:

    In short, 9 of the top 10 Google search results for free WordPress themes provide themes full of malware and spammy links. The one site that doesn’t is the official site. Unfortunately, I have to say from experience that the free themes on the official site are consistently poor in quality.

    You can verify that your current theme is free of malware by using the Theme-Check and Theme Authenticity Checker plugins.

    The theme I was using before was clean, but the design quality was low. I began to consider buying a quality theme somewhere, but the article did point out two decent sites that have some quality free themes:

    I can’t vouch them, as all I have to go on is the word of that article. I did end up adopting the free TypeBased theme from the latter site, and I am very happy with it so far. It’s well-designed, polished, and it integrates nicely with WordPress 3.0.

    Oddly, Theme-Check does flag TypeBased as using base64_encode() and base64_decode() functions, but from what I can tell it’s in the legitimate context of an FTP API.

  • Migrating from Delicious to Pinboard

    DeliciousYahoo is shutting down Delicious. I’ve been using Delicious to share links with friends for years, so this is not a good development from my perspective.

    The Metafilter discussion about possible alternatives points out Unalog, Pinboard, Diigo, and a few others. I took a look and decided that Pinboard is the best bet. What I like best is that it has a business model — selling a cheap permanent membership. I like things with business models because I think they are less likely to shut down.

    There’ve been several shutdowns of free services this year — Xmarks went out of business (but were rescued by Lastpass), Ask.com killed Bloglines, Oracle is doing it’s best to kill MySQL, and now Yahoo is killing Delicious.

    Migration

    I found it very easy to migrate from Delicious to Pinboard.

    1. Open a Pinboard account
    2. Export your Delicious bookmarks
    3. Import your Delicious bookmarks
    4. Wait for Pinboard to catch up with all Delicious users importing their bookmarks at the same time
    5. Use Twitterfeed to set up automatic reposting to Twitter, Facebook, etc.

    Just like Delicious, Pinboard has lots of handy bookmarklets.

  • Find out your SLES version and service pack level from command line

    I recently needed to find out the version of SLES that was running using the command line. This did the trick:

    cat /etc/SuSE-release
    
  • Protect yourself from FireSheep with HTTPS Everywhere

    FireSheep is a new Firefox extension that makes it very easy to take over other people’s Facebook/Twitter/etc logins on public wifi networks. This has always been possible for people familiar with HTTP internals, but FireSheep makes it accessible to a lay person.

    The author put out a detailed essay examining the causes of the security issues FireSheep exposes. I highly recommend reading it as a good overview of the issues.

    There are two Firefox extensions that will do a lot to protect you from FireSheep and similar tools.

    HTTPS Everywhere is one of them. I’ve been using it since the first release. What it does is that forces the secure HTTPS protocol for sites like Facebook and Twitter that offer it as an option but default to HTTP.

    The only site I’ve had issues with for HTTPS Everywhere is Wikipedia. Here’s my config with Wikipedia disabled:

    HTTPS Everywhere configuration with Wikipedia disabled

    The other one that I just found out about is Force-TLS. Whenever it encounters an X-Force-TLS HTTP header, it will force HTTPS connections to that site in the future. This is not immediately useful, but it will become more useful over time as more web sites support HTTPS.

    I should mention that your Gmail accounts are safe, as Google wisely made it HTTPS-only earlier this year.

    Next steps

  • Going to CloudCamp on Tuesday Oct 26

    I’m heading to CloudCamp Toronto this Tuesday October 26 along with Antonio, Marius, and a few other people I know. Let me know if you are heading there too, so can  meet up and chat or maybe grab some food.

    CloudCamp

    Cheers,

    Leons Petrazickis

  • Batch file look-up table for month names

    The look up table goes in months.bat:

    :: one record per line
    :: = is the delimiter
    @echo 1=jan
    @echo 2=feb
    @echo 3=mar
    @echo 4=apr
    @echo 5=may
    @echo 6=jun
    @echo 7=jul
    @echo 8=aug
    @echo 9=sep
    @echo 10=oct
    @echo 11=nov
    @echo 12=dec

    Given a month number, you can then look up the month abbreviation as follows:

    :: Enable numeric comparison in if statements (Windows NT or better)
    @SETLOCAL ENABLEEXTENSIONS
    
    :: Set the month number you want to look up
    :: 8 is August
    @SET MN=8
    
    :: Look up the months abbreviation (e.g. 8 is aug, 9 is sep, 10 is oct)
    @FOR /F "tokens=1,2 delims==" %%i IN ('months.bat') DO @IF %%i EQU %MN% SET MW=%%j
    
    :: The month abbreviation is now the %MW% variable
    @ECHO The month abbreviation corresponding to %MN% is %MW%.
    • ‘months.bat’ executes that file and pipes the output to the FOR /F command
    • delims== sets the delimiter to the equals sign
    • tokens=1,2 means you want the first two tokens (e.g. 1 and aug for 1=aug=August)
    • %%i means the first token will go in %%i, second in %%j, etc

    Alternate solutions are welcome. I’m still a bit unclear on the difference between %%i, %i, and %i%.

    Useful links:

  • Looking for help with DB2 support in MediaWiki

    MediaWiki is the PHP application underlying Wikipedia and other sites. Over the past couple years, I’ve spent some of my spare time to add DB2 support to it. Here’s where things stand now:

    • Working: Installing on DB2 using the old installer
    • Broken: Creating and editing articles
    • Not implemented: Search
    • Not implemented: Installing on DB2 using the new 1.17 installer

    Implementing the installer was half the battle, as it required a fully functional DB2 database abstraction layer. I think the main issue with article editing right now are some data inconsistencies in the initial database.

    However, MediaWiki is getting a new installer in 1.17. I’ll try to spend some time soon to establish the scope of adding DB2 support to it, and then start implementing.

    My MediaWiki time is pretty limited, though. If you or someone you know can pitch in on debugging, maintaining, and expanding the DB2 support in it, I’d be very happy to bring you up to speed and review your initial patches.

    Keep in mind that MediaWiki is GPL software.

    Some links:

    • http://www.mediawiki.org/wiki/MediaWiki
    • http://www.mediawiki.org/wiki/How_to_become_a_MediaWiki_hacker
    • http://www.mediawiki.org/wiki/Commit_access
    • http://www.mediawiki.org/wiki/Manual:Coding_conventions
    • http://www.mediawiki.org/wiki/Manual:IBM_DB2
  • CCleaner utility for Windows

    CCleaner is one of my favourite utilities for Windows. It does several things very well.

    CCleaner ScreenshotOne of them is removing the temporary files that various applications leave lying around. For example, the Windows temporary files directory gets filled up with various installers that have a tendency to never be removed as well as fragments of files left open during crashes. For another, Windows retains the option to let you uninstall every patch Microsoft issues. This may be useful in a mission-critical server situation, but on a regular machine it just wastes space.

    I just had to clean up a very space-constrained virtual machine for work. CCleaner instantly freed up 1.4GB of space simply by removing crud left around by installers and other applications.

    CCleaner also does a beautiful job of correcting Registry inconsistencies, finding dead Start Menu shortcuts, and various miscellaneous tasks like free space management and cleaning up the Add/Remove programs list.