Goldfinger: Mayor of Toronto

By , January 11, 2012 10:14 pm

Just before Christmas, I was telling a friend visiting from France about our mayor Rob Ford and his gravy train.

No, not that gravy train. I would totally get on THAT gravy train.

 

 

Anyway, that evening we decided to watch the classic James Bond flick, Goldfinger, since neither of us had seen Bond movies before Pierce Brosnan.

Upon seeing the titular villain, I couldn’t help but notice his resemblance to the mayor.

Goldfinger

Mayor Ford

(I’m not the first to notice… pictures above from “Goldfinger Elected Mayor of Toronto – Blogging Canadians“.)

Also, neither she nor I could see why Sean Connery as Bond is considered so attractive. Particularly in this outfit.

I don't even know. Bathshortsuit?

 

 

30 Rock – Product placement

By , January 11, 2012 9:21 am

30 Rock is set to return to NBC tomorrow evening. (Unfortunately, it’s in Community’s time slot.) I decided to take the occasion to revisit some clever but blatant (to comedic effect) product placement from earlier seasons.

Snapple:

Cisco Telepresence:

Arcade Fire presents Sprawl II (Mountains Beyond Mountains)

By , January 8, 2012 10:37 pm

I was watching the MuchMusic countdown and saw this awesome video. (yes, MuchMusic. They still exist, and still play music. I’m really loving having TV again… more on that later)

Arcade Fire presents Sprawl II (Mountains Beyond Mountains) – YouTube.

I’m not absolutely sure, but it seems the whole video was shot in a suburb of Montréal, Lasalle, which is where my parents lived for a while. Mom, Dad, recognize anything?

The empty photo studio is at 1465, boul Shevchenko.

How Canadian of me to get all excited to see a place in Canada on TV.

Anyway, cool video, great song. Watch it.

Remove the Open File Security Warning in XP | vNate

By , January 6, 2012 3:58 pm

Remove the Open File Security Warning in XP | vNate.

A concise tutorial on how to disable the annoying “Open File – Security Warning” popup and associated time delay/latency in Windows XP SP2 and higher.

How to remove restrictions/password from a PDF

By , December 24, 2011 7:04 pm

Adobe Acrobat PDF documents have a nice feature which allows content authors to restrict certain features or “encrypt” the document using a password. These can all be easily bypassed using the open-source Ghostscript:

gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf

Source : http://www.cyberciti.biz/faq/removing-password-from-pdf-on-linux/

Why I use Debian and Ubuntu (Apt)

By , December 21, 2011 10:35 am

OK, rant time.

Way back in the day (I mean 2001 or so), I used to use rpm-based distros. Red Hat, Mandriva – or rather Mandrake- and they worked fine. As long as you didn’t have to install any packages. To be fair, this was in the early days of package managers and the like, and I was a novice Linux user at the time. Mandrake had put in a good effort with urpmi, but I still had to visit sites like http://rpm.pbone.net/ and http://rpmfind.net/ very often to find this or that package.

Then, in 2004/2005, I discovered Ubuntu. (The OS, not the philosophy. Ha ha.) It was a world of difference. Need a program? apt-get install program would automagically fetch and install it for you. Don’t know the name of the package, or exactly what you’re looking for? apt-cache search can help. If that package you want installed has dependencies, and those have dependencies? No problem, everything gets pulled in and the proposed changes are listed for you. The other advantage was that seemingly any program I could possibly want was available in a Debian/Ubuntu repo.

Fast forward to today. I’ve pretty much been using Debian based distros since then, although I have tried Arch and Slax, and possibly many others that I can’t remember right now. All my servers run either Debian or Ubuntu Server, and my Linux PCs are Ubuntu or Arch. Package management has become so easy that I rarely ever have to worry about it, unless I’m trying to make some major changes outside of repo packages.

Recently, however, I’ve started using some RPM distros again, to see how things have been on that side of the fence. It’s been mostly CentOS and a few CentOS/PBX distros (Elastix, Trixbox, pbxinaflash…). I have to say though, I can’t believe the state of the package management system. CentOS has got yum, which seems to be good in principle, but somehow I’ve seen it massively fail in ways that Apt never has for me. The first issue is not really to do with the package manager, but more the repositories.

For example, we had a service on a server at work that absolutely required “Arial”. In Ubuntu or Debian, all you have to do is enable the non-free repo, or an Arch, use one of the excellent AUR frontends such as yaourt. Then install msttcorefonts (Debian) or ttf-ms-fonts (Arch). The package manager will fetch the MS fonts package and its dependency, cabextract. It then downloads each of the fonts’ self-extracting EXEs from sourceforge, cabextracts them, then installs them to the appropriate fonts directory. Now, on the CentOS 5 server, no such luck.

$ yum install msttcorefonts
Loaded plugins: downloadonly, fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.nexicom.net
 * extras: centos.mirror.nexicom.net
 * updates: centos.mirror.nexicom.net
Excluding Packages from CentOS-5 - Addons
Finished
Excluding Packages from CentOS-5 - Base
Finished
Excluding Packages from CentOS-5 - Extras
Finished
Excluding Packages from CentOS-5 - Updates
Finished
Setting up Install Process
No package msttcorefonts available.
Nothing to do
$

Awesome. Time to break out the manual package manager, AKA Google. Which brings me to the corefonts sourceforge project homepage, fortunately with clear instructions on how to install on an rpm-based system.

  1. Make sure you have the following rpm-packages installed from from your favourite distribution. Any version should do.
    • rpm-build
    • wget
    • A package that provides the ttmkfdir utility. For example
      • For Fedora Core and Red Hat Enterprise Linux 4, ttmkfdir
      • For old redhat releases, XFree86-font-utils
      • For mandrake-8.2, freetype-tools
  2. Install the cabextract utility. For users of Fedora Core it is available from extras. Others may want to compile it themselves from source, or download the source rpm from fedora extras and rebuild.
  3. Download the latest msttcorefonts spec file from here
  4. If you haven’t done so already, set up an rpm build environment in your home directory. You can to this by adding the line %_topdir %(echo $HOME)/rpmbuild to your $HOME/.rpmmacros and create the directories $HOME/rpmbuild/BUILD and $HOME/rpmbuild/RPMS/noarch
  5. Build the binary rpm with this command:
    $ rpmbuild -bb msttcorefonts-2.0-1.spec

    This will download the fonts from a Sourcforge mirror (about 8 megs) and repackage them so that they can be easily installed.

  6. Install the newly built rpm using the following command (you will need to be root):
    # rpm -ivh $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm

Sounds like fun. Let’s try and see if we’re lucky.

yum install wget rpm-build cabextract

Cool! rpm-build was installed! but wait, how about wget and cabextract? It didn’t mention those!

wget is probably installed, but let’s try anyway:

$ wget
wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

OK, how about cabextract?

$ cabextract
sh: cabextract: command not found

Well then, that’s wonderful. Thanks for mentioning that you didn’t install cabextract, yum.

Fortunately the good people at corefonts provided a link to the download for cabextract, and fortunately, my server is i386 (I know it doesn’t seem like it from the screenshot), so I can use the pre-built RPM. (For those who need it, the x86_64 package) Now to the final step.

$ wget -O - http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec | rpm -bb msttcorefonts-2.0-1.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.77304
+ umask 022+ cd /usr/src/redhat/BUILD

[... a hundred or so lines...]

Wrote: /usr/src/redhat/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.22861
+ umask 022
+ cd /usr/src/redhat/BUILD
+ '[' /var/tmp/msttcorefonts-root '!=' / ']'
+ rm -rf /var/tmp/msttcorefonts-root
+ exit 0

Phew, that’s a lot of output. Well exit 0, that’s good. Aaand “Wrote: /usr/src/redhat/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm”. cool!

And finally:

$ rpm -ivh /usr/src/redhat/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm
Preparing...                ########################################### [100%]
   1:msttcorefonts          ########################################### [100%]
$

(Another thing that bugs me – no success message! After all that, not even a Yay! Package installed!? I’m disappointed, rpm.)

For illustrative purposes, Debian:

# apt-get install msttcorefonts
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  cabextract ttf-liberation ttf-mscorefonts-installer
The following NEW packages will be installed:
  cabextract msttcorefonts ttf-liberation ttf-mscorefonts-installer
0 upgraded, 4 newly installed, 0 to remove and 4 not upgraded.
Need to get 1103kB of archives.
After this operation, 2109kB of additional disk space will be used.
Do you want to continue [Y/n]? Y

[...]

All fonts downloaded and installed.
Updating fontconfig cache for /usr/share/fonts/truetype/msttcorefonts
Setting up msttcorefonts (2.7) ...
Setting up ttf-liberation (1.04.93-1) ...
Updating fontconfig cache for /usr/share/fonts/truetype/ttf-liberation

Wasn’t that easier? Also, a nice plain English message saying what was done: “All fonts downloaded and installed.” Take notes, rpm.

For completeness’ sake, Arch:

$ yaourt -S ttf-ms-fonts

==> Downloading ttf-ms-fonts PKGBUILD from AUR...
x PKGBUILD
x ttf-ms-fonts.install
x LICENSE

[...]

==> ttf-ms-fonts dependencies:
 - fontconfig (already installed)
 - xorg-fonts-encodings (already installed)
 - xorg-font-utils (already installed)
 - cabextract (package found)

[...]

Targets (1): ttf-ms-fonts-2.0-8

Total Download Size:    0.00 MB
Total Installed Size:   5.49 MB

Proceed with installation? [Y/n]
(1/1) checking package integrity                                         [########################################] 100%
(1/1) checking for file conflicts                                        [########################################] 100%
(1/1) installing ttf-ms-fonts                                            [########################################] 100%
Updating font cache... done.
$

A bit more user interaction, but that’s the point of Arch.

So, to summarize:

Arch/Debian package management > rpm package management (CentOS).

And that’s the end of my rant for today.

Pokémon “banned” episode GIF

By , December 13, 2011 1:58 am

My first attempt at a video to GIF conversion. Source material is a “banned” episode of Pokémon, S01E18 – “Beauty and the Beach”.

See the awkwardness that was too racy for American audiences. ;) There’s worse later on in the episode, but I’ll leave that to you to find.

 

Text outline : http://www.ehow.com/how_18386_add-outline-text.html
Also, for some reason, Photoshop had to be launched in 32-bit, and the source movie had to be saved in a .mov container.

Quick and dirty bash script to apt-get update all OpenVZ containers

By , November 30, 2011 10:29 pm

It’s a bit of a pain having to run upgrades on all servers. I could of course, set up unattended upgrades, but I always liked initiating the upgrade process myself. So I wrote a little bash script that will initiate apt-get update and apt-get upgrade on all running OpenVZ containers.

Note that this only works for Debian-based distros. So Debian, *buntu, Linux Mint and the like.

It’s very rough, no error-handling or safeguards, so use at your own risk. Works for me, but YMMV.

#!/bin/bash
#Delete temp file
rm /tmp/tmp-script.sh
#Get running VZ
CTIDS=$(vzlist | awk '{print $1}' | sed -e '/CTID/d' -e ':a;N;$!ba;s/\n/ /g' )
# Echo list of running IDs
echo "$CTIDS"
CTIDarray=($CTIDS)
for x in ${CTIDarray[@]}
do
    echo "#/bin/bash" > /tmp/tmp-script.sh
    chmod +x /tmp/tmp-script.sh
    echo vzctl exec $x "apt-get update &&;  apt-get -y upgrade" >> /tmp/tmp-script.sh
    screen -d -m /tmp/tmp-script.sh
done
#Delete temp file
rm /tmp/tmp-script.sh
#Show running screens
screen -x

First, we rm the /tmp/tmp-script.sh. Starting off with very bad form, I know, feeling lazy right now. Then I use awk and sed to get the IDs of running containers from the output of the vzlist command, and place them on a single line, separated by spaces. Those IDs are than put in an array, so that the update command can be called using a for loop.

For some reason, I couldn’t get screen to launch the

vzctl exec $x "apt-get update &&  apt-get -y upgrade"

command directly, hence the hideous use of a temp file. If anyone can fix/improve this, I would be glad to hear from you!

Screengrab for Firefox

By , November 23, 2011 11:04 pm

Update: Here are a few alternatives that use Webkit:

http://derailer.org/paparazzi/

http://cutycapt.sourceforge.net/

Just discovered an old but good add-on for Firefox: Screengrab.

Unfortunately the author has discontinued development, citing that he was unable to keep up with the increased pace of Firefox development.

Fortunately, the extension still works great on Firefox 9.0 beta with the good ol’ install.rdf edit. I’ve attached it below, along with an example screenshot produced by Screengrab.

screengrab-0.96.3-maxVersionmod.xpi

(Right click and download or open image in new window/tab for full view)

Fix scrolling in GTK apps (Pidgin) on Windows

By , November 15, 2011 6:45 pm

Synaptics makes great touch technology. Their performance and drivers have always been, in my experience, much better than their Alps counterparts.

Except in one specific situation: using the trackpad’s edge scrolling feature in Pidgin.

Turns out the problem is because the Synaptics touchpad enhancer app displays a custom cursor while scrolling in such a way that prevents GTK apps from reading the scrolling action. Not sure on what end the bug is, but the good news is there’s a simple registry fix:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Synaptics\SynTPEnh]
"UseScrollCursor"=dword:00000000

Either copy-paste the above into Notepad and save as “DisableSynTPCursor-FixScrollPidgin.reg” or something less complex, and import it into the registry. Or make the change manually.

Fix thanks to mindelirium88. http://developer.pidgin.im/ticket/10768

Custom theme by me. Based on Panorama by Themocracy

You will be the victim of a bizarre joke.