web analytics

Backup files before editing

It’s a fact that many text editors (or word processors) have the ability to keep a backup copy of every file you edit, just to assure you that you can always restore the previous version of the file. This is

Can’t eject cdrom? Try fuser

Just a quick note to myself (and anyone else who might be in a similar situation)… Sometimes, after I’ve played some video file written on a cd-rom, I can’t eject it because the file is locked/used by another application/daemon (like

No more ~/.bashrc running?

After upgrading KUbuntu 7.04 to 7.10 some days ago, I noticed that my ~/.bashrc startup file stopped running when I opened a new terminal, be it konsole, xterm or (my favorite) gnome-terminal! Today I decided to debug this strange behavior

Refresh the memory of bash

Suppose you have the same utility in two different places in your filesystem, one installed by a package you don’t really need since you have just installed the same files from source (but in a different directory). You promptly uninstall

RSS feeds to my mailbox

RSS feeds to my mailbox

I wrote before about how I prefer to read, organize and archive (almost) everything with my mail reader (hey, I just love my Mutt ), and that is also true for RSS feeds (from the blogs I read frequently and

Replace in place

What can you do when you want to replace certain text strings with their “equivalents” or “substitutes” very fast? Of course you can fire up your favorite text editor and start the well-known and frequently used ‘search-and-replace’ procedure. Or you

Environmental issues (part 2)

When working a lot with command line utilities, I usually find myself retyping certain commands. This fact is a good reason for someone to use aliases to save typing time and errors. At first we have to check our most

Environmental issues (part 1)

As a developer, I prefer working with command line utilities. That’s why I have devoted my first workspace area to an almost full-screen sized terminal window (I prefer gnome-terminal, although I’m working with KDE and konsole is just as good

bash: quickly rename files

Since one cannot always have the tools she likes, here are some one-liners to rename certain files using only bash.Rename all ‘jpeg’ files to ‘jpg’: for a in *.jpeg; do mv $a ${a%jpeg}jpg; done Remove the ‘photo-‘ prefix: for a

BMC logoBuy me a coffee