Character encoding

By , 2012-03-29 11:41

ISO-8859-1

UTF-8

I run my site on Linux, using UTF-8 encoding soooo I can do this:

ééééààààççççëëëüôùòîîîïëë

without getting a bunch of this:

��������

Important note that nano on Linux always works in UTF-8 as far as I can tell, so to get a js file or what have you to display proper characters you’ll need to use iconv to convert the final file to ISO-8859-1/Latin-1 or whatever encoding you happen to be using.

iconv -c -f UTF-8 -t ISO-8859-1 someCamelCaseScriptFilename.js  -o someOtherCamelCaseScriptFilename.js

Web server fingerprints

By , 2012-03-23 23:34

Running Apache 2 (Debian) on Windows 2008, and Microsoft IIS on Linux. Like a boss.

via http://uptime.netcraft.com/up/graph?site=www.csdccs.edu.on.ca

Enabling “swap” in an OpenVZ container

By , 2012-03-23 19:28

Oracle client for Linux for some reason requires 1GB of swap space, and will refuse to install, even if you have 9999999999TB of RAM, but 0 swap. Go figure.

Anyway, an OpenVZ container created with Proxmox will by default have 0 swap allocated, despite the Web UI allowing you to specify swap space.

In order to add swap to the container, from a shell prompt, run

On a somewhat related note, here’s how to install oracle client on Debian:

debian + php5 + oracle (oci8)

vzctl set 213 –swappages 262144 –save

 

Where 213 is your CTID, and 262144 is the amount of swappages you want. 1 page=4096 bytes , so 262144 = rougly 1024MB.

Also, Oracle installer detects 262144 swappages as 1023MB and change, so you will have to put something like 262200 instead.

 

Rainy day on the St. Clair Streetcar

By , 2012-03-23 10:18

image

WordPress: How to create a page that displays a specific category archive

By , 2012-03-20 11:01

Quick way to display a “Category archive” as a page in WordPress

  1. In your wp-content/themes folder, copy the “category.php” file to “template-categorypage-categoryname.php”.
  2. Edit the template-categorypage-categoryname.php.
  1. Add
    <?php
    /**
    * Template Name: CategoryName Category page

    to the top of the page.

  2. After the first
    ?>
     tag, add
    <?php query_posts('cat=[categoryid]&posts_per_page='.get_option('posts_per_page')); ?>
    Where [categoryid] is your WordPress numeric category ID.
  3. Create a new page and choose the template “CategoryName Category page” from the page attributes sidebar widget.

Old Bell pay phone

By , 2012-03-17 01:37

image

Windows XP driver to force CF as fixed disk (XPfildrvr1224.zip)

By , 2012-03-16 10:39

Some CF cards identify themselves as removable disks as opposed to fixed disks.

This poses a problem when using a CF card as the primary install drive for Windows, which will not enable DMA or pagefile on “removable” disks.

The solution is to force the driver for a Hitachi MicroDrive on the CF card. (Not the IDE controller)

xpfildrvr1224_320.zip

(File source: http://wayback.archive.org/web/*/http://home.graffiti.net/jaclaz:graffiti.net/Projects/USBXP/xpfildrvr1224_320.zip)
(Ref: http://www.thinkwiki.org/wiki/CompactFlash_boot_drive)

Christie Pits park

By , 2012-03-11 13:46

image

Canada Post

By , 2012-03-07 11:17

image

Anti-Graffiti: Canada Post is doing it right.

Old news, I know. But I just noticed that the “random” postal code distribution in fact favours the jolly old man in red.

Farewell, Desktop Metaphor

By , 2012-03-04 16:20

We’re living the end of an era. I’m sad to say that as tech journalists have been proclaiming for a little while now, it seems “the desktop is dead” or at least on its last legs. (I would have liked to provide some data to support that but unfortunately big G has killed off their search timeline feature as of a few months ago.)

The original Macintosh Desktop

Now, when I say desktop, I don’t mean the desktop PC. I mean the traditional personal computer desktop metaphor introduced on the original Macintosh in 1984 (- yes, I know Xerox was first). Since then, most personal computers have used some variation of a desktop as their primary UI. Windows, icons, folders, documents, trash/recycle bins have become familiar and nearly universal. The desktop metaphor also includes some important elements that were not really part of a traditional physical desktop, such as menu, status and task bars.

Why do I concur that the desktop is dying? Well, there are a few reasons.

Mobile device sales

Smartphones and tablet sales surpassed PC sales this past year. In Q4 of 2011, vendors shipped just over 100 million smartphones, while PC sales were numbered at 92.1 million. It’s not a huge relative difference, but the trend shows no sign of stopping for now since many consumers are still using feature phones but already own a PC. Tablets are also poised to take a bite out of PC sales, especially with ever-faster processors and slimmer packages. New releases of tablet OS in 2011 should also contribute, with Apple iOS 5 no longer requiring activation using iTunes on a traditional PC and Android 4 (“Ice Cream Sandwich”) replacing the rather underwhelming Android 3 “Honeycomb”.

Web apps

Web Apps running in Firefox

There’s no denying that the Web has come a long way from its beginnings on Tim Berners-Lee‘s NeXT cube at CERN. Web sites have evolved from being essentially online news or encyclopedia articles to being hubs for dynamic multimedia content and information sharing. Take a look at your taskbar/dock/other app switcher (if you’re viewing this from a desktop!). There’s a very good chance a Web browser is running. Even if there isn’t one running, chances are you have already used the Web more than once today. More and more of our daily computing activities are performed using a Web-based tool. Sharing. Word processing. Blogging. Watching videos. Listening to music. Instant messaging. Photo editing. E-mail. CLI shell access. Hell, why not any GTK application. True, there are some things that can only be done using a desktop application. Like OS virtualization. Oh, wait – never mind.  There are probably quite a few computer users who never open a desktop app at all. Even as a network admin, most of my work is done using Web-based administration tools.

Single-purpose, full-screen apps

The new Metro UI in Windows 8

With the new breed of smartphones and tablets that started with the iPhone, single-purpose, full-screen apps have become mainstream. Game consoles and PCs had full-screen apps before, but now, more than ever, “there’s an app for that”. With limited screen real estate, these apps are supposed to be fast, intuitive and immersive. Desktop PCs have hopped on the bandwagon too. During the netbook era, “mainstream” Linux distro Ubuntu launchedUbuntu Netbook Remix“, a special version of their OS optimized for small (typically 1024×640) netbook screens featuring large buttons, automatically maximized apps and minimal user distractions. Ubuntu’s new interface, Unity, is based on UNR. Following the immense popularity of their iOS mobile devices, and the successful launch of the iPad, Apple released Mac OS X Lion with support for full-screen apps and many other features and UI elements pulled from iOS. Over in Redmond, Microsoft is bringing their “Metro” interface from Windows Phone 7 and XBOX 360 to the Windows desktop.

The future

It could be argued that some of these new interfaces are an evolution of the desktop metaphor. I would agree, however, the traditional desktop seems to have its days numbered. The future seems to be a future of full-screen apps, custom web/HTML-driven interfaces and maybe widgets. Windows 8 still has what they call a traditional desktop, however the Start button has been unceremoniously killed off. The next version of Apple’s OS is not Mac OS X Mountain Lion, but simply OS X Mountain Lion, a clear sign that the Macintosh and its once-revolutionary desktop is now a part of the past.

For my part, I feel saddened and almost homeless with the prospect that my beloved desktop belongs to the confines of history. True, I could just continue using Gnome 2, or Mac OS X 10.6, or Windows 7, but that means missing out on the latest and greatest. I don’t like where this is going. Change is not always good. I must be getting old.

On a more optimistic note, I know that there are teams of brilliant designers, engineers and programmers also living through this change. And I know I’m not the only person to feel less than satisfied with current desktop environments. Nothing to do but wait to see what the future brings! (Or become a programming pro and write a new Linux DE from scratch/help out with MATE or Cinnamon.)

Custom theme by me. Based on Panorama by Themocracy