Linux/config

From Flavio's wiki
Jump to: navigation, search

Bash

~/.bashrc

Set a fancy prompt:

 PS1='\n\[\e[1;32m\]\u@\h\[\e[m\]:\[\e[1;34m\]\w\[\e[m\]\$ '

Your prompt will look like this:

 [blank line]
 user@host:~/dir$  

(I also like to make root's prompt red: just change 32 to 31 in the first ANSI sequence.)

~/.inputrc

set meta-flag on
set convert-meta off
set output-meta on

set completion-ignore-case on
set show-all-if-ambiguous off
set visible-stats on

emacs

~/.emacs

(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)
(pc-bindings-mode)

(put 'upcase-region 'disabled nil)
(require 'preview)
(custom-set-variables
  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 '(mouse-wheel-mode t nil (mwheel)))
(custom-set-faces
  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 )

Vim

~/.vimrc

syntax on
color torte
set showcmd
set showmatch
set incsearch
set hlsearch
set autowrite
set foldlevel=9
set foldminlines=2
set winheight=30
set guifont=Bitstream\ Vera\ Sans\ Mono\ 9

Apache

Don't tell the world what I am:

ServerTokens ProductOnly

sysctl

/etc/sysctl.conf

Disable ECN (see Debian bug #98228):

net/ipv4/tcp_ecn=0

Reboot system 60 seconds after a panic:

kernel.panic = 300

Serial console

First, make sure that serial console support is compiled into your kernel. Then,

/etc/lilo.conf

# Enables control from a serial line
serial=0,57600
append="console=tty0 console=ttyS0,57600"

/etc/inittab

S0:23:respawn:/sbin/getty -L 57600 ttyS0 vt100

Please note: if there isn't a graphics card at all in your server, you should comment out the getty lines for the TTYs, otherwise init will try to respawn them infinitely.

Courier MTA

Integration with SpamAssassin

Add these lines to /etc/courier/maildroprc:

# SPAM ASSASSIN is only called if message is small
if ($SIZE < 50000)
{
   exception {
      xfilter "/usr/bin/spamc"
   }
}

Grip

OGG

/usr/bin/oggenc
-o %m -a %a -l %d -t %n -d %y -G %G -N %t -b %b %w
/music/0new/%A/[%y] %*d/%t. %*n.ogg

M4A with FAAC

GRIP 2
exe /usr/bin/faac
cmdline -o %m -w --artist %a --title %n --genre %G --album %d --track %t/%N --year %y %w
extension m4a