Skip to content

Instantly share code, notes, and snippets.

@tridinebandim
tridinebandim / backup.sh
Last active August 29, 2015 14:07 — forked from n2j3/backup.sh
#!/bin/bash
BACKUP_SRC="/root /etc /home"
BACKUP_DST="/tmp"
MYSQL_SERVER="127.0.0.1"
MYSQL_USER="mysql username"
MYSQL_PASS="mysql password"
#VPS_ID="vpsidentifier"
# Stop editing here.
NOW=$(date +"%Y.%m.%d")
<?php
$countries =
array(
"AF" => "Afghanistan",
"AL" => "Albania",
"DZ" => "Algeria",
"AS" => "American Samoa",
"AD" => "Andorra",
"AO" => "Angola",

NOTE: You can check, if your config here:
http://www.sslshopper.com/ssl-checker.html

Decrypt the private key using the password you entered when you created your key:
openssl rsa -in ssl.key -out /etc/nginx/conf/ssl.key

Protect your key from prying eyes:
chmod 600 /etc/nginx/conf/ssl.key

@tridinebandim
tridinebandim / gist:4003916
Created November 2, 2012 19:49
Taking a Gzip archive of a directory.
tar -cf - [DIRECTORY] | gzip > [NAME].tar.gz
@tridinebandim
tridinebandim / gist:4003912
Created November 2, 2012 19:48
Apache Vhosts file
# domain: paulbooker.co.uk
# public: /var/www/vhosts/paulbooker.co.uk
<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin webmaster@paulbooker.co.uk
ServerName paulbooker.co.uk
ServerAlias www.paulbooker.co.uk
@tridinebandim
tridinebandim / gist:4003910
Created November 2, 2012 19:48
Managing users & groups
#Adding a user into a group with a home directory
/usr/sbin/adduser -g [GROUP] -d [DIRECTORY] [USER]
#To add an existing user to a group ..
/usr/sbin/usermod -G [GROUP] [USER]
/usr/sbin/usermod -a -G wheel paul
#To add a group ..
/usr/sbin/groupadd [GROUP]
@tridinebandim
tridinebandim / gist:4003908
Created November 2, 2012 19:48
Adding apache authentication on a web directory
htpasswd -c .htpasswd [USERNAME]
@tridinebandim
tridinebandim / gist:4003907
Created November 2, 2012 19:48
How to do a reverse DNS lookup on an IP
dig -x [IP]
@tridinebandim
tridinebandim / gist:4003891
Created November 2, 2012 19:46
Synchronizing files on two servers
rsync -av --exclude "[DIRECTORY]" -e ssh [PUBLIC_DOMAIN_DIRECTORY] [USER]@[IP]:[PUBLIC_DOMAIN_DIRECTORY]