wget https://github.com/OpenVPN/easy-rsa/archive/master.zip
unzip master.zip
cd easy-rsa-master/easyrsa3
cp vars.example vars
# Fetch and fill config | |
mikrotik_vpn_config=$(curl https://gist.github.com/elmariofredo/7232556/raw/VPN-L2TP-IPSEC.mikrotik \ | |
| sed -e ' | |
s/IPSEC_PEER_SECRET/somesecret/g; | |
s/USER1_NAME/mario/g; | |
s/USER1_PASS/somepass/g; | |
s/IP_RANGE/172.16.24.100-172.16.24.200/g; | |
s/DNS_SERVER/172.16.22.1/g; | |
s/LOCAL_ADDRESS/172.16.22.1/g; | |
s/WINS_SERVER/172.16.22.1/g') |
-
Comment your code while you are coding, try to comment every line whit bit more complex logic, use http://yardoc.org/ and http://yui.github.com/yuidoc/
-
Keep code structured to guide eye when one is looking thru the code
-
Try to reuse things first, when you are about to do something first try to think if anyone has done that before(search current code base or google)
-
Keep things modular and reusable, try to think about every method if it can be possibly useful for something else than what is your original purpose, if yes(even in future) then make it that way to allow reuse of such method
-
Think simple after it’s done, when code is done look if it cannot be simpler, then refactor with primary focus on flow from top to bottom, eye start at top of code and goes thru logic till end(if possible)
openssl genrsa -des3 -out trexglobal.com.key 4096 | |
openssl req -new -key trexglobal.com.key -out trexglobal.com.csr | |
cp -v trexglobal.com.{key,original} | |
openssl rsa -in trexglobal.com.original -out trexglobal.com.key | |
rm -v trexglobal.com.original | |
openssl x509 -req -days 9999 -in trexglobal.com.csr -signkey trexglobal.com.key -out trexglobal.com.crt |
# TvHeadEnd Server | |
description "Tvheadend server" | |
start on xbmc-started | |
script | |
su - pi -c "/usr/local/bin/tvheadend -f" | |
exit 0 | |
end script |
require "csv" | |
csv = CSV.new(File.read('zone.csv')) | |
dns_servers = ["ns1.dns.net", "ns1.otherdns.net"] | |
csv.each do |row| | |
type = row[0] | |
name = row[1].lstrip |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
brew doctor | |
brew install caskroom/cask/brew-cask | |
brew cask install google-chrome | |
brew cask install mplayerx | |
brew cask install vlc | |
brew cask install java |
var gulp = require('gulp'), | |
spawn = require('child_process').spawn, | |
node; | |
var startServer = function() { | |
if (node) node.kill() | |
node = spawn('node', ['--harmony', 'index.js'], { | |
stdio: 'inherit' | |
}) |
# Reveal Library | |
chflags nohidden ~/Library | |
# Install homebrew | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
# Install homebrew cask | |
brew install caskroom/cask/brew-cask | |
# Install all necessary sw | |
brew cask install google-chrome | |
brew cask install firefox | |
brew cask install spectacle |