Debian Hints

Tips & Tricks


Dansk tastaturlayout

Hvis Debian uheldigvis skulle køre med andet tastaturlayout end dansk, kan det ændres ved at køre kommandoen:

dpkg-reconfigure console-data

Indstil tid manuelt

date --set 1998-11-02
date --set 21:08:0

Fjern konsol-biplyde

Kør følgende kommando for at fjerne alle biplyde i den kørende konsol:

setterm -blength 0

Opret systembruger

addgroup --system
adduser --system --home --group

Fjern gammel kernel

uname -r
dpkg --list 'linux-image*'
apt-get remove linux-image-2.6.18-4-686

Find ubrugte pakker

deborphan (debfoster)

Aktiv shell

echo $SHELL

SSH sikkerhed

http://www.debian-administration.org/articles/455
apt-get install denyhosts

Pak tarball

tar cvf <name>.tar <path>

Fjern netværk interfaces

Fjern øverste linjer og ændre sidste til eth0: /etc/udev/rules.d/z25_persistent-net.rules

Ny IP

dhclient

MySQL Export/Import

mysqldump -u alfresco -p alfresco > dump.sql
mysql -u alfresco -p < dump.sql

Shared Directories

This is handy to easily share files, pictures, shared documents, etc. on multi-user systems (family PCs etc.).

Because Debian uses a user private group (UPG) scheme by default, the default permissions for new files (umask) can be set to allow write access to the group.

To create groups use "addgroup <GROUPNAME>" as root. For example on your home PC you could create a group "family" and add the appropriate users to it.

Then create a family group directory: Do "mkdir /home/family", give it to the group with "chown :family /home/family" and change its permissions for example with  chmod u+rwx,g+rws,o-rwx /home/family  to a privately shared set-group-id directory (in octal notation: 2770).

Finally, change the default umask to 002. Unless libpam-umask is installed (see below), this has to be set in /etc/profile and /etc/login.defs . Now family group members can work with each other's files in the group directory without permission hassle.