Skip to content

Instantly share code, notes, and snippets.

View ngty's full-sized avatar

Ng Tze Yang ngty

  • RankAbove Ltd
  • Singapore
View GitHub Profile
@ngty
ngty / rvmrc-local
Created February 8, 2012 07:24
Enjoy a faster rails boot up :D
gemset=mayday
old_ruby=ruby-1.9.3-p0
new_ruby=ruby-1.9.3-p0-perf
# Get 30% boast for rails boot, see https://gist.github.com/1688857
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_FREE_MIN=500000
@ngty
ngty / battery-stats
Last active December 17, 2015 04:48
Generating battery status
#!/bin/bash
if [ "$(acpi -a | awk '{print $3}' | tr [a-z] [A-Z])" == "ON-LINE" ]; then
if [ "$(acpi -b | awk '{print $4}')" == "100%" ]; then
echo -n "100%"
else
echo -n "$(
acpi -b | \
awk '{gsub(",",""); print $4 "(+" $5}' | \
awk -F: '{print $1 ":" $2 ")"}'
@ngty
ngty / pptp_startup_script
Last active August 29, 2015 14:02
VyperVPN
#!/bin/sh
ISP_FALLBACK=no
STARTUP_LAPSE=120
# PPTP settings
# Remote Subnet: 0.0.0.0
# Remote Subnet Mask: 255.255.255.0
# MPPE Encryption (note the space is not typo): mppe required,no40,no56,stateless
# MTU (use default): 1450
# MRU (use default): 1450