Setting up Unicode support for PuTTY

Submitted by Druss on Tue, 2011-09-27 23:34

I work extensively on a Windows desktop. However, I do SSH into Linux servers often and I do so using PuTTY, a free and open source client. Everything works peachy. However, I recently had occasion to work extensively with some Unicode source data and I found that there were times when I thought that there were encoding issues with the data as they were not being displayed correctly on my screen.

Finding out the character set of a file in Linux

Submitted by Druss on Tue, 2011-09-27 22:21

It is often important, especially when dealing with databases and such, that files are stored in the correct character set. Failure to do so can result in illegible displays or even data corruption. Checking the character set of a file in Linux can be accomplished using the file command:

Jubal@Stranger:$ file migrate1.csv
migrate1.csv: Little-endian UTF-16 Unicode English text, with CRLF, LF line terminators
Jubal@Stranger:$ file migrate2.csv

MySQL charset issues while importing data using LOAD DATA INFILE

Submitted by Druss on Tue, 2011-09-27 20:47

Earlier today, I was banging my head against the wall trying to import some data in a CSV file into MySQL. While my imports have gone well thus far, this time around I was dealing with data involving lots of strange diacritics, runic squiggles and other manners of gibberish that make the world as fun as it can be. In other words, I was dealing with Unicode.

Vim/Gvim and missing line numbers in the interface

Submitted by Druss on Sat, 2011-09-24 00:32

I'm not sure whether it was something I did, something that the Vim developers did, or an anomaly with the Windows 7 binary, but I could no longer see the line number and cursor position tracker in the bottom right of my interface. Looking at the menus, I could find nothing. I could turn on a line number prefix for each bleeding line, but this is not what I was after.

MySQL's LOAD DATA INFILE leads to an ERROR 29 (HY000) File not found / (Errcode: 13)

Submitted by Druss on Fri, 2011-09-23 01:08

While trying to import a CSV file into MySQL today using the LOAD DATA INFILE command, I ran into the following situation:

mysql> LOAD DATA INFILE 'foo.csv' INTO TABLE bar FIELDS TERMINATED BY ',' ENCLOSED BY '#' LINES TERMINATED BY '\r' (a, b);
ERROR 29 (HY000): File 'foo.csv' not found (Errcode: 13)

The file exists fine and the permissions are also kosher. After much gnashing of teeth and perusing of documentation, I found out that local file sources require the LOCAL keyword:

Converting Roman numerals into Decimal/Arabic/Indian equivalents

Submitted by Druss on Sun, 2011-09-18 22:41

While importing some data today, I found myself having to convert the Roman numerals in the source to decimal. While there are scripts and tools available on the Internet to do so, a quicker way exists (or, at least, it did for my case). This solution is to simply import the data into Open Office Calc and use one of its native functions to do the conversion.

SotD: Paul McCartney - Wanderlust

Submitted by Druss on Fri, 2011-09-02 01:32

I've always felt that Paul McCartney in his post-Beatles career, never quite lived up to (my) expectations. He certainly had hordes of fans. But Lennon had more and understandably so, seeing as to how his music was more hit than miss. That said, he certainly had his moments and in the song Wanderlust, the moment is quite mesmerising.

Kubuntu: Moving an installation hard drive from one system to another

Submitted by Druss on Sat, 2011-08-27 02:58

One of my local servers died a quiet death last week. Much as I tried to revive the li'l bitch, she refused to accede to my plaintive entreaties. She is now consigned to a forlorn corner and I am yet to see to her last rites. In the meantime, I have recently introduced a new addition to my family of servers through the cannibalisation of older (and now retired) members of the same. So, I settled on trying to see if I could save the soul of my now recently defunct Kubuntu box by simply transferring its hard drive to this new server. When I tried to do so, this is what transpired:

Implementing a shutdown timer in Linux

Submitted by Druss on Fri, 2011-08-19 02:38

Even when compared to the simplicity of Windows 7's shutdown function, Linux goes a step further in flexibility and ease of use. Shutting down a system at 8 AM in Linux is as easy as saying shutdown 8:00 in a terminal. To explicitly state that the system should power down after shutting down, we would expand it to shutdown -h 8:00. Alternatively, if we want to perform a reboot, the switch would change to shutdown -r 8:00.

Tags:

Implementing a shutdown timer in Windows 7

Submitted by Druss on Wed, 2011-08-17 21:15

Every now and then, I find the need to shutdown my PC automatically at a specified time for some reason or the other. In my most recent case, I needed to shut my Windows 7 PC down at 8am in the morning anticipating a scheduled power shutdown in my block. While there are many GUI-based applications out there that could do this for me, I chanced upon a simpler solution detailed below:

Pages

Subscribe to languor.us RSS