Allgemeine Informationen rund um Linux

Patching

Patch erzeugen

diff -Nurb "alt" "neu" > file.patch

Patch einspielen

cd pfad
patch --dry-run -p0 < file.patch
patch -p0 < file.patch

Backup

Backup erstellen

$ su -
tar --exclude /proc --exclude /sys --absolute-names --create --verbose --file - /* |pv |ssh USER@TARGET "gzip >backup.tar.gz"

Backup testen / verifizieren

$ tar -tzf backup.tar.gz

Backup einspielen

Einzelne Verzeichnisse

$ tar -xzf backup.tar.gz "/home/*"

Alle Verzeichnisse bis auf

$ su -
tar --exclude="/boot/*" --exclude="/home/*" -xzf backup.tar.gz "*"

Konsole

Piepen

/etc/inputrc
set bell-style visible

oder

set bell-style none

Alternativ:

in der Konsole direkt oder in der ~/.bashrc

$ setterm -blength 0

Für X gilt:

xset -b

Bash History

in der ~/.bashrc

export HISTCONTROL=ignoredups:erasedups

Anmerkung: Die Options “erasedups“ wird erst am Bash Version 3.0 unterstützt. Installation unter Debian mit “apt-get install bash3

Bash History und Midnight Commander

Stören euch auch immer diese Cryptoangaben des Midnight Commander in der Bash History? Bsp: “ cd „`echo -e '\057home\057“

Abhilfe schafft dieser Eintrag in der .bashrc (für den jeweiligen User) oder Global für alle in /etc/profile:

HISTIGNORE=*PROMPT*:*\057*
export HISTIGNORE

Zeilenumbruch Xterm / Putty und Co

 shopt -s checkwinsize

Core Dumps

Core Dumps verhindern:

per Consolebefehl:

ulimit -H -c 0

oder per default in /etc/security/limits.conf

# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain>        <type>  <item>  <value>
#
#Where:
#<domain> can be:
#        - an user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#
#<type> can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
#<item> can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open files
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit
#        - maxlogins - max number of logins for this user
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#
#<domain>      <type>  <item>         <value>
#
 
#*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#@student        -       maxlogins       4
# End of file
 
* hard  core  0

Tmpfs

none /tmp tmpfs defaults,size=128M,mode=1777,noexec,nosuid 0 0
$ mount | grep tmpfs
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
$ ls -l /tmp
lrwxrwxrwx 1 root root 9 Jul 25 2003 /tmp -> /dev/shm//
  • ideal für /var/run (macht solaris so)
  • lebt im virtuellen speicher nicht im ram - swap!
  • wird immer auch fuer sysv ipc shmem benötigt, wegen verschiedener quota sollte man aber 2 mounten.

Quellen:

XDM

allgemeine.txt · Zuletzt geändert: 2011/07/22 23:26 (Externe Bearbeitung)
 
Falls nicht anders bezeichnet, ist der Inhalt dieses Wikis unter der folgenden Lizenz veröffentlicht: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki