You are here

Tip

SVN: Deleting removed/missing files

Submitted by Druss on Mon, 2011-11-07 22:56

I currently work with an SVN checkout which tracks a separate GIT checkout (for reasons of managerial short-sightedness). When I update my git checkout, I find that the SVN checkout does not like the fact that files deleted by the git update have effectively been removed from the SVN checkout without the use of svn rm. Consequently, it is impossible to commit the updated checkout into the SVN repository.

SVN: changing the URL of the repository in a checkout

Submitted by Druss on Mon, 2011-11-07 22:13

Earlier today, I found myself working with an SVN checkout. As it happened, the repository that the files had been checked out from was no longer responding and upon enquiry, I found out that it had been moved to a different URL. Now, while I could have just as easily created an entirely different checkout of the files using the new URL, considering the local customisations, I looked to see if I could just do something like a live switch. As I found out after some mucking about, switch is certainly the operative word.

Vim E303: Unable to open swap file for "[No Name]", recovery impossible

Submitted by Druss on Fri, 2011-09-30 14:04

On a new installation of GVim (in Windows 7), I ran into the following curious error whenever I tried to open a new document for editing:
Vim E303: Unable to open swap file for "[No Name]", recovery impossible

According to friendly chap on IRC, this is caused by a temporary directory bug and that it can be fixed by adding the following directive to the _vimrc file:
set directory=.,$TEMP

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

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.

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:

Pages

Subscribe to RSS - Tip