Archive for the 'General' Category

Pretty bash prompts

I stole this from a Debian .bashrc file - it makes your bash prompt nice and colourful.

export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ‘

So what I did was put the above line in my local machine’s .bash_profile, and the following:

export PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ‘

in the dedicated server’s .bashrc (my terminal doesn’t listen to .bashrc locally it seems). Once both lines are in place, your local prompt will be mostly green, and the server prompt will be mostly red, giving you a quick visual indication of which command-line you are currently working on.

Improving iTerm keyboard shortcuts

iTerm is a cool terminal replacement for OS X (tabs, bookmarks, and profiles off the top of my head); I’m still using Tiger, I think Leopard’s terminal app has been improved, but I’m not sure how it matches up to iTerm.

I like to use Command (Apple key) + left and Command + right to skip to the beginning and end of lines respectively, unfortunately iTerm doesn’t understand these shortcuts out of the box (although you can use Function + left and right). To enable this:

  1. Open iTerm
  2. Bookmarks menu > Manage profiles
  3. Keyboard profiles > Global
  4. Click +
  5. Key: cursor left, Modifier: Command, Action: send escape sequence “OH”
  6. Click “High interception priority” and then OK
  7. Click +
  8. Key: cursor right, Modifier: Command, Action: send escape sequence “OF”
  9. Click “High interception priority” and then OK

You can also set up Alt + left and Alt + right to navigate between whole words, the commands are:

  • Key: cursor left, Modifier: Option, Action: send escape sequence “f”
  • Key: cursor right, Modifier: Option, Action: send escape sequence “b”

Turn, turn, turn around

http://www.lucid-tv.com/077.html

Happy Tuesday

Every day should contain a little bit of Bill Hicks’ wisdom:

Not all drugs are good, now. Okay? Some of ‘em are great. Just gotta know your way around ‘em, that’s all. Yeah, I’ve had good times on drugs. I’ve had bad times on drugs too. I mean shit, look at this haircut. There are dangers. One time me and three friends dropped acid… drove around in my Dad’s car, he’s got one of those talking cars, we’re tripping, the car goes “the door is ajar”. We pulled over… thought about that for 12 hours. “How can a door be a jar?” - “Shit, I don’t know but I see it, I see it. Why would they put a jar on a car man?”

I’m proud of every moment in my life, alright? Think some of y’all have tripped here before perhaps, yeah? I used to love tripping, man. There’s always one guy when you’re tripping who wants you to do something to enhance the trip. You know what I’m talking about. “You’re tripping? Oh duuude, you gotta play miniature golf.” [Bill hangs onto the table] Ha ha Yeah, that’s exactly what I was thinking, man. I’m just sitting over here watching the pyramids be built by UFOs right now, but get me to that fucking golf course. I’m watching Jesus flying around on a unicorn, but I bet that little miniature golf would be just the thing to make this trip… peak. So you guys can use your legs, huh? No, it’s just that I’m turning into a fish right now and, er… how ’bout I meet you there later? Thanks, I’m pretty fucking high right now. Thank you. You know.

You just gotta be careful, I don’t know what you gotta be, fuck it. We got pulled over tripping on acid one night, pulled over by the cops. Don’t recommend it. Cops don’t appreciate fish driving around. They frown on that. Long night, man. Cops were tapping on this window. We’re staring at him in this mirror. “How tall are you?” “A liddle cop, look at him!” “How does he drive that big fucking car?” “Urr, there could be thousands of them, shit!” “What are we gonna do?” “Let’s put him in the jar.” Made perfect sense at that moment. Put him in a jar, poke some holes in the lid, leave him by the road. “You’ll never get us copper. Haha.” “We’ll send some little firemen to let you out.” “Hey I bet they know where the miniature golf course is!” “Boo! Haha.. fuck it, they scared us.” “Son d’you wanna stand up please?” “I just found the driver.” “We don’t need a driver, we’re playing miniature golf.” True story. Now, later, when I was released [laughter]… I mean spiritually… Oh God. “I need to see some ID.” “I’m me, he’s him, you’re you.” “Put your hands against the car please.” “Which one. The UFO, the unicorn or your cruiser?”