Last active
December 10, 2015 22:29
-
-
Save ertborTek/4502442 to your computer and use it in GitHub Desktop.
Catalog of Debian maintenance tasks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
# Catalog of common tasks. | |
################################################################################ | |
# | |
# Update packages. | |
# | |
apt-get update;apt-get upgrade | |
# | |
# Clear swap. | |
# | |
swapoff `cat /proc/swaps | awk '{ORS=" ";if($0 ~ /^\/dev\//) print($1)}'`;swapon `cat /proc/swaps | awk '{ORS=" ";if($0 ~ /^\/dev\//) print($1)}'` | |
# | |
# Add user to a group. | |
# | |
usermod -a -G group user | |
# | |
# Append a time stamp to a file. | |
# | |
cp -i $SOURCE_FILE $SOURCE_FILE.`date +'%Y%m%d-%H%M%S'` | |
# | |
# Flush deferred mail from the mail queue. | |
# | |
postfix flush | |
# | |
# Delete all messages from the postfix mail queue. | |
* | |
postsuper -d ALL | |
# | |
# Set up SSH keys. | |
# | |
#Create public and private keys on local host: | |
user@local:~$ ssh-keygen | |
#If it doesn't already exist, create authorized host file on remote host: | |
user@remote:~$ mkdir .ssh && chmod 700 .ssh && touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys | |
#Copy public key to remove host: | |
user@local:~$ cat ~/.ssh/id_rsa.pub | ssh [email protected] 'cat - >> ~/.ssh/authorized_keys' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment