Archive for category Tips & Tweaks

Ubuntu 11.04 fsck/MOTD bug/issue

Recently this message popped up on the MOTD of the Ubuntu servers on EC2:

*** /dev/xvda1 will be checked for errors at next reboot ***

After proceeding to do a fsck and restarting, the message still kept appearing. After some debugging with wk, it apparently was due to a stale fsck-at-reboot file left around causing the message to keep popping up.

Here are the steps I used to make sure they stopped popping up again:

sudo touch /forcefsck
sudo shutdown -r now
sudo rm /var/lib/update-notifier/fsck-at-reboot
cd /usr/lib/update-notifier/
sudo ./update-motd-fsck-at-reboot
sudo rm /forcefsck

Thanks wk!

, , , , , ,

No Comments

Redirect HTTP to HTTPS on IIS behind an AWS ELB

In recent times I’ve had to handle the Microsoft stack (.NET) among other things. One of the things I’ve faced recently was redirecting traffic hitting the application running on IIS behind an AWS Elastic Load Balancer (ELB) from HTTP to HTTPS. Fairly easy on the Linux stacks which had nginx in front as a reverse proxy (just add a rewrite rule on your HTTP host to HTTPS), but after tinkering around a bit, finally got the correct rewrite rule working (with the help of IIS7′s .htaccess conversion utility).

The transform code you would want to stick into your Web.<transform>.config (was for a ASP.NET MVC project):

    <rewrite xdt:Transform="Insert">
      <rules>
        <rule name="HTTPS rewrite behind ELB rule" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <conditions>
            <add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" ignoreCase="false" />
          </conditions>
          <action type="Redirect" redirectType="Found" url="https://{SERVER_NAME}{URL}" />
        </rule>
      </rules>
    </rewrite>

This assumes you have the IIS URL Rewrite module installed on your IIS server.

References:

http://www.iis-aid.com/articles/how_to_guides/redirect_http_to_https_iis_7?page=1
http://serverfault.com/questions/304621/endless-redirect-loop-with-aws-elb-and-wordpress-site-using-wordpress-https-plugi
http://docs.amazonwebservices.com/ElasticLoadBalancing/latest/DeveloperGuide/index.html?SvcIntro.html

, ,

No Comments

SSD tweak utility for Windows

All machines I regularly use are now using SSDs (60GB/120GB OCZ Vertex 2E), and this handy utility has done all the tweaks for me: SSD Tweaker

More info on it here and here.

No Comments

ipfilter (blocklist) update

There has been update to the ipfilter.dat source which I posted up before (have just updated that post). The previous source was from BISS but the people who maintain the blocklists now publish it at this site.

Whether or not the blocklists are of any use is up for debate, and definitely not something I’m going to go into in this post..

via here

, ,

No Comments

Create iPhone ringtones via iTunes

The article title says on Windows, but I think it should work on Mac OS X as well. Link over here.

No Comments

iTunes 100% CPU on closing

After I got my iPhone 3G a couple about 2 months ago, I had no other choice but to use iTunes for all the syncing, backups, music etc as Apple wants total control of what you can or can’t do with its devices (was using YamiPod previously, writeup here). :|

My loathing for it got worse as it didn’t seem to be closing gracefully on quitting besides causing software restores which all ended up with iTunes.exe taking up 100% CPU. I decided to stop swearing at it and search around for the root cause as this behaviour wasn’t replicated on my work machine and on colleague’s variety of machines.

Turns out it wasn’t iTunes, but the antivirus (NOD32 2.7) which wasn’t playing nice. After adding various iTunes paths to AMON/IMON exclusion lists, there has not been crashes or 100% CPU since (instructions on how to do this here). Guess I was cursing the wrong software but anyhow..

Just a note, this is a fairly belated post as I was having this issue with iTunes 7.x and have since upgraded to 8.0.1 which may no longer require this workaround. ;)

, , ,

No Comments

Cross street in Google Maps

I decided to find out if cross streets (intersections) can be easily searched via Google Maps rather than searching for one street and just scrolling around to find the intersection with the other recently, and realised there was a keyword to do that.

For e.g., typing a very frequently used rendezvous point into Google Maps:

Swanston St at Bourke St VIC 3000

Would give you the intersection of Swanston St and Bourke St (ex-Nike Melbourne). Link to the page here.

Pretty nifty since it’s common place for shop lot locations to be listed as ‘corner X road and Y road’.

via MalekTips

No Comments

Gmail 2.0

Gmail logoAn updated version of Gmail was recently rolled out to most users just after IMAP access was released, and I got it pretty early on. However, I somehow got reverted back to the old version a few hours later and never actually figured out why, till now..

Apparently, after I got moved over to the new version, I actually switched my language preference in the settings from English (US) to English (UK). :| I sort of left it as it is since then and finally decided to find out the root cause today (after much cursing at how evil it was for me to be given access to the updated version for just a few hours..).

So if you still seem to be stuck in the old version, try the following (was suggested here):

  1. Click ‘Settings’ in your Gmail window (top right, close to ‘Sign Out’).
  2. In the drop down for ‘Gmail display language’, change it to ‘English (US)’.

Oh well, Gmail is still in beta..

More screenshots of the new version here.

No Comments

More BitTorrent stuff

I think the links are kinda old, but anyway..

Both links from TorrentFreak.

No Comments

Shrinking VMware VMDK files before distribution

Recently been researching and testing with VMware images for the deployment of our application at work which turned out to work pretty well (Ubuntu + Java 6 + MySQL + Glassfish). However, one thing which became bothersome was the overgrowing .vmdk images which didn’t seem to reduce in size even after file deletions were made in the virtual disk itself.

Again, Google came to the rescue for this, linking me to this site which gave a 2 step process for doing the shrinking. Do note that the instructions are for those who are using Windows as their host OS.

,

No Comments