Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung Nächste Überarbeitung Beide Seiten der Revision | ||
linux:grundkonfiguration [2007-07-29 11:18] stefan |
linux:grundkonfiguration [2012-07-27 23:07] 127.0.0.1 Externe Bearbeitung |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== Grundkonfiguration des Systems ====== | ====== Grundkonfiguration des Systems ====== | ||
===== Verschiedenes ===== | ===== Verschiedenes ===== | ||
+ | * Alle Pakete updaten | ||
+ | * <code bash>apt-get update | ||
+ | apt-get -u -o APT::Force-LoopBreak=true upgrade</code> | ||
* ''~/bin'' anlegen für eigene Scripts | * ''~/bin'' anlegen für eigene Scripts | ||
+ | * Nützliche Pakete | ||
+ | * <code bash>apt-get install bzip2 unzip less patch traceroute ssh vim locate dnsutils host telnet lynx wget make</code> | ||
+ | * Zeiten für automatische Scripts in ''/etc/crontab'' anpassen | ||
- | ===== .bashrc ===== | + | ===== ~/.bashrc ===== |
<code bash>export PS1='\u:\w\$ ' # Prompt anpassen | <code bash>export PS1='\u:\w\$ ' # Prompt anpassen | ||
export PATH=${PATH}:~/bin # eigene Scripts in den PATH | export PATH=${PATH}:~/bin # eigene Scripts in den PATH | ||
Zeile 16: | Zeile 22: | ||
alias vi='vim' # immer vim nutzen | alias vi='vim' # immer vim nutzen | ||
- | alias cdsrc='cd /usr/local/src'</code> | + | alias cdsrc='cd /usr/local/src' |
+ | |||
+ | bash -c "echo -ne '\033]0;`hostname`\007'" # send hostname to PuTTY</code> | ||
+ | |||
+ | ===== Vim ===== | ||
+ | ==== ~/.vimrc ==== | ||
+ | <code>set wrap | ||
+ | set tabstop=4 | ||
+ | set shiftwidth=4 | ||
+ | set expandtab | ||
+ | set autoindent | ||
+ | set wildchar=<Tab> | ||
+ | set nonumber | ||
+ | set foldmethod=marker | ||
+ | set hidden | ||
+ | set wmh=0 | ||
+ | filetype on</code> | ||
+ | |||
+ | ==== /etc/vim/vimrc ==== | ||
+ | <code>" This line should not be removed as it ensures that various options are | ||
+ | " properly set to work with the Vim-related packages available in Debian. | ||
+ | runtime! debian.vim | ||
+ | |||
+ | syntax on | ||
+ | |||
+ | set autoindent " always set autoindenting on | ||
+ | set textwidth=0 " Don't wrap words by default | ||
+ | set nobackup " Don't keep a backup file | ||
+ | set viminfo='20,\"50 " read/write a .viminfo file, don't store more than 50 lines of registers | ||
+ | set history=50 " keep 50 lines of command line history | ||
+ | set ruler " show the cursor position all the time | ||
+ | set nopaste | ||
+ | set pastetoggle=<F2> | ||
+ | |||
+ | " Suffixes that get lower priority when doing tab completion for filenames. | ||
+ | " These are files we are not likely to want to edit or read. | ||
+ | set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc | ||
+ | |||
+ | " If using a dark background within the editing area and syntax highlighting | ||
+ | " turn on this option as well | ||
+ | set background=dark | ||
+ | |||
+ | " Uncomment the following to have Vim jump to the last position when | ||
+ | " reopening a file | ||
+ | if has("autocmd") | ||
+ | au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | ||
+ | \| exe "normal g'\"" | endif | ||
+ | endif | ||
+ | |||
+ | " Uncomment the following to have Vim load indentation rules according to the | ||
+ | " detected filetype. Per default Debian Vim only load filetype specific | ||
+ | " plugins. | ||
+ | if has("autocmd") | ||
+ | filetype plugin on | ||
+ | filetype indent on | ||
+ | endif | ||
+ | |||
+ | " The following are commented out as they cause vim to behave a lot | ||
+ | " differently from regular Vi. They are highly recommended though. | ||
+ | set showcmd " Show (partial) command in status line. | ||
+ | set showmatch " Show matching brackets. | ||
+ | set ignorecase " Do case insensitive matching | ||
+ | "set smartcase " Do smart case matching | ||
+ | set incsearch " Incremental search | ||
+ | set autowrite " Automatically save before commands like :next and :make | ||
+ | "set hidden " Hide buffers when they are abandoned | ||
+ | "set mouse=a " Enable mouse usage (all modes) in terminals | ||
+ | set hlsearch | ||
+ | |||
+ | " Konfiguration für Syntax Highlighting => HTML | ||
+ | let use_xhtml = 1 | ||
+ | let html_number_lines = 1 | ||
+ | let html_use_css = 1</code> | ||
+ | |||
+ | ===== logrotate ===== | ||
+ | Meine Logfiles werden mit //logrotate// wöchentlich gesichert und zwar in das Verzeichnis eines hierfür angelegten FTP-Benutzers. So kann ich die Logs regelmäßig auf meinem Heim-PC sichern. | ||
+ | Eine Konfigurationsdatei für logrotate für die Systemmeldungen sieht z.B. so aus: | ||
+ | <code ini> | ||
+ | /var/log/syslog | ||
+ | /var/log/messages { | ||
+ | olddir /home/ftp/backup/logs/syslog | ||
+ | weekly | ||
+ | missingok | ||
+ | rotate 52 | ||
+ | compress | ||
+ | delaycompress | ||
+ | notifempty | ||
+ | create 700 ftpuser ftpusers | ||
+ | sharedscripts | ||
+ | } | ||
+ | </code> |