Filtered by Linux

Page 11

Reset

Mvbackupfiles - a script to "delete" back autosaved backup files

November 24, 2005
1 comment Linux

Last month I complained about how brutal the rm program in Linux was and how I cocked things up when I wanted to remove the autosaved backup files that jed creates. Here's the solution...

I created a script in ~/bin/Mvbackupfiles that looks like this:


#!/bin/sh
mv -v *~ /tmp

Now, whenever I want to clear a directory of all files like dummy.py~ or README.txt~, I just run Mvbackupfiles and I become a much happier and tidier person.

Truncated! Read the rest by clicking the link below.

Screencasting the unix way with Python

November 5, 2005
0 comments Linux

Yesterday I wrote about my first screencasting test but I've now found something even cooler. It's called pyvnc2swf. It's a Python script that intercepts a VNC connection to record the screen. I haven't tried it yet but I will soon because as I mentioned in my previous post Camtasia Studio only works on Windows and I only use Linux.

If you want to see it used in action, check out Ian Bicking's screencast about ajaxy exception catching

Shane's Bit Mountain

October 25, 2005
0 comments Linux

Ever worried about how to handle a 20 Petabyte (that's roughly 21 million Gigabytes) digital archives? Shane Hathaway has. As far as I can see it's only a research project without any beta code so far but it sure is geekily exciting in a way.

He mentions one of problems with this and for that you don't need a double PhD to understand:

"Power is a large concern. 20 PB worth of spinning hard drives would incur a power bill in the neighborhood of $100,000 per month. Over time, that power bill could even exceed the hardware acquisition cost."

Even though it's just a rough estimate it's still quite fascinating.

Furious and deprived by 'rm *'

October 15, 2005
2 comments Linux

In years I haven't accidentally deleted important stuff with rm * when what I mean is rm *~ to delete backup files, until...

Yesterday I accidentally deleted all templates for a work project when I wanted to delete the backup files which look like this foo.zpt~. In the haste I did:


$ rm *

When I meant:


$ rm *~

Today I did it again. I didn't want any backup files in my ~/bin directory which just screws up tab completion. Again, in the haste I accidentally deleted all my bin scripts :( Most of it recoverable or easily rewritable but still a f**ing nuisance. What to do? Do people have any good suggestions to make the rm work more like the Trash can does on the desktop?

Jed looking like Emacs

September 28, 2005
0 comments Linux

Thanks to the author himself of Jed (my favourite programming editor) I can now make my Jed look like a colour theme very common on Emacs

The end result, so far, looks like the thumbnail right here. I've taken John's good start and fine-tuned it a bit myself to make it suit me even more. Unfortunately I don't yet know how to get my console to take up these colours so I've had to add the following hack to my .jedrc because colours are defined differently in X as they are in xterm/konsole/Eterm:


#ifdef XWINDOWS
set_color_scheme ("peter-emacs");
#else
set_color_scheme ("black3");
#endif

(if you're a Windows user, replace #ifdef XWINDOWS with #ifdef XWINDOWS MSWINDOWS) The console I use is Eterm and I'm sure it's going to be possible to set it up to use these colours even over SSH.

Truncated! Read the rest by clicking the link below.

Just Oracle and IBM?

July 31, 2005
0 comments Linux

Something seems wrong with this journalism:

"A report by Gartner Group showed that Oracle has 81 percent market share of Linux relational database software in 2004 compared to IBM’s 17 percent."

What? Is only 2% of all Linux users using MySQL, PostgreSQL, Firebird, Ingres, Interbase or MaxDB? (see: a longer list of more obscure linux relational databases)

Ok, let's turn it around. Perhaps they only mean paid-for relational databases. Can it still mean that only 2% of all relational databases on Linux are completely free??

ztar - my wrapper on tar -z

June 29, 2005
8 comments Python, Linux

Something I find myself doing very often is to download a .tar.gz or .tgz file that I want to unpack, but only in a subfolder. Some rather annoying gzips aren't collected in one folder so that when you unpack it lots of files are created in the current directory. Do you find yourself often doing this:


$ tar -ztvf Some-0.x.tar.gz
Some/file1.txt
Some/file2.txt
...
Some/file100.txt
$ tar -zxvf Some-0.x.tar.gz
Some/file1.txt
Some/file2.txt
...
Some/file100.txt

Or, in case they the gzip is badly organised:


$ tar -ztvf Foo-0.y.tar.gz
file1.txt
file2.txt
...
file100.txt
$ mkdir Foo; mv Foo-0.y.tar.gz Foo/; cd Foo/
$ tar -zxvf Foo-0.y.tar.gz
file1.txt
file2.txt
...
file100.txt
$ cd ..

Truncated! Read the rest by clicking the link below.

chmod files differently to directories

June 10, 2005
10 comments Linux

Jan gave me the following piece of advice that I feel I have to write about to help me understand it. What I wanted to do was to set all file to 644 which basically means that the owner can write to it unlike any other losers and it can't be executed. The problem with doing a recursive chmod like this on all files is that you don't want to remove the executability of directories otherwise you won't be able to do useful stuff like ls inside the directory. The trick is to use the +X option. This is what I did:


$ sudo chmod -R 644 IssueTrackerProduct
$ sudo chmod -R +X IssueTrackerProduct

Truncated! Read the rest by clicking the link below.

List of casts in PostgreSQL

May 9, 2005
0 comments Linux

Learned something new today that will come in very handy next time I'm about to pick up a manual or search the PostgreSQL documentation with Google.

In psql if you run \dC you get a list of casts. Here's the header:


                           List of casts
   Source type    |    Target type    |   Function    | Implicit? 
------------------+-------------------+---------------+-------------

This is very handy when you need to know, for example, which cast to use when to cast a value of type date to timestamp without time zone you use timestamp. Most of these are pretty obvious and the PostgreSQL book is never far away on my desk, but the interesting thing is that I came across this function by accident when running psql.

(was this the most boring thing I've written here in a long time?)

Gmail shortcuts

April 26, 2005
4 comments Linux

If you use Gmail but haven't started to use the keyboard shortcuts, then you're really missing out on something.

A peculiar thing is that when you enable it you get the extra > pointer along the side which makes it possible to navigate up and down. Anyway, when you're in the inbox you us k for going up (new emails) and j for going down (older emails). BUT when you click on a conversation (several emails all with the same subject line for people who aren't familiar with Gmail yet) there are other keys for going up and down. This time it's p for going up and n for going down. Why can't it be the same which would make it two keyboard commands less to remember?

Truncated! Read the rest by clicking the link below.