Jul 31 2003

Changing your bash prompt

Category: IT ThoughtsJeremy C. Wright @ 2:26 pm

Ok, here we go again you Windows users gone Linux!

I realize comfort level is at a premium here and you wish everything could be done from a GUI. Shame on you for thinking that. I said Linux was better, not easier! Sheesh.

Ok, so we can help you feel more comfortable, even at the commandline. Hell, this will even make you a better person when dealing with secure shell in your shared hosting environment.

Today’s tip – making the bash prompt friendlier.

So you fire up your old secure shell client from OpenSSH and you login. Upon authentication, you are greeted by a prompt like this:

bash-2.04$

Because you are used to a C prompt, let’s try to make this easier for you. Note-we are only changing the appearance of the shell prompt. This is not really the C drive.

Let’s move on. Are you ready? you might want to grab a seat. Ok, there we go.

export PS1="C:\>"

What does this do? Very simply, it overwrites the PS1 environment variable that is currently set as bash-2.04$ and sets it as C:\>.

You can also include lots of dynamic info in the prompt as well.

export PS1="\u@\w>"

will display the username@currently working directorylook like:

sketch@/home/sketch/public_html

There are plenty of other dynamic variables that can be used in bash as well. Try some of these:

\a The ASCII bell character (you can also type \007)
\d Date in “Wed Sep 06″ format
\e ASCII escape character (you can also type \033)
\h First part of hostname (such as “mybox”)
\H Full hostname (such as “mybox.mydomain.com”)
\j The number of processes you’ve suspended in this shell by hitting ^Z
\l The name of the shell’s terminal device (such as “ttyp4″)
\n Newline
\r Carriage return
\s The name of the shell executable (such as “bash”)
\t Time in 24-hour format (such as “23:01:01″)
\T Time in 12-hour format (such as “11:01:01″)
\@ Time in 12-hour format with am/pm
\u Your username
\v Version of bash (such as 2.04)
\V Bash version, including patchlevel
\w Current working directory (such as “/home/drobbins”)
\W The “basename” of the current working directory (such as “drobbins”)
\! Current command’s position in the history buffer
\# Command number (this will count up at each prompt, as long as you type something)
\$ If you are not root, inserts a “$”; if you are root, you get a “#”
\xxx Inserts an ASCII character based on three-digit number xxx (replace unused digits with zeros, such as “\007″)
\\ A backslash
\[ This sequence should appear before a sequence of characters that don't move the cursor (like color escape sequences). This allows bash to calculate word wrapping correctly.
\] This sequence should appear after a sequence of non-printing characters.

Happy Switching.


Jul 31 2003

Tryin a new distro!

Category: IT ThoughtsJeremy C. Wright @ 2:18 pm

Okay…it’s not Linux. Don’t crucify me. But I have decided to part ways (at least temporarily) with my Redhat distro in favor of FreeBSD. I downloaded it yesterday. This weekend I plan to install it. I’m looking for something really cutting edge…

Aaron


Jul 30 2003

For Mattias

Category: BusinessJeremy C. Wright @ 10:20 pm

I know how much Mattias loves customer service questions. Recently I decided to change my cell phone from a monthly “pay for minutes in advance” style plan to a “pay as you call” type plan.

I only had 5 issues…
Continue reading “For Mattias”


Jul 30 2003

PSP Goes Wireless!

Category: IT ThoughtsJeremy C. Wright @ 10:07 pm

It’s official, I will get a PSP (Sony’s new handheld gaming device to compete with the GameBoy Advance). Why? It’s going to be wireless!

Yes, this means you and your mate (s? will it have more multiplayer games than the PS/2?) can be within 5-12 feet of each other and be playing like it’s no big deal. Good stuff.


Jul 30 2003

BuyMusic.com

Category: BusinessJeremy C. Wright @ 5:26 pm

http://www.scriptygoddess.com/archives/004057.php

it actually seems like they did it wrong in every single way.
Continue reading “BuyMusic.com”


Jul 29 2003

New Top Referrer

Category: From My LifeJeremy C. Wright @ 7:12 pm

As always, I was checking our stats when I noticed this top referrer. Seems they’ve sent 200 visitors our way.

Not what you’d call your regular referrer for a tech/professional blog.

Anyone else having these guys show up on their blogs? Info, tips, should we be blocking them?


Jul 29 2003

US Jobs Move to India

Category: IT ThoughtsJeremy C. Wright @ 4:14 pm

Time Article.

I don’t have much to say except to hang a little sad smiley in here, since I’m looking for a job: : (


Jul 28 2003

Back to School

Category: BusinessJeremy C. Wright @ 8:59 am

Well, after 8 years away from school (and not having a degree at that); I made the decision a few weeks ago that I would aggressivly seek to have my Bachelor’s degree in 5 years (when I’m 32). I figure this is alot since my wife is expecting our first born son in September and since I’ll have to continue to work full time at Lockheed Martin. It will be aggressive but I’m absolutely dedicated to the process. My major will be Computer Engineering at University of Maryland Baltimore County which has a stellar Compsci/Engineering department.

Like I need it, but I’ll be starting with a single class for the fall (since that’s when our son will arrive…) in Introduction to Programming. I could probably test out but since my training is completely informal, it might not be a bad idea to get the basics formally taught to me (particularly OOP which I still struggle with on a practical level…conceptually I’m great!).

So all this to say that I am now registered for the fall. After eight years, can I make it back in academia? :p

Aaron


Jul 27 2003

Bad Geek Karma?

Category: IT ThoughtsJeremy C. Wright @ 10:11 pm

Seems that some people experience Bad Geek Karma, so add me to the list.

I’ve taken 2 weeks off to take care of the new boy and during this time 3 servers at work decided to crash while nobody else could get there, a supplier bailed on us, and one of my volunteers up and left. Wonderful week.


Jul 27 2003

Interesting Tidbits

Category: GeneralJeremy C. Wright @ 10:01 pm

A few interesting tidbits from around the web:

  • Went to see Spy Kids 3D along with loads of other folk this weekend. 3D glasses didn’t work worth a darn for me though, so I ended up watching the whole movie with one eye shut. Terribly entertaining. Emphasis on the terribly.

  • Malaysian marriages can now be ended via text message.
  • First month ever we’ve passed 10K page views here at ensight.
  • I managed to miss the blogathon this year.
  • Dell Canada, as well as several other Dell sites are now using .NET instead of plain old ASP, and finding it well worth the effort.


Next Page »