ergo

July 2, 2008

The magic of readline

Readline is an unusual suspect. It is at your fingertips, yet invisible; powerful, pervasive, yet not too well known. If you are an avid user of GNU Emacs or the GNU Bash shell, you are no doubt well acquainted with key-bindings such as Ctrl - A for start of line or Ctrl - E for end of line, etc.

You may be aware that these key-bindings appear elsewhere in the Linux environment. In most any setting where a program would have to have an extended interactive editing session with a user e.g. debuggers such gdb or interactive sessions in perl, python, mysql and psql.

(more…)

Filed under: Bash, Cygwin, Emacs, Free Software, Hacks, KDE, Linux — Pandu Rao @ 11:53 am

June 20, 2008

dna - Using shell scripts to check domain name availability

One of the more creative problems you can attempt to solve these days is to think up catchy, new domain names (for your new start-up maybe).

You need a word or a phrase that captures the essence of the company (a challenge in and of itself) and the associated domain must also be available (good luck with that).

There is a certain amount of uninteresting work such as verifying availability of the domain, etc.

(more…)

Filed under: Bash, Cygwin, Hacks, Linux — Pandu Rao @ 4:56 pm

April 11, 2008

Trivial Hack - Disposable email inbox for mobile phones

I am constantly amazed at how easy it is to string together two or three software mechanisms to create a completely new application. Case in point - The Disposable email inbox for mobile phones.

(more…)

Filed under: Hacks, Mobile — Pandu Rao @ 12:55 pm

January 31, 2008

Trivial Hack - KDE Countdown Timer - Updated 1x

While programming I often find myself losing all sense of time and forgetting to do important chores, etc. To overcome this, for the past few years I have used the countdown timer in my Timex Expedition (not unlike a CPU interrupt). I would set the timer to 5 or 10 minutes and when the beep went off I would be reminded of the errand. The downside to this is that I am limited to one audio timer.

After unsuccessful attempts to find a simple countdown timer application, I decided to put one together. It turned out to be surprisingly simple. But the kudos are to be directed to the KDE team. The KDE developers have done a remarkable job in providing components that can be put together so elegantly and with such fine-grained control.

(more…)

Filed under: Bash, Hacks, KDE, Linux — Pandu Rao @ 11:21 am

December 21, 2007

Opinion - Interop is effectively a noop (ODF and OOXML)

There is something Orwellian about the name “MS Interoperability”. A more apt name would have been “MS Intraoperability” or even “MS Inoperability”.

The unstated technical goal of any Microsoft application is to ensure that data can be shared only across Microsoft applications and systems. This ties into their strategic objective which is- Anyone wishing to exist in their ecosystem must pay Microsoft for that privilege. ISVs must pay to play. Binary formats have helped them further this objective.

(more…)

Filed under: Free Software, Linux, Opinion, Windows — Pandu Rao @ 6:06 pm

June 8, 2007

Running shell commands on GNU Emacs buffers

One of the more elegant features in GNU Emacs is the ability to run shell commands on buffers or regions (selections). Here is how it works- You select a region of text and do Alt+|. You then enter the command and the result is displayed in the prompt. Conceptually speaking, Emacs pipes the region through the shell command. How apt a key-binding!

(more…)

Filed under: Bash, Cygwin, Emacs, Free Software, Linux, Windows — Pandu Rao @ 11:45 am

May 19, 2007

Trivial Hack - KDE - Show/Hide Desktop Icons

In KDE, the desktop is a convenient place to put work-in-progress files or frequently used shortcuts. I overdo the convenience bit and end up with a rather cluttered desktop. There are times when I want to temporarily hide the desktop icons. Like when I watch a video or need an unrestricted view of the desktop wallpaper.

On Windows, this feature is available through the desktop context menu but it not so on KDE. The KDE equivalent is neither as direct nor as convenient. But we have DCOP. Here is a trivial hack to show/hide icons using DCOP.

(more…)

Filed under: Hacks, KDE, Linux, Make — Pandu Rao @ 2:28 pm

May 8, 2007

xkeymacs - Emacs keybindings on Windows

Ergonomically speaking, the Emacs (readline) key-binding scheme is, in my opinion, the best one ever devised. Its raison d’être is maximum productivity. If you’re a Bash/Emacs user who can stay in that environment all day, you’re probably already at your productive best. If, however, you are accustomed to these key-bindings, but work on Windows, you might on occasion find yourself doing “ctrl + s” to search, or “ctrl + x, ctrl + s” to save.

The widgets in the Linux Desktop environments maintain some fidelity to the bindings (at least enough to get by). But on Windows, good luck!

(more…)

Filed under: Emacs, Hacks, Windows — Pandu Rao @ 3:51 pm

April 14, 2007

CryptoPP - The cryptographic library for C++

Simply stated, CryptoPP is the best C++ encryption library out there. For one, its very well written, the class hierarchy is a study in elegance. It provides an extensive set of cryptographic routines. It is cross-platform (runs on Linux/Unix/Mac OS X and Windows). The source is available and is in public domain. It is subject to this license. You would be hard-pressed to come up with something better.

(more…)

Filed under: Encryption, Free Software, Linux, Perl, Security, Windows — Pandu Rao @ 1:53 pm

April 5, 2007

bc - The shell maestro’s calculator

If you use a GUI-based calculator such as kcalc, you probably do so because:
a. It is convenient, and
b. It physically resembles the electronic calculators that you have used before.

That is akin to riding a tricycle to work because you work at a toy store.
(more…)

Filed under: Bash, Cygwin, Free Software, Linux, Windows — Pandu Rao @ 8:38 pm

April 1, 2007

Command line P2P with amulecmd

To say that GUI-based P2P clients are popular would be an understatement. If certain unreliable (sic) sources are to be believed, everyone and their grandmother is using one of these to download stuff. The RIAA is currently suing the grandmother (albeit on flimsy evidence). In short order, they will be taking everyone to court. Witness the settlement letters to university students as proof of this avaricious, flawed and futile undertaking.

But that’s beside the point. While the GUI-based P2P clients may be ubiquitous, they are but sub-optimal substitutes. The truly powerful P2P clients are of the command-line variety. Take btdownloadheadless for instance. A killer-app, if there ever was one. Combine it GNU screen and you have an overkiller-app (if there ever was such a concept).

(more…)

Filed under: Bash, Cygwin, Linux, Windows — Pandu Rao @ 9:53 pm

March 15, 2007

Steal my laptop (I don’t care) - Securing laptop-data - Updated 1x

Update 1x:

It turns out, not surprisingly, that this is susceptible to the coldboot attack. Securing hardware that is under physical control of the attacker is a hard problem.

Notes to self:

Security is a process, not a product.

Security is a process, not a product.

Security is a process, not a product.

If your laptop is stolen, you have a big problem on your hands. As expensive as laptops are, the problem of replacing the hardware is trivial compared to the security, privacy and identity problems of having your data stolen.

The solution to laptop-and-data theft, as it turns out, is relatively simple.

(more…)

Filed under: Encryption, Linux, Security, Windows — Pandu Rao @ 6:12 pm

March 14, 2007

Make - An afterburner for your command-line

One of my co-workers would jokingly tell me that my age was less half his experience. He was, by the way, an excellent programmer. As we worked, we would exchange hacks, one-liners, dot-files and Unix arcana. I observed that he kept meticulous notes of these learnings. Some entries were decades old. When he needed to reuse a hack, he’d open his notes in his text editor, copy an entry to the command line, edit it and run it. Its was simple system and it worked for him.

My approach is different. It takes a little learning but the effort is well worth it. Done right, it can provide a significant boost to your productivity. Call it an afterburner for your command-line.

(more…)

Filed under: Cygwin, Free Software, Hacks, Linux, Make — Pandu Rao @ 9:53 pm

March 11, 2007

Simple geo-location with Python and CC-licensed data

Geo-location is one of the more common features that a developer these days might be expected to implement. This could be spec’d as “determine the distance between two zip codes”, “determine zip codes within a given radius” or “get merchant locations around a given zip code”.

The solution is relatively straightforward.

(more…)

Filed under: Python — Pandu Rao @ 12:03 am

March 9, 2007

RemCom - Free Software psexec for Win32

psexec from SysInternals is a popular utility. It allows Windows users to do what Linux users do with rsh (rxec) or ssh and remote commands. Very handy. Too bad it is not Free Software.

RemCom satisfies both criteria, i.e it runs on Windows (connects to remote Windows hosts) and it is Free Software.

(more…)

Filed under: Cygwin, Windows — Pandu Rao @ 12:02 am

March 8, 2007

Building in Cygwin using Visual Studio command line tools

Are you a Cygwin aficionado biding time with Visual Studio tools?

Would you use the Visual Studio command prompt if it weren’t for the Windows console?

Well, its possible to have the best of both worlds i.e build Visual Studio projects from within the Cygwin environment.
(more…)

Filed under: Bash, Cygwin, Windows — Pandu Rao @ 10:31 pm

Cygwin - Elite survival skills for the harsh and primitive Windows-land

To borrow Lee Falk’s opening lines from some of my favorite Phantom stories - it is said that there are times when a power user leaves the comfort of his Linux home to enter the harsh landscape of Windows-land. On such occasions, he takes along his trusty toolkit - Cygwin.

As you’re probably aware, Cygwin transforms the primitive (yes, primitive) Windows environment into a usable substitute for a Linux environment. [I will reserve my critique of the Windows User Interface for another time]. Cygwin provides most of the GNU utilities that you’d find in Linux distributions.
(more…)

Filed under: Bash, Cygwin, Emacs, Free Software, Linux, Windows — Pandu Rao @ 12:27 pm

Tracking time using shell scripts

If you are a consulting programmer, you might, on occasion, find yourself working on two or more projects on the same day. In the interest of fair invoicing, you will want to keep an accurate account of the time spent on each project.

I found myself in such a situation once. I could have developed a small GUI application that does this. Or I could have created one text file per project and create notes (with timestamps) in the project-specific text file. In the interest of efficiency, I picked a variant of the latter approach.
(more…)

Filed under: Bash, Cygwin, Hacks, Linux, Windows — Pandu Rao @ 12:26 pm

March 6, 2007

PuttyCyg - The authentic console for CygWin

If you are a regular user of Cygwin, you probably view the standard Windows console as a hindrance. Its terminal and IO redirection capabilities in the Cygwin environment are at best inadequate, at worst unreliable.

The default installation of Cygwin is launched through a Windows batch file which in turn causes it to inherit that dreadful Windows console. What you really need is a POSIX pty; what you get instead, is a Windows console device.
(more…)

Filed under: Cygwin, Linux, Windows — Pandu Rao @ 7:55 pm

GNU Emacs on Windows

The GNU Emacs key-binding scheme has a certain addictive quality to it. A violinist would say that it “just lays under the fingers”.

If you have used GNU Emacs on Linux and would like to use it on Windows as well, here’s how you go about it:

[As an aside, if you work on Windows but are addicted to readline bindings (as I am) there's a fix for it. But that's for another article. For now we'll download, install and configure GNU Emacs for Win32].
(more…)

Filed under: Emacs, Free Software, Linux, Windows — Pandu Rao @ 7:38 pm

Powered by WordPress