There are a few things I always do when setting up a new system running Debian: I install the bash-completion, I set up my terminal colors, enable coloration in vi/vim and other little improvements.

In order to make my next setup much easier and save some time, I gather the necessary steps in this post.

Installing linuxlogo

I like to be greeted by my computer. After all, I spend so much time with him everyday. So, I always install linuxlogo.

1
aptitude install linuxlogo

Installing bash-completion

The bash-completion package enables a much more advanced completion (still using tab) which will not only complete on apt to make it aptitude but on aptitude ins to make it aptitude install. I got used to it, I don’t want to live without it.

1
aptitude install bash-completion

Wait, it doesn’t work yet, you need to enable this in your profile. Keep on reading…

Setting up my bash profile

I don’t do much here (share your tips in the comment) but activate the bash-completion, a connection logo and my prompt colors. There are two files to edit : .bash_profile and .bashrc (if they don’t exist, create them).

In .bash_profile, I add:

1
2
3
alias ll='ls -l'
alias lsa='ls -lsa'
linux_logo -f -u -y -t "Welcome, samo"

In .bashrc, I edit the prompt:

1
2
# Comment in the above and uncomment this below for a color prompt
PS1='${debian_chroot:+($debian_chroot)}\[\033[0;33m\]\u@\h\[\033[00m\]:\[\033[0;36m\]\w\[\033[00m\]\$ '

and in .bashrc, I add:

1
export VISUAL="vi"
1
2
3
4
# enable bash-completion if it is available
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi

Once you edited one of these files, if you want to see the effects of your changes, run source<filename>. At this point, if you installed the bash-completion, it should work.

Setting up root’s bash profile

I don’y use root often but to run aptitude upgrade or such things but one thing I like, when I am root, is to be immediately aware of the danger. That’s why I make the prompt red in that case. To do that, I edit /root/.bashrc

1
2
#Color prompt version
PS1='${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u@\h\[\033[00m\]:\[\033[0;36m\]\w\[\033[00m\]\$ '

In the same file, I also add the completion, a few aliases and I send myself an email every time root is used as a security mesure (if someone gets root access I’ll know about it)

1
2
3
4
5
export VISUAL="vi"
#enable bash-completion if it is available
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
1
2
3
alias ls='ls $LS_OPTIONS --color=auto'
alias ll='ls $LS_OPTIONS -al --color=auto'
alias vi='vim'
1
echo 'Root Shell Access on ' `date` `who` | mail samantha.halfon@wwangle.net

Syntax coloration in vi/vim

Another thing I got used to and would like to see by default, the syntax coloration in vi/vim. To enjoy it, install vim

1
2
aptitude install vim
vi /etc/vim/vimrc and uncomment the syntax coloration option (line syntax on)

For fun, reopen that same file and this time, it will have its colors. Awesome!

Auto login with SSH using a private key (from iTerm)

This is so convenient, it must be setup (if your security requirements allow it). I always follow this tutorial by David Winter in order to set this up. Nothing complicated, just head over there and follow the few steps.

This would not be complete if I didn’t assign the SSH login a bookmark in iTerm 

Press Shift + Command + B to manage your iTerm bookmarks
Create a new bookmark, give it the name of your remote host and enter the command ssh xxx.xxx.xxx.xxx
Choose a display profile and background as well as a shortcut letter
Save your bookmark and type the key combination, you are logged in on your remote host!

Anything else?

I do not spend so much time playing with Debian. Truthfully, I setup my server, once my projects run, I’m good. The rest of the time, I use Mac OS X. Still, I know there must be a lot many more comfortable tweaks available. Please, share your favorite in the comments. If you feel like reading on, here is a forum post about customizing .bashrc and several good examples to get inspiration.

Filed under: Computing, Debian, Système

Tagged with: , , , , , , , ,

Liked this page?

Tweet it

Subscribe to the RSS feed or sign up for the newsletter now.

Posts related to Debian Etch: setting up the basics

3 Comments to "Debian Etch: setting up the basics"

  1. Trackback on Samantha Halfon on January 2, 2011 at 8:50 am

    New blog post: Debian Etch: setting up the basics:
    There are a few things I always do when setting up a new sys… http://bit.ly/eDXOWW

  2. Trackback on Installing OpenSSH on Windows 7 World Gone Web : World Gone Web on June 7, 2011 at 10:55 am

    […] user’s public key in this folder in a file called authorized_keys. Since I’ve already setup my public key, I simply add to place it in that folder and do : 1234567cd c:Users<username> cp id_dsa.pub […]

  3. Comment by Marden on December 12, 2011 at 9:27 pm Reply

    That isinght solves the problem. Thanks!

Name (required)

Email (required)

Website

Leave a Reply

  • About Me


    photo of Samantha Halfon Samantha Halfon
    Software Engineer
    blueKiwi software
    Paris, France
    I enjoy playing with my computer(s), listening to Bob Dylan (and related artists) and watching movies (especially if they were directed by Martin Scorsese or John Cassavetes). Sometimes, I play a little guitar... If not doing any of the above, I am either riding a small red bike around Paris, or, making videos. About my videomaking please check out World Wide Angle and its blog.