Home

Towards an ideal bash environment.

  • Feb. 7th, 2009 at 1:13 AM
I've been using Linux for over 10 years, however it wasn't until I started getting paid to use Linux on a daily basis that I saw the value in keeping "dot files".

What I want is not a fancy prompt or tweaks to make a self-consistent system. I want to customize my environment so I can do more with less.

I'm still in the idealized design phase of this ideal environment. The core principles that I am going for are as follows:
  • The environment should work on any system with at least SSH and bash.
  • If part of my environment depends on an external tool, the environment should be able to attempt to get that tool onto the system.
  • If it is not possible to bring in an external tool, degrade gracefully.
  • Include as many custom configurations as possible.
One element of this environment that I'm excited about is an "infect" command. Given a remote host, username and password, this command will SSH to the remote host, install my SSH keys and then set up my environment. Part of this setup will be searching for external tool dependencies, if there are dependencies missing, I'm considering having the "infect" command attempt to compile the dependency on the remote host.

My end goal is this: No matter what host I am connected to, I want the following:
  • The name of the host I am on to be clear.
  • A core set of my commonly used tools.
  • Personal configurations for as many tools as possible.
The results of the idealized design I have done on this system so far are on my wiki: http://joel.franusic.com/Ideal-bash-environment

Tags:

fetch_urls_from_tinyurl.sh

  • Mar. 16th, 2008 at 12:05 AM

#!/bin/bash
# Fetch URLs from tinyurl.com
# Make sure you have curl and bc installed before you run this.
#
# Joel Franusic 2008 - Public Domain Sofware

MIN=1
MAX=10000
SLEEP_MAX=3
l=(0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z)

for((n=$MIN; n<$MAX; n++)); do
r=`echo "obase=36;$n" | bc`
num=''
echo -n "$n "
for c in $r; do
c=${c#0} # remove zero padding, yay variable mangling!
num=$num${l[$c]};
done
echo -n "$num "
result=`curl -s -I "http://tinyurl.com/$num" | grep -o -e 'http.*'`
echo -n "$result"
echo ''
sleep $((RANDOM%$SLEEP_MAX))
done

Tags:

Profile

[info]joel
Joel Franusic
Website

Advertisement

Latest Month

March 2009
S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Syndicate

RSS Atom
Powered by LiveJournal.com
Designed by Lilia Ahner