“Winter” in Toronto
Some photos taken on a walk 3 weeks ago (March 11, 2012). We hit 15 C that day, and thought it was warm. Little did we know temperatures would reach the upper 20s soon afterwards, then drop back to the “normal” seasonal range.
Character encoding
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
Enabling “swap” in an OpenVZ container
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:
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.
WordPress: How to create a page that displays a specific category archive
Quick way to display a “Category archive” as a page in WordPress
- In your wp-content/themes folder, copy the “category.php” file to “template-categorypage-categoryname.php”.
- Edit the template-categorypage-categoryname.php.
- Add
<?php /** * Template Name: CategoryName Category page
to the top of the page.
- 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.
- Create a new page and choose the template “CategoryName Category page” from the page attributes sidebar widget.
Windows XP driver to force CF as fixed disk (XPfildrvr1224.zip)
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)
(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)