December 23, 2010


7 million Skype users are online, and none of them are my friends. Skype has been down for almost 24 hours, and my phone has been ringing off the hook since this morning from desperate users who can't get in touch with their friends or customers. It's amazing for my users to realize how much they depend on technology when they're suddenly cut off from it.

I most definitely wouldn't want to be a member of Skype's IT team right now.

October 29, 2010

Technical PDF on the iPad

I've wanted an iPad since it was released to read my technical manuals in the PDF format (mostly because the Kindle didn't work so well). Unfortunately, I could find hundreds of iPad PDF viewer reviews online, but none of the reviews I found talk about the actual usability or display quality, and none of the iPad's I saw in real life have any PDF's loaded. I've walked up to strangers in public asking to see if they have technical PDF's in their iPad's, but all I've ever seen are games.

Since I couldn't find out the quality of iPad PDF displays and I didn't want to buy one blindly, so I gave up the idea of buying an iPad earlier this month. But of course, fate works in mysterious ways.

You need to click on the image to see the full size. The PDF's I loaded are Wrox's SQL Server 2008 Internals and Troubleshooting that I've been digging into lately, and a "borrowed" copy of Wiley's Mastering AutoCAD 2011 and AutoCAD LT 2011 so I can see display quality of images inside PDF. It has already been deleted as I'm not an AutoCAD user.

iBooks is the ebook app and store frontend from Apple, but it also handles PDF files. The display quality is good. But like most Apple programs, there's no way to customize the program at all.

Stanza is probably the most well known ebook reading app and it's available for every device. It handles PDF really fast, and there are all kinds of customization settings that helps the "reading experience". However, maybe because the program is optimized for real ebook formats such as ePub, the PDF display quality is really really poor.

GoodReader is perhaps the best known PDF reader, having separate iPhone and iPad versions. There are tons of customizations, but none of them seem to be really useful. I also hate that it has page flipping animation if you swipe to turn the page, but no animation if you tap to turn. However, the PDF display quality is by far the best. As can be seen in the images below, the graphics in the PDF can be seen clearly without zooming, and the AutoCAD image is smooth without jaggies.

ReaddleDocs is probably the most famous PDF reader since I see glowing reviews for it all the time and it's promoted everywhere. In fact, it was the first I tried. But it turned out to be really bad. Both the controls and image quality can't compare with any of its competitors. There is also a separate iPhone version available.

Fast PDF is not fast.

iRead PDF is the free version of iAnnotate PDF without the annotation features. iAnnotate PDF was popular for a while for being the first iPad PDF app that allows annotation simply by writing and marking with your fingers, but most of the competitors have now added similar features, and it just doesn't stand out any more. Also, it seems to be geared toward annotation and not reading, so the "reading experience" is lacking. There's no capture of the AutoCAD book since I just didn't care about the program enough to keep going.

pdf-notes is a free app that allows annotation. But it's slow and doesn't handle PDF display that well at all. Once again, there's no capture from the AutoCAD book.

It's quite obvious that the display quality of embedded graphics is greatly enhanced by anti-aliasing the graphics. But I looked and none of the apps have a setting to toggle anti-aliasing. It's either there (iBooks and GoodReader) or it's not (the rest), which is why iBooks and GoodReader are the best choices for PDF with embedded graphics.

Finally, I have some photos taken with my iPad next to the SQL Book. The first photo is the book opened to the same page as the screenshots above, and the second photo is opened to a random page that shows some code. The iPad is running GoodReader.

Some moiré is visible on the iPad screen due to the low quality screen protector film. This is not a screen protector film review, but that particular film is so bad that after two days, I already have permanent markings on the film on frequently used areas such as the area where I tap to go to the next page! And I don't know where they get the "anti-reflection" from. Maybe it reflects so much light you get blinded so you don't see any more reflections.

GoodReader is by far the best of the PDF readers I tried. However, I really don't like not having page animation when tapping to turn the page. The program is highly customizable, but the things that can be customized just aren't useful. But the display quality and speed more than make up for the shortcomings.

As for Stanza, I've been using it for a long time on my iPod touch to read ebooks and I've customized it exactly the way I like it. I would continue to use Stanza to read PDF files that aren't technical books. Unfortunately, since GoodReader can't be customized as much as Stanza, I've had to "un-customize" some of my preferred Stanza settings so the two programs can behave in the same way so I don't keep confusing myself.

iBooks is also recommended if you prefer to use Apple's ebookstore and don't want to customize anything.

Happy reading!

October 21, 2010

Windows Server 911

What could be worse than never performing backups? Server crashes in the middle of the backup process. Which was exactly what happened to me a few days ago, while I was backing up SQL data off our ERP server, and then the work day started and users started calling in the complain.

After the server rebooted, the Intel ICH RAID started rebuilding itself and was stuck at 33% and the ECC errors kept on climbing, which indicated a bad hard drive. The Intel console didn't say which drive was going bad though. Fortunately, the BIOS settings page did say that drive 0 was bad, so I replaced the drive with an identical one.

Unforunately, after the drive was replaced, it restarted the RAID building process, but the Intel Matrix Storage Console also complained that there's a missing drive. I kept wondering if I did something wrong, but luckily, after about 30 hours of RAID rebuilding, the process completed and everything was fine, and the missing drive error disappeared. (I didn't capture an image of the missing drive error, since I thought it would be there even after the rebuild was complete.)

So everything turned out to be fine. But during the 30 hours that the RAID was rebuilding, I took another full backup of the SQL data and restored it into my server's identical twin with the newer OS. So now I have two identical servers with different OS's and different versions of SQL Server.

The older server is Windows Server 2008 with SQL Server 2008, and the new, live, server is Windows Server 2008 R2 and SQL Server 2008 R2. After some testing, I decided to just take out the older server and replace it with the new one, since I've been wanting to upgrade to R2 for a while. So the drive crashing and stressful server rescue (and getting abused by the users) turned out to be a good thing after all.



Oh, and what could be more stressful than bringing a new server with restored databases online? A database went missing. But this was a result of the bad information our ERP consultants gave me (i.e. I should always restore database backups using the ERP client and not using SQL Server), which further proves their uselessness.

October 15, 2010

The accidental DBA

A lot of DBA seem to be accidents. A search for accidental DBA on Google turns out millions of matches, and now I'm one of them.

A few months ago, when my Microsoft Dynamics NAV ERP project was about to go live, one of the last things we got stuck at was a process called adjust cost item entries ("ACIE"), which basically takes all the transactions you've made, and figures out the average or FIFO cost of a particular item in your inventory.

So I was looking at the adjust cost process, and it was taking a long time. A loooong time. A looooooooong time. A looooooooooooooooooong time. After a few hours, I killed the process and decided to ask the consultant about it.

The mor^H^H^Hconsultant said something like... your server is probably way below our recommended specs, adjust cost only takes two hours on her notebook, you need to buy a new server, or install a modern OS like Windows Server 2003 and SQL Server 2005. I told her that our server already runs Windows Server 2008 SP1 and SQL Server 2008. Both are 64-bit. The server has a Core 2 Quad Q6600, 8 GB RAM, and loads of disk space in a RAID5 configuration. She then mumbled something about Windows Server 2008 is too new and probably incompatible with our hardware, but then she suddenly jumped and said that RAID5 is baaaaad for SQL Server.

Hmmf. I do know that RAID5 is not a very good choice to run SQL Server on, and our server really wasn't all that powerful in 2010 (it was bought in late 2007), but then the server was specifically bought to run the ERP software, our database wasn't that big, and we only have 20 users. Even if it's sub-optimal, it shouldn't take forever to do something that needed to be done weekly or even daily.

After trying a whole bunch of settings on both the hardware and on Windows, and being nagged to no end by the consultants that my RAID5 setup is no good for running SQL Server and that I need to buy the Enterprise Edition of SQL Server instead of the Standard Edition, I finally brought my second server with identical specs online, but I installed the database files on separate drives. It's not RAID10 like they asked, but it has separate drives for the OS, for SQL Server itself, for the database files, for the log, and tempdb. I also installed Windows Server 2008 R2 and SQL Server 2008 Enterprise.

So I started the adjust cost batch process on this server, and exactly 24 hours later, it completed! I had never been able to complete the adjust cost process on the live server, since the database server can't accept posting entries while ACIE is running. But running for 24 hours wasn't exactly acceptable. (I could even accept 12 hours (!) since our working hours is 12 hours.)

I couldn't understand why the process only takes two hours on her notebook, so I decided to steal a look at the notebook when she wasn't looking to see how things were configured there. But then I discovered that she was running the native client version of the Dynamics NAV software. GAH!

Dynamics NAV comes in two different versions. The native version uses a file based database, and the SQL Server client version which, of course, uses SQL Server. They're very similar, but code has to be optimized differently depending on which version is used. I realized then that the idi^H^H^Hconsultants had absolutely no clue whatsoever about SQL Server, and decided to take matters into my own hands. (Okay, I had an idea earlier that they were clueless when they installed the entire database into my boot drive when the data drive had 1 TB of empty space, but they argued that I set up the drives wrong.)

Oh, I did get the ACIE issue resolved. While I was trying out different hardware settings, one of their other consultants (PURE GENIUS, by God!) mumbled something about bugs in the ACIE routine, and sent me an object, which immediately resolved the issue, and my ACIE time dropped from 24 hours to minutes. Proving that all the problems had nothing to do with my hardware whatsoever.

Since I was taking matters into my own hands (becoming the accidental DBA), I had to start learning first. I first went to Amazon and bought The NAV/SQL Performance Field Guide, which is targated at Dynamics NAV and Professional SQL Server 2008 Internals and Troubleshooting, which is targated at SQL Server in general. Unfortunately, since I was such a newbie at SQL, and I like Wrox books in general, so I also got Beginning Microsoft SQL Server 2008 Administration. (Since then, I've also bought Manning's SQL Server 2008 Administration in Action, which is by far my favorite right now.)

After burying myself in the books for a few weeks, I started working on the SQL Server. First, I discovered that the consultants had allocated 40 GB to the NAV database's PRIMARY file, and it was only using 60 MB. The data filegroup, however, was set to auto-grow and it was at 12 GB with 99% full. So I resized it into a more logical 128 MB PRIMARY and 16 GB data. They told me that I had allocated too much space when they were the ones that did the idiotic allocation.

Second, I discovered that the NAV log file was 200 GB. We've never done a backup using SQL Server, since the consultant insisted that we should backup only using the Dynamics NAV client and not through SQL Server. I backed up the log which cleared it out, and resized it to a more logical 8 GB. Since we only do daily backups and don't care about data loss during the day, I also decided to change the recovery mode to simple.

After the above, I made maintenance plans to make daily backups using SQL Server's backup function. Backing up using the NAV client by then took nearly an hour, and restoring the database took nearly three hours. Backing up and restoring using SQL Server only took about 5 minutes.

Next, The Dynamics NAV/SQL Performance Field Guide provided an index defragmentation script, which took more than an hour to complete on the first run. I guess it was an indication how fragmented my database was. Nowadays it takes about 2-3 minutes to run.

The consultants also said that my server has way too little RAM (it has 8 GB) since task manager indicates that SQL is using all the memory. 8 GB is not that much for SQL Server, but we have a very small database! Besides, SQL Server is designed to cache data in memory and it's normal for SQL Server to use large chunks of memory. But I still made changes to SQL Server so it doesn't automatically take up all the memory.

I wrote above that the ACIE issue was resolved. However, the ERP software was still suffering performance problems, and the assw^H^H^H^Hconsultants were still insisting that my RAID5 (and lack of RAM) was causing problems. By this time I've given up explaining to them patiently that my RAID5 had nothing to do with the sluggishness, since the ACIE problem was fixed by a simple object. (Anyway, just by pure chance, or maybe it was the Will of the Gods, one of the drives in the RAID5 array died and I ended up in a RAID1 configuration, which I describe in another post.)

After doing all that, the ERP software is still uselessly slow most of the time. What do I do in times like these? Why, throw more hardware at the problem, of course.

(Image source: Imagine-Net Technology)

October 10, 2010

10/10/10 10:10

Happy 10/10/10 10:10!

In other news:

limera1n untethered jailbreak is out for iOS 4.1 for all devices. More coverage on the Dev-Team Blog.

September 30, 2010

Finding the right Linux distribution

(Continued from Part 1)

After picking my distributions using VMware, I installed them on my test laptop, a ThinkPad X61. The X61 is an older Penryn Core 2 Duo machine with 2 GB RAM and 80 GB hard drive. It also has Bluetooth, fingerprint reader, but no WWAN and no webcam.

My goal is to have a Linux distribution that supports all of the X61's hardware properly and is easy to configure and use day to day. i.e. as a machine that I can do work with, and ocassionally watch some movies, and not something that I need to continously update in order to get things to work.

I started with openSUSE, which was actually my favorite of my four final choices while testing out with VMware. openSUSE is also special is that it knows it's running inside VMware and automatically installs VMware Tools. openSUSE is the community supported edition of SUSE Linux Enterprise, which is commercially supported by Novell. This is also one of the reasons I'm interested in openSUSE.

For the ThinkPad X61. Out of the box, openSUSE supports trackpoint scrolling, brightness control (without OSD), volume control, Fn-F5 to toggle wireless, and also hold down Fn-F5 to toggle Bluetooth.

Unfortunately, for some reason Wi-Fi didn't work out of the box, after some trying, I restarted networking by issuing the command /sbin/rcnetwork restart which started thing up, and after that it just worked, even after reboots. I have no idea why it didn't work the first time.

openSUSE doesn't have any non-free software installed by default or even enabled, so I had to first add the contrib repo and restricted formats repo (for playing videos).

Also due to licensing issues, openSUSE doesn't have subpixel smoothing installed by default, so I had to add the subpixel repo and enable it. Strangely enough, I noticed that the Gnome edition of openSUSE does have subpixel smoothing already included and enabled. Unfortunately, with either the KDE or Gnome editions, having subpixel hinting enabled didn't mean that it automatically works with all applications without some hacking.

Aside from subpixel smoothing, openSUSE seems to work perfectly at this point, except the KNetworkManager would randomly segfault. I was about to attempt to get APS to work (see below) when it froze and hung the entire OS (thought this wasn't possible with Linux, but people also say the same thing about OS X and I've had OS X freeze up more times than I could count). When I rebooted, KNetworkManager kept segfaulting non-stop and the network kept going down, so I decided to give up and installed my next favorite: Fedora.

Fedora for some reason can't find my external USB DVD drive when installing from the install DVD. So I had to install using the Live CD.

Out of the box, volume and brightness OSD work, and Fn-F5 toggles Wi-Fi and Bluetooth.

Subpixel hinting is available in Fedora, but disabled by default. Go to System -> Preferences -> Appearance -> Fonts to enable it.

One surprise in Fedora is that iBus is already installed and enabled by default. This is really helpful for non-English users since there's no need to figure out how to install iBus and an input method.

Unfortunately, when I tried to play a movie, Fedora automatically offered to install the appropriate codecs for me, but no matter what I did, the installation always fails and I couldn't get any videos to play, since attempting to play would just bring back the failed to install package error again.

Unlike openSUSE, trackpoint scrolling wasn't available by default. I had to install gpointing (from the repo) to enable it. Trackpoint sensitivity can be configured after installing configure-trackpoint. No problems here.

Active Protection System turned out to be really difficult. APS is what ThinkPad calls their hard drive protection system that automatically parks the drive head when a vibration is detected. Normally Linux needs tp_smapi to read the vibration sensor, and hdapsd to read the output from tp_smapi and do the actual parking.

For Fedora, hdapsd is already included in the standard repo, but tp_smapi was nowhere to be found. I eventually found a site that has tp_smapi pre-compiled but there were four different ones available for download with no documentation whatsoever, and none of them worked. Google turned up nothing helpful.

So at this point, I gave up and installed the next in list, Ubuntu.

(Continued in Part 3)

September 21, 2010

redsn0w for iOS 4.1

This is the just released redsn0w 0.6.9b1 for for jailbreaking iOS 4.1 on iPhone 3G and iPod touch 2G only. This is the OS X version, Windows version coming soon. No warranties, of course.

September 20, 2010

Team issue tracking with Redmine

Two years ago, while struggling with SOX audits, one of the things I was asked to do by the auditors was to deploy an issue tracking / helpdesk program for my IT team. There are a whole bunch of issue tracking programs available, but my entire IT team consists of five people, including me. All of the issue tracking programs I looked at were too complex, too expensive, not internationalized (e.g., doesn't support dd/mm/yy format), or all of the above.

I didn't forget the open source projects such Trac, Mantis, OTRS, or Redmine, but they all seemed to experimental or overly complex due to feature creep, and I really wanted something online that could be accessed from anywhere. I kept stalling this project but I've kept my eye on things for the past two years. Recently though, my projects have gotten complex enough that I actually needed an issue tracking system myself, and not just for satisfying the auditors.

Redmine 1.0.1 ("very stable release") was released not long ago, and when I looked at it, it has just the right features for my team to use. Oh, before I finally decided on Redmine, I was almost going to go with Pivotal Tracker. Pivotal Tracker is free and has just the right features for me as well, but the website and its AJAX interface was somewhat slow, but this maybe due to my Internet connectivity.

I decided to install BitNami's native Redmine stack for Windows since I already have some Windows terminal servers. I could've rolled my own Linux server, but those Windows servers are mostly idle enough to run an additional service. I've already used BitNami many times in the past, and BitNami Redmine installed without a hitch.

Unfortunately, when I tried to set up email notifications according to these instructions, it didn't quite work for the Windows native stack version, probably because some of the expected commands such as ruby or git aren't automatically in the path, but I kept getting "plugin not found error".

My solution was to download the TLS plugins files as a source archive directly from the git repository, and extract it into "C:\Program Files\BitNami Redmine Stack\apps\redmine\vendor\plugins". I also renamed the extracted folder into "action_mailer_optional_tls" like the git installer does, but I don't know if that's necessary.

After that I made the necessary changes to email.yml according to the instructions in the website above, and it all worked, right on the first try.

(NOT! It not just didn't work on the first try, I spent like three hours on this thing with like five different versions of smtp_tls.rb and tls_smtp.rb placed into various folders, I tried different settings in email.yml, I tried editing production.rb and environment.rb to include the plugin. All because I read that the plugin wasn't necessary any more since TLS support is now built-in, etc. etc. Finally I downloaded BitNami's openSUSE Redmine virtual appliance and installed the plugin there using git to see which files get changed, then manually did the installation in Windows. No thanks to outdated and contradictory documentation floating around on the web.)

Ahem, anyway, while writing this I realized Redmine doesn't have an official logo. I really like the one Cyber Sprocket Labs uses, plus the favicon displayed by Redmine is also the same red arch. I also installed the Watersky theme to remind myself of the babes at the beach rather than burying myself in managing projects. (See picture above.)

Finally, Redmine does have an issue accepting date formats in our local preferred dd/mm/yy format in date input fields. But this is a relatively minor issue since all date input fields have a handy pop-up date picker tool.

September 17, 2010

Cancel all technology

In mid-2005, I bought a Nokia 6630. At that time, the Nokia 6680 was just released, so the 6630 had dropped in price, which was why I decided on the 6630 and not the 6680. There's really no difference between the two models aside from the looks and the front-facing camera. The salesperson kept trying to talk me into getting the 6680, the main reason of course being that the 6680 has a front-facing camera.

"You can use the front camera for video chat!"

"But there's no 3G in Thailand."

"It's coming soon!"

"But it was coming soon since last year."

"It's definitely coming this year! Before end of 2005!"

"I'll believe it when I see it."

"You'll regret it, you'll be buying a new phone next month to get video chat!"

Fast forward to 2010. After months of 3G auction schedule confirmations for September 17, CAT wins fight to kill 3G auction. Like I said, I'll believe it when I see it.

Image source: Thailand Business News

September 12, 2010

Linux distributions

What happens when an experiened Windows guy with a bit of OS X experience tries out Linux for the first time? Well, not really the first time, I did use Linux long ago, and I use Linux inside VMware for some cross-compiling, I also have Linux on my netbook for browsing, but what happens if I install it on a regular laptop, and attempt to use it like a regular desktop OS?

Man, installing Linux in 2010 is nothing like it was in 1992. (1992 in computer years is a little bit like 1492 in human years.) The first thing I had to do was determine which distribution to use. My "long ago" Linux was SLS Linux, or Softlandindg Linux System, which was the great-great-great-grand daddy of all distributions. It wasn't really even a distribution, it was more like a set of floppy disks that gets the Linux kernel installed on the hard drive and made bootable, and creates a user then a login prompt, that's it. Everything else had to be downloaded (at 28.8 Kbps!) and manually compiled and installed. I even had to install X (X11R5) and fvwm and create the Xconfig, all by hand.

Oh, it's not like I haven't kept in touch with the Linux world. I know of all the popular distributions and I've tried them out from time to time inside VMware. I just don't see why there are so many distributions, surely there's no need for religion specific distributions?!

Anyway, I don't want to do a lot of things manually now, so I want a modern distribution that's easy to use. Isn't Linux supposed to be taking over the desktop? So things should be easy? Let's find out.

Testing Linux distributions is really simple with Live distributions or installation through VMware.

The images above were captured from Ubuntu, Fedora, Linux Mint, and openSUSE, using their default desktops, in the order they appear on I actually tried a whole bunch of distributions, but these four were my favorites based on ease of use and initial configuration. It's no surprise that they also happen to be the top four on After trying them out in VMware, I then proceeded to install them on my laptop.

(Continued in Part 2)

September 10, 2010

iOS 4.1 pwnage

SHAtter is such a great name for an exploit. Word has it that this exploit can jailbreak all current iOS devices including iPhone 4, iPod touch 4th generation, and iPad. Details still scarce, but I can't wait.

September 9, 2010

Google instantaneous

I've been having trouble with Google searches for the past week or so, where the suggested items wouldn't disappear when a search is finished and just ends up covering the top results; and clicking on the suggested items in the search bar caused unpredictable behavior. All was resolved yesterday when Google officially brought out Google Instant.

Google Instant shows search results while I'm still typing, which is kinda annoying at first but I realized it's much faster than having to wait for search results to appear after pressing enter. The best thing though, is that when going through additional pages of search results, it's almost instantaneous. There's no longer a delay to wait for the additional pages to load. I like it.

Happy 9/9!

September 4, 2010

Internet over VPN

The kind of VPN that I know best is site-to-site VPN, which I've implemented a number of times using low-cost hardware. Recently though, I've became interested in using VPN tunnels to secure and encrypt my Internet connectivity, and also to access sites that I otherwise can't.



Okay, the Wikileaks site I could always access by typing in the URL differently, but the other sites only work with an USA IP address.