Tales from the Gryphon/ archives/

Tales from the Gryphon

Archives for 2008

Manoj's hackergotchi
Add a new post titled:
Saturday 21 June
2008
Link: The Command Prompt

Posted terribly early Saturday morning, June 21st, 2008

The Command Prompt

#+STARTUP: hidestars #+TITLE: The Command Prompt #+AUTHOR: Manoj Srivastava #+EMAIL: srivasta@debian.org #+DATE: #+LANGUAGE: en #+TEXT: Or theming PS1 #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t TeX:t LaTeX:t skip:nil d:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+LINK_UP: http://www.golden-gryphon.com/blog/manoj/ #+LINK_HOME: http://www.golden-gryphon.com/ I am not fanatical about my command prompt. No sirree, not me. It is just that I spend half my life either staring at an Emacs window, or at an xterm command prompt; so even a marginal boost in productivity goes a long way. And I am often logged in over ssh to machines half a continent away, and am still comfortable enough on the Linux VT to spend time there, and I often do not have the GUI gew-gaws feeding me data. Hmm. Data. inpuuut. No. *Must focus*. With all these open xterms and Emacs terminal mode frames floating around, it is easy to lose track of where I am on each terminal, and what the working directory is. So I want my command prompt to help me keep track of where I am. If the terminal is an xterm, the title can be setup like : "user@host:../shotened/path/to/current/working/dir" I want to know what machine, id (am I root?), and directory I am in. If I am deep down in the labyrinths of some work related directory tree, I want the path to be pruned, from the left, one component at a time. However, this does not help me on the console; so I also want the path to be in the command prompt; but it should not take up too much of the command line; and ideally, should just go away as I type a longish command. Gawd, I love zsh. I once did a analysis of the command history. The most often used command sequences were : cd some-place, ls So. /pwd/ and /ls/. I really really want to see the directory listing when I change directory to a new one. As one grows old, memorizing the directory contents for dozens of machines all the time taxes the gray cells a bit. So, I figure, why _not_ let the command prompt handle all that? Having the current working dir always visible cuts down a heck of a lot on the /pwd/ commands, and so all that's left is to insist that the command prompt thingy _always_ run /ls/ after a change directory. Simple enough. Saves on typing. And time. And this is _not_ just some crazy talk. I want help with noticing whether the previous command exited with an error status (useful for commands that normally do not create an output). If I am logged in to a machine on battery power, I want to know that. I also like visual cues to the amount of power remaining (good for my laptop on the long flights). I don't want to have to know f the machine uses APM or ACPI, I just want my prompt color to change as the power fades. I want my command prompt to let me know if I am in a directory which is under version control, and if so, what branch I am on. (I occasionally have to come in contact with arch, bzr, git, subversion, svk, and mercurial). If I am in a version controlled project, where I am relative to the root of the checked out tree is often more important than the absolute path, so I want to see relative paths, not absolute paths. I want to know if there are uncommitted files in the working directory. Visually. I want to be reminded if I am in the middle of an ongoing : rebase -i . This is not asking for too much, is it? #+BEGIN_HTML Command Prompt #+END_HTML So, here is a screen-shot of this in action: I start from my home directory, go to a directory not under version control, go to a project under git, then a different project with uncommitted files, and then finally to a subversion checkout. All with an angry fruit salad of colors warrantied to make Martin Krafft want to claw his eyes #+BEGIN_HTML out biggrin.png . #+END_HTML If you use zsh, then just grab hold of #+BEGIN_HTML this, #+END_HTML and then do: : autoload -U promptinit : promptinit : prompt manoj This might be a bit of a hit on slow machines, but even my laptop is a core 2 duo, so I do not find it noticeable. Oh, and if you liked this article, you might also like #+BEGIN_HTML Theming Emacs, #+END_HTML and #+BEGIN_HTML Theming XTerms. #+END_HTML

Manoj

Thursday 19 June
2008
Link: Theming XTerms

Posted early Thursday morning, June 19th, 2008

Theming XTerms

#+STARTUP: hidestars #+TITLE: Theming XTerms #+AUTHOR: Manoj Srivastava #+EMAIL: srivasta\@debian.org #+DATE: <2008-06-19 Thu> #+LANGUAGE: en #+TEXT: Or configuring LS COLORS #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t TeX:t LaTeX:t skip:nil d:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+LINK_UP: http://www.golden-gryphon.com/blog/manoj/ #+LINK_HOME: http://www.golden-gryphon.com/ After successfully #+BEGIN_HTML Theming Emacs, #+END_HTML I decoded to turn my efforts to providing more copacetic colors in other aspects of my working environment. I'll write more about my effort to write my own color theme for #+BEGIN_HTML fvwm #+END_HTML when it is closer to being done. For now, I'll concentrate on "ANSI Colors" in XTerms, and how one may theme those. The old Tektronics (or ANSI) terminals had 8 colors, namely, /black, red, green, yellow, blue, magenta, cyan/, and /white/. These colors had a normal, and a *bright* mode. The default set of colors is OK, but is not optimal, since they have to work on both dark and light backgrounds; however, I use mostly dark background colors. #+BEGIN_HTML ls colors #+END_HTML Given that, I set to design my own colors, using fully laturated colors, with a base luminosity of 70, and equally spaced in chroma -- and used the same saturation and chroma, but a luminosity of 80, for the bright set. This results in a pleasant pastely set of colors, which are e4asy on the eyes, when used on very dark backgrounds. The configuration can be seen in #+BEGIN_HTML XTerm. #+END_HTML I set the colors for /rxvt/ as well as /xterm/. Now, the most noticeable effect of these changes is if using the color option for /ls/, therefore the next thing to do was to configure the colors used by /ls/ using a utility dedicated for that task, namely, /dircolors/. By trial and error, I modified the default configuration provided by /dircolors/ and ended up with #+BEGIN_HTML dir colors, #+END_HTML with the results as you see.

Manoj

Monday 09 June
2008
Link: Using org-mode with Ikiwiki

Posted terribly early Monday morning, June 9th, 2008

Using org-mode with Ikiwiki

#+TITLE: Using org-mode for Ikiwiki #+AUTHOR: Manoj Srivastava #+EMAIL: srivasta\@debian.org #+DATE: #+LANGUAGE: en #+TEXT: Using org mode to write ikiwiki posts #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t TeX:t LaTeX:t skip:nil d:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+LINK_UP: http://www.golden-gryphon.com/blog/manoj/ #+LINK_HOME: http://www.golden-gryphon.com/ I have been much taken by [[http://orgmode.org/][org-mode]] in Emacs recently. Firstly, this has allowed me to actually effectively implement the tenets of "Getting things done", which is amazing by itself. I always used to start with great enthusiasm, which rarely lasted longer than a week. Until org-mode. Then this is so amazingly flexible. It has better handling of tables and even a spreadsheet mode than anything I have used --- and it has a pretty decent HTML export function. I practically live in org-mode on work days now. I strongly recommend org-mode, from things like agendas, TODO lists, calendars, appointments, articles, and now Ikiwiki posts. I rarely ever use markdown, apart from blogging using Ikiwiki -- and thus, since I blog so infrequently, I rarely ever remember all the syntax. On the other hand, org-mode syntax is now at my finger tips -- so I decided it was time to write a Ikiwiki plugin so I can now write my blog posts using syntax I can actually remember. It is still rough around the edges -- firstly, this requires emacs23 (or, on Debian, there is the unofficial emacs-snapshot package), secondly, it uses hueristic hacks to prune away the bits of the stand alone HTML page that org-mode creates; all I can say is that it currently works for me, as you can see from this post. How git this is for mainlne inclusion is another matter. The code is here: [[http://www.golden-gryphon.com/software/misc/org.pm.html][org.pm]]. It can be dropped in to the Ikiwiki plug-in directory, and that's all you need. With this, Ikiwiki pre-process things in the input file, and then passes it to emacs to htmlize it.

Manoj

Monday 26 May
2008
Link: Theming Emacs

Posted early Monday morning, May 26th, 2008

Theming Emacs


Update Added screenshots


I spend a lot of time working in front of a screen (many hours in a dimly lit room) and eye fatigue is an issue. A consistent color scheme, especially one which is easy on the eyes, is important -- and it also helps to have way of doing that where the directives are not all scattered all over my Emacs-lisp setup. Enter Emacs Color Themes, available as the Debian package emacs-goodies. Aided with a HSL color picker, I set around trying to create a dark color theme for Emacs.

It does not help that I am blue-green color blind, so subtle variations are often lost on me. I do want to use color contrast to increase productivity, but I also want to avoid the jarring angry fruit salad look, and so I am in the process of crafting a logical color scheme that is high contrast enough for me, without being too unpleasing.

Gnus
Groups In circumstances where there a lot of related faces that can be viewed, for example, the Gnus group buffer, consistent and logical color choices are the only sane option. Gnus groups can be news (bluish) or mail (greenish), have states (large number of unread messages, normal, and empty). The large number unread groups have highest luminosity (appear brighter), and the empty one have lower luminosity (appear greyer), but have the same hue and saturation. Sub states and group priorities are rendered using a color series which has constant luminosity and saturation, and vary in hue by a constant separation -- so all the related groups have the same brightness ({mail,news}/{unread,normal,empty}), and a graded selection of foreground colors. It sounds more complicated that it looks. The eye is drawn naturally to the unread groups, and first to the mail, then USENET groups (which is my preference).

Gnus Groups Similar color variations occur for individual messages in a group; high scoring messages bubble to the top, and have a higher luminosity. This color schema has made me slightly faster at reading mail/USENET. In the message itself, quoted mail messages from different people are color coordinated, with high contrast between citations that are close to each other in the hierarchy, so it is less likely that one misunderstands who said what in a long conversation.

The resulting scheme covers programming languages, Gnus, Erc, mail, org-mode, CUA-mode, apt-utils, bbdb, compilation buffers, changelog mode, diff and ediff, eshell, and more. This has allowed me to consolidate all my color directives into a single file, and is in a format that might be usable by others. See the wiki page for details about how to use and switch color themes in Emacs.

Enjoy.

Manoj

Friday 04 April
2008
Link: Schemes for packaging using Git: An analysis

Posted Friday evening, April 4th, 2008

Schemes for packaging using Git: An analysis

"Are you rebasing or merging?" seems to be the 64 thousand dollar question over in vcs-pkg discussions. Various people have offered their preferences, and indeed, several case studies of work flows have been presented, what is lacking is an analysis of the work-flow; an exploration of which methodology has advantages, and whether there are scenarios in which the other work flow would have been better.

Oh, what are all these work flows about, you ask? Most of the issues with packaging software for distributions have a few things in common: there is a mainline or upstream source of development. There are zero or more independent lines of development or ongoing bug fixes that are to be managed. And then there is the tree from which the distribution package is to be built. All this talk about packaging software work flows is how to best manage asynchronous development upstream and in the independent lines of development, and how to create a coherent, debuggable, integrated tree from which to build the distributions package.

The rebasing question goes to the heart of how to handle the independent lines of development using git; since these lines of development are based off the main line of development, and must be periodically synchronized. Here is a first look at a couple of important factors that will have bearing on that question, and packaging software for a distribution using Git in general. This is heavily geared towards git (nothing else does rebases so easily, I think), but some of the concepts should be generic. I am not considering the stacked set of quilt patches source controlled with Git in this article (I don't understand that model well enough to do an analysis)

As a teaser, there is a third answer: neither. You can just add an independent line of development, and just let it sit: don't rebase, and don't merge; and in some circumstances that is a winning strategy.

Manoj

Wednesday 02 April
2008
Link: Migrating to Git

Posted in the wee hours of Tuesday night, April 2nd, 2008

Migrating to Git

I have been using Arch to package my Debian packages since 2003; which means that Arch has had a good long run as my SCM of choice. I have been using CVS for a few years before I moved to arch, and the migration took me about six months, since it involved a while new philosophy of packaging; I am hoping that migrating to git would not involve such a major paradigm shift, and thus be less disruptive and time consuming. What follows is a narrative of my efforts to get educated about Git.

This article is meant to be an annotated, selective, organized set of links to information about Git. How does it differ from the myriad of other link collections about Git proliferating on the web? Well, the value add is in the annotations and the organization: while not quite a narrative of my exploration, this is an idealized version of what I think my discovery process should have been, to be most effective. Staging the information is important; google finds one lots of information that is incomprehensible to someone just coming to Git. This selection of links is actually selective; I have included only pointers to resources that fed me information at the level that I could handle at that stage, and I have eliminated links to information that was not new at that point. I have tried to select the best (in terms of information and clarity) of breed for each kind of information source I have come across so far.

There is a caveat: while still a beginner, though I am able to better judge now what is confusing to a beginner than I shall be when I have become more familiar with the system, I am still enough of a novice not to trust my judgement on what really is best practice. I can fix the latter as I gain experience, but then I'll need to be careful not to overload on complexity too early in the learning curve.

On the down side, this selection is subjective, and probably shall be even in the long term: I include what appealed to me, and will probably miss loads of pointers to information that I have not yet come across. However, I hope this will make it easier for other people to reach the same goal: use git for their version control needs.

Have fun.

Manoj

Thursday 31 January
2008
Link: Across the nightingale floor

Posted early Thursday morning, January 31st, 2008

Across the nightingale floor

I came across this series by Lian Hearn on a trip to DC. It was billed as Shogun meets Lord of the rings, and it certainly started off well. However, it lacks the breadth of either one of the epics it is trying to emulate, though it does succeed in providing an entertaining enough tale.

Manoj

Thursday 31 January
2008
Link: Back from DC

Posted early Thursday morning, January 31st, 2008

Back from DC

Both Judy and I managed to make it to DC for the annual company Christmas dinner, held this year at the tail end of January, since we could not otherwise arrange for a common meeting time. We spent Friday driving around Sterling, VA, looking at houses for sale -- and deciding that the lots they sat on were too cramped for our tastes, having lived out in the country for so long as we have. Had authentic Dim Sum for lunch.

The party was a success, since someone had brought along a inflatable play jungle for the kids, and food was interesting and the conversation fantastic. Judy left on Sunday; I had to recycle the rental car and the hotel room, since after I had set u0p the trip it turned out that I had to stay back longer in DC for business. I ended up returning on the 31st; and every single one of these three plane flights was delayed or cancelled.

Manoj

Thursday 31 January
2008
Link: Dragon Avenger

Posted early Thursday morning, January 31st, 2008

Dragon Avenger

The second dragon book from E. E. Knight. Auron's sister Wistala, whom he considered to be less capable, and who, in his opinion, had to be protected, turns out to have not died, and indeed, gone to greater lengths than her brother. This is a better set of books than the vampire Earth set.

Manoj

Thursday 31 January
2008
Link: Dragon Champion

Posted early Thursday morning, January 31st, 2008

Dragon Champion

Given how much I am enjoying the vampire Earth series from E. E. Knight, I thought I would check out the Age of Fire series from the same author. This is deliciously different -- rarely have I read a book about dragons from the perspective of the dragon! This books opens the dilemma of the temptation of the tasty, pesky humanoids, and yet how dangerous it is to eat them with abandon.

Unlike the humans in vampire earth, the dragon protagonist has no trouble forming and developing relationships, and it is a very satisfying journey, after all.

Manoj

Thursday 31 January
2008
Link: Dragon Outcast

Posted early Thursday morning, January 31st, 2008

Dragon Outcast

The last of the dragon books from E. E. Knight. And about the least of the litter: the crippled, outcast bronze -- too insignificant to have been named. And yet, the one to go furthest of the litter. I wish the lives of the litter mates intersected a bit when they were grown -- but they might as well have been on different planets. But I suppose that leaves room for future tales.

Manoj

Thursday 31 January
2008
Link: Grass for his pillow

Posted early Thursday morning, January 31st, 2008

Grass for his pillow

A continuation of the tales of the Otori by Lian Hearn. In this, our hero strikes off for his own, shrugging off the dictates of the others in his life, for the first time acting as an individual. While not nearly as good as it was hyped out to be, it is not a bad tale.

Manoj

Thursday 31 January
2008
Link: Rebel Fay

Posted early Thursday morning, January 31st, 2008

Rebel Fay

The Rebel Fay is the latest installment of the Noble Dead series by Barb & J. C. Hendee, and stands head and shoulder above the Vampire earth stuff I have been recently reading when it comes to character development, plot intricacy, and believable back story.

Written from the view point of a spirit creature, the Fay, currently constrained into the body of a dog, this brings our friends into the lands of the Elves, and we learn a bit more about the rationale for why the Dhampir was created. Can't wait for the next book to come out.

Manoj

Thursday 31 January
2008
Link: Tai-Pan

Posted early Thursday morning, January 31st, 2008

Tai-Pan

And old favorite from James Clavell. I have lost track of how often I have read this book -- often enough, certainly, that certain chapters are ingrained in my head. I saw a movie with the same name recently -- and it was not really all that close to the book; but I can not really blame the director. If you have not yet read Tai-Pan, you should.

Manoj

Thursday 31 January
2008
Link: Tale of the Thunderbolt

Posted early Thursday morning, January 31st, 2008

Tale of the Thunderbolt

Back to the Vampire Earth series by E. E. Knight. After an mildly interesting start, the book turns decidedly soporific, It is a travelogue for a Caribbean trip that Valentine takes, with a few mildly intriguing variations. I think that a non-loner role for Valentine does not work.

Manoj

Thursday 31 January
2008
Link: The Golden Compass

Posted early Thursday morning, January 31st, 2008

The Golden Compass

Since there has been so much uproar caused by the movie, I decided I would have a look at the trilogy -- though I generally have not been much into Philip Pullman, since I have found his books usually too simplistic and childlike -- which makes sense, I suppose, since they are not really targeted to adults.

It is a pity that I never ran across these when I was still a child, since they are much better written than the Narnia chronicles. I quite think that Lyra is a well drawn character, though she behaves in ways unfathomable to me, but perhaps this is because she is a girl and perhaps it is because I have never seen my daemon.

Manoj

Thursday 31 January
2008
Link: The Golden Gate

Posted early Thursday morning, January 31st, 2008

The Golden Gate

Yet another of Alistair Maclean screenplays pretending to be a book. Set mostly on the Golden Gate bridge, it would have made a spectacular movie. Clever plot hooks, but a almost non-existent plot line; but still, better than some action movies from that era. Chalk another one up to guilty pleasures.

Manoj

Thursday 31 January
2008
Link: The way to dusty death

Posted early Thursday morning, January 31st, 2008

The way to dusty death

This is one of the books that Alistair Maclean wrote when he thought he was writing screenplays, not books -- very visual action, inscrutable and inhuman protagonists, improbable or missing plots, and quite entertaining in a brainless kind of way. Yup, guilty pleasures.

Manoj

Thursday 31 January
2008
Link: Valentine's Exile

Posted early Thursday morning, January 31st, 2008

Valentine's Exile

As anticipated, the shakeup that drives Valentine away from a stable mid-level military career occurs, he is accused, court-martialed, and drummed out of the service, and goes on on a road trip, though thankfully this is no travelogue, like the thunderbolt book was. Some new things were learned, and maybe there will be some character development after all.

Manoj

Thursday 31 January
2008
Link: Valentine's Rising

Posted early Thursday morning, January 31st, 2008

Valentine's Rising

Ah, thank goodness. The quality of the story begins to improve; though never rising to the level of the first two books. Valentine leads his rag tag crew to rise up against the bad guys that have overrun the safe haven. However, Valentine is still getting too entrenched in the system; and that rarely works well for the kind of tales that jell for this character.

Manoj


Webmaster <webmaster@golden-gryphon.com>
Last commit: terribly early Sunday morning, June 8th, 2014
Last edited terribly early Sunday morning, June 8th, 2014