Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Install Oh My ZSH!
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Download the legacy format for NGINX compatibility | |
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz | |
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz | |
# Unzip | |
gunzip Geo*.gz | |
# Copy to /usr/share/GeoIP/ | |
cp Geo*.dat /usr/share/GeoIP/ |
# Install necessary packages | |
sudo apt-get unzip | |
sudo apt-get install libtext-csv-xs-perl | |
# Create database location | |
sudo mkdir /usr/share/xt_geoip | |
# Download the database file and convert | |
/usr/lib/xtables-addons/xt_geoip_dl | |
sudo /usr/lib/xtables-addons/xt_geoip_build -D /usr/share/xt_geoip *.csv |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Firebase REST queries require access_token
parameter for full access. This is Google’s OAuth 2.0 for service accounts.
# Configure logger | |
NekoLogger.logger = Logger.new($stdout, formatter: proc { |s, d, n, m| "#{s} : #{m}\n" }) | |
L = NekoLogger.logger | |
lvl = ENV['NEKO_LOG_LEVEL'] | |
if String === lvl && ['DEBUG', 'INFO', 'WARN', 'ERROR'].include?(lvl.upcase) | |
L.level = eval("Logger::#{lvl.upcase}") | |
end | |
# |
# This example will make Adobe Source Code Pro font look snug in TextMate. | |
# Adjust space above the line | |
defaults write com.macromates.TextMate.preview fontAscentDelta -float -2 | |
# Adjust space below the line | |
defaults write com.macromates.TextMate.preview fontLeadingDelta -float 0 | |
# Reset to default | |
defaults delete com.macromates.TextMate.preview fontAscentDelta |
# Generate private key with passphrase | |
openssl genrsa -des3 -out server.key 2048 | |
# Private key without passpharase; UNDERSTAND THE RISK! | |
openssl rsa -in server.key -out server.key-nopass | |
# Generate CSR to submit to CA | |
openssl req -new -sha256 -key server.key -out server.csr | |
# Check/view CSR |
# Generate the now preferred Ed25519 key | |
ssh-keygen -t ed25519 | |
# Search in known_hosts file | |
ssh-keygen -F "hostname" | |
# Remove key(s) from known_hosts file | |
ssh-keygen -R "hostname" |
# Save this at ~/.ssh/config | |
Host nickname | |
Hostname 192.168.0.123 | |
User nick | |
Port 2222 | |
IdentityFile ~/.ssh/id_nick | |
Compression yes | |
Host * | |
Compression no |
begin | |
# do something bad | |
rescue => e # StandardError by default | |
puts "Exception class: #{ e.class.name }" | |
puts "Exception message: #{ e.message }" | |
puts "Exception backtrace: #{ e.backtrace }" | |
# Or just: puts "#{e}" | |
end |