Embedding IFrames in Wordpress.com

I recently came across a workaround for embedding iframes in Wordpress.com blogs:

Flash and all other embeds are not allowed in WordPress.com posts, pages, or text widgets. For security reasons, we remove the tags needed for these to work. Your intentions may be innocent, but someone somewhere might try to use such embeds to damage the site, affecting all of our users.

As this guide suggests, the workaround made use of a perfectly legitimate and supported shortcode API. In essence, the workaround involved converting an iframe to Flash, which in turn was sourced by [gigya].

I was able to illustrate the concept below:

For my dearest nephew, and any other chess enthusiasts that are perusing this blog, I have embedded a chess game that I recently played. Click the link below, and try to figure out the positional/tactical errors that my opponent (and close friend) committed, and any variations that may have redeemed his play.

1
2
3
<table style="border:none;height:32px;width:32px;">
[gigya src="http://cdn.tagul.com/cloud.swf" flashvars="autoplay=1" allowfullscreen="true" type="application/x-shockwave-flash" allowscriptaccess="always" width="542" height="300" flashvars="id=180853@2"]
</table>

If, for some reason, the embed doesn’t show, here’s a link to how it should look.

Partition OSX Mounted User Directory As Root Using iPartition

Following an Apple support article entitled: Enabling and using the “root” user in Mac OS X, and with the aid of iPartition, I was able to re-partition my User partition (located on x220’s internal 300GB drive). The use of diskutil was out of the question as I had chosen an MBR scheme during Lion’s installation.

My original partition layout (MBR) was as follows:

root# diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *30.0 GB    disk0
   1:                  Apple_HFS Mac OSX Lion            30.0 GB    disk0s1
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *320.1 GB   disk1
   1:                  Apple_HFS User                    260.0 GB   disk1s1
   2:                  Apple_HFS Backup                   30.0 GB   disk1s2

As you can see, disk1 has available unused space amounting to 30GB. I had planned to expand my User partition (/User is a symlink to /Volumes/User) to 290GB using iPartition as an administrative user, but was unable to do so as disk1 was still in use and couldn’t be mounted. Booting the system in single-user mode was not an option for me as I wanted to use iPartition’s support of non-destructive resize of HFS+.

Fortunately, I was able to enable the root account, whereby I would then kill all processes owned by my user or that had open files on disk1 - using # lsof +D /Volumes/User for the latter. iPartition would then be able to operate unimpeded.

Moving data (upon resizing) takes a while - particularly on a 300GB drive, so it is imperative to use an external power source and to disable any power saving features such as suspend.

OSX Lion on Thinkpad X220

In all my years of computing, I’d never imagined the day where I would find myself working with an Apple OS. I’d always assumed - wrongly - that Mac systems were specifically targeted to cashed-up yuppies who didn’t know any better. I assumed that Windows was the only platform of choice to get things done, and that accumulating quality software designed for Windows was the primary goal of my technosexual existence. Of course, back then, in the days of raging hormones and teenage angst, I had made many incorrect assumptions.

As I eventually found out, both Linux and BSD proved to be rock solid workhorses and viable alternatives to the Windows that I had so admired - and now, it seems I have also taken a strong liking to Apple’s OSX. Of course, any Apple evangelism on my part will be premature, as I have yet to grasp the inner workings of OSX. For now, let’s just say that I have OSX Lion successfully running on my Lenovo X220 (alongside CrunchBang Linux) courtesy of my wife’s Snow Leopard Disk, and this guide, and that I enjoy every minute of using it. It is a very capable system, and a most welcome addition to my heterogeneous network. There were a few hiccups along the way (to be discussed later), but for the most part, the installation ran smoothly.

Thus far, I’ve made many changes to the system to arrive at a more familiar desktop (again, to be discussed later). This is not to say that I have been spending most of my time tinkering with the defaults - in fact, like Crunchbang, OSX proves to be quite operational OOTB. I suppose that I have been spoiled somewhat with Crunchbang’s easy maintenance, that proceeding to use an even simpler system seemed to be a most natural step.

My workflow has not been altered considerably, owing to the many ported software from Unix systems, and for this I am thankful. Running OSX - as opposed to any Linux distribution - does also have its perks: I am able to access a wider pool of quality commercial software for my media creation/management. As much as I admire the tenets of the Free Software movement, I’m not bound to it - nor am I vehemently opposed to commercial offerings. I have not compromised my integrity, and I like to think that I choose software on the basis of what’s right for the proverbial job.

I will try to make as many posts regarding the transition as I can - both for X220 owners considering running a Hackintosh, or for other geeks who have risen above the stigma of Macintosh use and are willing to try.

CrunchBang on Thinkpad X220

Desktop Replacement
Hardware Modifications
Upgrade BIOS From USB
About CrunchBang
System Modifications

Desktop Replacement:

It has been over two and a half years since my last Debian-related post so I thought it necessary to provide an update. I have since donated my desktop machine to a worthy cause in favour of the more-mobile Thinkpad platform. My semi-retired Debian desktop is now providing headache-free internet access at the local library, where one of the librarians had long been toying with the idea of using open source. The successful implementation of my machine prompted their acquisition of a further two Ubuntu machines.

My new Thinkpad, on the other hand, has been running CrunchBang Linux (#!) for over a year and a half, and I could not be happier. Although not a pure Debian system, #! is still a lean derivative.

Hardware Modifications:

Hardware changes I’ve made so far include: installing an Intel 30GB 525s MLC mSATA SSD drive to act as my system drive; and running 2 x 4 GB Corsair PC3-10600 DDR3-1333 RAM in dual channel mode.

Upgrade BIOS From USB:

After grabbing the latest BIOS-update bootable iso from the Lenovo support site, it is necessary to extract its [otherwise hidden] contents via a perl script called geteltorito.pl.

To fetch the script:
$ wget 'http://userpages.uni-koblenz.de/~krienke/ftp/noarch/geteltorito/geteltorito.pl'

Then, extract the contents of the downloaded *.iso file to any new target file:
$ perl ./geteltorito.pl /path/to/_bios_update_cd.iso > /path/to/_target_image_.img

To write the image to your USB (located at /dev/sdX):
$ sudo dd if=/path/to/_target_image_.img of=/dev/sdX bs=512K

Then hit F12 at bootup to choose the bootable medium.

About CrunchBang:

Out-of-the-box, #! does everything I need it to do on a laptop (wifi management; power-saving; keyboard accessibility-support,) at a fraction of the resources required were I to customize a larger/slimmer distribution to suit my needs. Were I to install Debian, I would have arrived at my ideal setup at a much later date.

Crunchbang provides a superb arsenal of open-source productivity applications, and I found myself bored witless during post-install. It defaults to using Openbox - which is not exactly a tiling WM that I’m accustomed to using - but I have made peace with that by implementing split-panes in tmux which, considering the smaller LCD screen real-estate, works reasonably well.

For work-purposes, I have implemented KVM + Qemu to manage a guest Windows XP OS - the guide I used can be found here - and I have been able to leverage the power of this fantastic little unit to conduct business.

System Modifications:

System changes I’ve made so far include: switching from grub2 to syslinux (see here); colourizing init feedback (see here); mounting system paths on the SSD drive with TRIM support (with fstab: -o discard); enabling Thinkpad-specific battery savings (with tlp and thinkpad-smapi); relocating /var paths and browser profiles to tmpfs (with profile-sync-daemon).

To get wifi working again after a system suspend-resume event, my executable /etc/pm/sleep.d/20_fix_wifi contains:
case "${1}" in resume|thaw) rmmod iwlwifi && modprobe iwlwifi ;; esac

Additionally, I had CrunchBang show verbose shutdown messages by modifying /etc/slim.conf to show:

xserver_arguments -nolisten tcp -novtswitch

As my Crunchbang box is essentially a Debian Wheezy machine, I will henceforth address it as my debian box in all future blog entries.

Address Merged Ports

My most recent # portmaster -Da revealed a package conflict: py-setuptools was merged with py-distribute.

From FreshPorts:

2013-03-05
Affects: users of devel/py-setuptools (i.e you)
Author: rm@FreeBSD.org
Reason: devel/py-setuptools was replaced with devel/py-distribute. py-setuptools port will be removed shortly.

To fix this:
# portmaster -o devel/py-distribute devel/py-setuptools

From man 8 portmaster:

-o new port dir in /usr/ports installed port:replace the installed port with a port from a different origin

Relocate iOS Backups

There are currently 3 different iPhones and 2 different iPads in my household that need updating - from iOS versions 3.x, 4.x, and 5.x. In order to make the transition to iOS version 6.0.1 (current), I first have to back up each device via iTunes. Unfortunately, my meagre 60GB SSD system drive will not suffice. I have decided to use NTFS’ junction function to link directories on separate hard drives. I had to move %APPDATA%\Apple Computer from my system drive to a separate D:\, using cmd.exe:

move "%APPDATA%\Apple Computer" D:\

then issue the following command in cmd.exe (as admin):

mklink /J "%APPDATA%\Apple Computer" "D:\Apple Computer"

For the curious, %APPDATA% contains the full path to the Application Data folder of the logged-in user, e.g., C:\Users\ootput\AppData\Roaming

NES Nostalgia

A throwback to the NES days of old, this video has recently become a favourite of mine. It features Anamanaguchi - Jetpack Blues, Sunset Hues,

Anamanaguchi is a chiptune indie rock band from New York City that “makes loud, fast music with a hacked NES from 1985.” Akin to other chiptune artists, Anamanaguchi creates music using synthesizers, albeit unconventional ones: namely a hacked NES and Game Boy.