Skip to content

Instantly share code, notes, and snippets.

@alvinl
alvinl / bootstrap.sh
Last active December 18, 2015 13:18
#!/bin/bash
echo "Setting up .bashrc"
curl https://gist.github.com/Alvinlz/5788654/raw/c0e096298776db6acdea4dd24779f61c90ccbfa5/gistfile1.txt > ~/.bashrc
echo "Done."
echo "Removing bash history"
rm ~/.bash_history
echo "Installing packages"
sudo apt-get install -y aptitude
@alvinl
alvinl / gist:5788654
Last active December 18, 2015 13:18
#This will set the login shell
export PS1='\u@\h:\[\e[0;32m\]\w\[\e[0m\] $ '
### Aliases
alias ..="cd .."
alias la="ls -la"
alias c="clear"
alias ap="aptitude"
alias cl="curl -L"
alias fm="free -m"
@alvinl
alvinl / config
Created June 1, 2013 18:34
nginx-express
server {
listen 80;
server_name yourdomain.com;
# Let's put all static files like images, js and css in sub-folder: public
root /opt/apps/firstapp/public;
# static content
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
# access_log off;
@alvinl
alvinl / md5.sh
Created December 26, 2012 05:59
Generates md5 hash per line in a given file
#!/bin/bash
while read line
do echo -n $line|md5
done < $1
@alvinl
alvinl / forge.sh
Created December 14, 2012 03:14
Minecraft server install script
#!/bin/bash
# Minecraft install script
apt-get update
apt-get install screen -y
wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk-7u3-download-1501626.html;" http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-linux-i586.tar.gz
mkdir /usr/lib/jvm/
tar -zxvf jdk-7u9-linux-i586.tar.gz -C /usr/lib/jvm/
rm jdk-7u9-linux-i586.tar.gz
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_09/bin/java 1065
@alvinl
alvinl / vpn.sh
Created April 21, 2012 20:45
Script to install pptp on Debian 6
#!/bin/bash
apt-get update
apt-get install pptpd -y
echo localip 192.168.240.1 >> /etc/pptpd.conf
echo remoteip 192.168.240.2-9 >> /etc/pptpd.conf
echo ms-dns 8.8.8.8 >> /etc/ppp/pptpd-options
echo ms-dns 8.8.4.4 >> /etc/ppp/pptpd-options
echo "vpn pptpd pass123 *" | tee -a /etc/ppp/chap-secrets
/etc/init.d/pptpd restart