Now into http://nicolas-brousse.github.io/ubuntu-install-and-tips
-
-
Save nicolas-brousse/4511290 to your computer and use it in GitHub Desktop.
Do this operation with root user.
$ apt-get install vim
$ apt-get install wget
$ apt-get install git
$ apt-get install backup-manager
$ apt-get install fail2ban
If you have application that want to send mail follow this else go next.
sudo dpkg-reconfigure postfix
And enter this informations step by step:
Internet Site
NONE
server1.exemple.com
server1.exemple.com, localhost.exemple.com, localhost
No
127.0.0.0/8
0
+
To configure backup manager vi /etc/backup-manager.conf
BM_ARCHIVE_METHOD: add mysql (and svn if you have svn installed)
BM_TARBALL_DIRECTORIES: list of directories to backup (separated by space)
BM_TARBALL_BLACKLIST: list of ignored directories to backup (separated by space)
BM_UPLOAD_METHOD = "ftp"
BM_UPLOAD_FTP_USER = "ftp_user"
BM_UPLOAD_FTP_PASSWORD = "ftp_password"
BM_UPLOAD_FTP_HOSTS = "fpt.host.tld"
BM_UPLOAD_FTP_PURGE = "true"
BM_UPLOAD_FTP_TTL = "2" (One more is used during the archives trasfert)
BM_UPLOAD_FTP_DESTINATION = "/" (Do not leave blank)
$ cp /usr/share/backup-manager/backup-manager.cron.tpl /etc/cron.daily/backup-manager
$ chmod a+x /etc/cron.daily/backup-manager
Use file /etc/crontab
or add file into /etc/cron.d/
.
Disable ssh connection for root
user and enable just for precise users or group.
See common installation and configuration before
Do this operation with root user.
$ apt-get install mysql-server
$ apt-get install libapache2-mod-php5
$ apt-get install php-apc php5-cli php5-curl php5-dev php5-gd php5-imagick php5-intl php5-mcrypt php5-xsl
See common installation and configuration before
Do this operation with root user.
$ apt-get install postgresql
$ apt-get isntall nginx
http://tcweb.org/wiki/Backup-manager_et_debian#Postgresql
Create user and group:
$ adduser
--system \
--disabled-password \
--group \
--shell /bin/sh \
--gecos 'RVM' \
--home /home/rvm \
rvm
See http://rvm.io. (install into a ruby or rails unix user).
Add install the rvm requirments for ubuntu.
Define a ruby version as default.
$ rvm use x.x.x --default
Update rubygems?
$ rvm rubygems current
For a better configuration you can create a user by application:
$ adduser app_user
$ adduser app_user rvm
Interesting Gist: https://gist.github.com/2499900.
List crontab content of all user:
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
dig domain.tld
dig -x XXX.XXX.XXX.XXX
: domain reverse
netstat -atnpu
: port stats
mysqldump -u root --password="password" --all-databases | gzip> all_databases_dump.sql.gz
: Dump all Mysql databasesmysql < dump.sql
: Resore databases from a sql filemysql database_name < dump.sql
: Resore a database from a sql file
adduser --groups group_name user_name
: Create useradduser --system --no-create-home [--disabled-password] [--disabled-login] [--shell /bin/bash] --home-dir / --groups group_name user_name
: Create system useradduser group_name user_name
: Add a user into a group
Run this command from on new server.
ssh remote.srv.tld "cd /data/;tar zcf - files" | tar zxf -
This command recursively copies /data/files from remote.srv.tld to local server a lot faster on slow network.
-
du -hs /path/to/folder
: Get folder size -
df -h
: Get disks size -
iptables -L -n -v
-
su user_name -c 'command to execute'
: execute a command withuser_name
user -
find . -name ".svn" -exec rm -rf {} \;
: remove.svn
directories -
tar cfz archive.tar.gz target_dir_or_file
: archive and compress file or directory into tar.gz
- rkhuntuer: root kit hunter
Get your kernel version
$ uname -a
List the kernel into /boot:
$ sudo dpkg -l linux-image-\* | grep ^ii
Uninstall the old kernel:
$ sudo apt-get purge linux-image-3.0.0-16-generic
WARNING: Don't remove the current kernel version!!
source: http://blog.niftysnippets.org/2012/06/cleaning-up-old-ubuntu-kernels-from.html?m=1