start new:
tmux
start new with session name:
tmux new -s myname
function smart_pwd { | |
local pwdmaxlen=25 | |
local trunc_symbol=".." | |
local dir=${PWD##*/} | |
local tmp="" | |
pwdmaxlen=$(( ( pwdmaxlen < ${#dir} ) ? ${#dir} : pwdmaxlen )) | |
NEW_PWD=${PWD/#$HOME/\~} | |
local pwdoffset=$(( ${#NEW_PWD} - pwdmaxlen )) | |
if [ ${pwdoffset} -gt "0" ] |
#!/usr/bin/env ruby | |
# by Helder Ribeiro 2009 | |
# | |
# Plugin to monitor delayed_jobs' queue size | |
# Gives updates with number of jobs that haven't been started yet | |
# plus the ones that failed and are still rescheduled for another run | |
# | |
# Parameters supported: | |
# | |
# config |
#Refer: http://www.linuxfoundation.org/collaborate/workgroups/networking/netem#Delaying_only_some_traffic | |
#Refer: http://www.bomisofmab.com/blog/?p=100 | |
#Refer: http://drija.com/linux/41983/simulating-a-low-bandwidth-high-latency-network-connection-on-linux/ | |
#Setup the rate control and delay | |
sudo tc qdisc add dev lo root handle 1: htb default 12 | |
sudo tc class add dev lo parent 1:1 classid 1:12 htb rate 56kbps ceil 128kbps | |
sudo tc qdisc add dev lo parent 1:12 netem delay 200ms | |
#Remove the rate control/delay | |
sudo tc qdisc del dev lo root |
# (create oauth2 tokens from Google Console) | |
client_id = "" | |
client_secret = "" | |
# (paste the scope of the service you want here) | |
# e.g.: https://www.googleapis.com/auth/gan | |
scope = "" | |
# Name: EXIFmover.py | |
# Author: Brian Klug (@nerdtalker / brian@brianklug.org) | |
# Purpose: | |
# Move Files into directory based on EXIF data make and model | |
# Designed to un-clusterfuck the Dropbox camera upload directory which is a mess of every | |
# JPEG and PNG ever if you use it like I do on a bunch of phones, and thus totally unwieldy | |
# and full of images sorted by date or else nothing sometimes, dropbox seems nondeterminstic | |
# Moves files into /[Image Make]+[Image Model]/ eg /Camera Uploads/LGE Nexus 4/ |
source :rubygems | |
gem "puma" | |
gem "sinatra" |
# Symlink the shared protected folder | |
run "ln -nfs #{shared_path}/protected #{latest_release}/protected" |
The plan is to create a pair of executables (ngrok
and ngrokd
) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok
to connect to this ngrokd
, and vice versa.
Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com
, you'll need a record for that and for *.domain.com
.
# your Gemfile should look something like... | |
gem 'fog-aws', require: false # or require: 'fog/aws' | |
# avoid having carrierwave loading during bundler | |
# setup. We need to get ./lib in the load_path first. | |
gem 'carrierwave', require: false |