Something I Want: Simple Environment Setup

Posted by knorby on November 29, 2008 under IT, Linux, Python, Solaris, coding, shell scripting | Read the First Comment

I am mostly jotting this down so I can work on this later and to see if anyone has any suggestions.

I was thinking last night that I need to setup my own personal environment on new systems quite a bit, and that isn’t going to change anytime soon. I do not want to work off of something too centralized, as I really don’t have that option. I need to be able to maintain a setup on my home machines, various UChicago machines, and various other machines. In some cases, I just need a work environment for a short term period, such as on maclab machines (although I usually just ssh into one of the linux cluster machines and use X11 forwarding to load up XEmacs GUI goodness). sshfs isn’t an option, as it sucks, and FUSE isn’t always installed everywhere (for good reason). Subversion might serve nicely, but I can’t assume that it is installed, as it often isn’t; I tend to think Subversion or other repository systems shouldn’t be used for much beyond software development. I also need to worry about various differences in systems. I can always install software to the system or to my home directory, and various UNIX flavors have their own quirks, especially Solaris. So what I want is an initializing setup script that downloads and extracts a basic environment from some central server. Everything in this set of scripts should be sectionalized. There should be some decent metadata format (probably some XML format) to store information about these sections and on the sections installed. There should be some update system on top of that. In the case that a package management system is available, the system should be able to use it, and as fall back, download and install a few specific packages into my home directory. Things like python would use already existing systems for setting this sort of thing up. Given that the system would assume almost nothing, most of the initial system would probably need to do processing on the server side. Other than that, the only software that the system would assume would be ssh, bash, and tar (maybe). This thing will take time, but I think it would be useful for a long time to come.

Shell Palindrome Fun

Posted by knorby on April 10, 2008 under Apple, Linux, OpenBSD, Solaris, humor, shell scripting | Be the First to Comment

I had some good old fashion fun today on the shell today. I stumbled across this “gem” of an expression:

yes xargs | xargs yes

This expression can be repeated infinitely (mostly) many times without changing the output and without loosing symmetry when joining on the yes’s. In other words, the last expression is equivalent (in regards to output and symmetry):

yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes

You can throw some rot13s (with care), cats, and a few other commands in there with the same effect. I am not sure exactly how it functions; it seems to work different on different OSes. I have tried in on Linux, Mac OS X, Solaris, and OpenBSD, and all seem to be a bit different. They seem to run a bit differently, and the output is different. It’s all very fun.

Update: I thought I should clarify that last little bit. The way pipes are treated seems to vary some; the actual functionality is trivial.