Skip to content

Instantly share code, notes, and snippets.

@Geoffrey-T
Forked from nicolasramy/iptables.md
Created March 4, 2013 16:42
Show Gist options
  • Save Geoffrey-T/5083605 to your computer and use it in GitHub Desktop.
Save Geoffrey-T/5083605 to your computer and use it in GitHub Desktop.

Debian System Administration - Useful commands

TAR

Compress

tar -pczf [file_name].tar.gz [folder_or_file_name]

Uncompress

tar -xvzf [file_name].tar.gz

DPKG

List installed packages

dpkg --get-selections

Find if specific package is installed

dpkg --get-selections | grep [package_name]

Xclip - Manage Clipboard from Terminal

Installation

apt-get install xclip

Send information in primary clipboard

echo "Hello World" | xclip
echo "Hello World" | xclip -selection p

Send information in the second clipboard

echo "Hello World" | xclip -selection c

Users

Add user

useradd {options} [username]
  options:
    -d : home dir
    -g : initial group
    -G : groups
    -p : password
    -s : shell
    -M : do not create user's home directory

Debian System Administration - Configuration

Debian System Administration - Installation

First steps

After install

apt-get update
apt-get upgrade

Useful software to install

apt-get install vim
apt-get install htop
apt-get install iftop
apt-get install tree
apt-get install screen
apt-get install git

Can be launch in 1-line

apt-get install vim htop iftop tree screen git

Add dotdeb repositories

Edit the sources.list file

vim /etc/apt/sources.list

Add this on the end of file (for Debian Squeeze)

## Dotdeb repositories
deb http://packages.dotdeb.org squeeze all
deb-src http://packages.dotdeb.org squeeze all

Get the dotdeb key and get started to envoy Dotdeb's repositories

cd /tmp
wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | apt-key add -
apt-get update

If you need more information, take a look here

Install Web Servers

Nginx

apt-get install nginx

Apache2

apt-get install apache2

Install Web Servers + PHP5

Nginx + PHP5-FPM

apt-get install nginx php5-common php5-curl php5-fpm php5-gd php5-imap php5-mcrypt php5-mysql php5-suhosin

Apache2 + PHP5 (mod_php5)

apt-get install apache2 libapache2-mod-php5 php5-common php5-curl php5-gd php5-imap php5-mcrypt php5-mysql php5-suhosin

Install Cache

PHP-APC

apt-get install php-apc

or

apt-get install php5-dev php-pear
pecl install apc

Install Database Servers

apt-get install mysql-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment