start new:
tmux
start new with session name:
tmux new -s myname
#!/bin/bash | |
# Uses a PID file to add daemon-like behavior to an arbitrary program. | |
################################################################################ | |
usage() { | |
echo "Usage: `basename $0` PROGRAM {start|stop|restart|force-stop|force-restart|status} [PIDFILE|PID]" >&2 | |
echo "Where: PROGRAM is an executable file." >&2 | |
echo " PIDFILE is the file that contains (or will contain) the PID." >&2 | |
echo " PID is a process id to use in place of a PIDFILE." >&2 | |
} |
#!/usr/bin/env python | |
# found on <http://files.majorsilence.com/rubbish/pygtk-book/pygtk-notebook-html/pygtk-notebook-latest.html#SECTION00430000000000000000> | |
# simple example of a tray icon application using PyGTK | |
import gtk | |
def message(data=None): | |
"Function to display messages to the user." | |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
#!/bin/bash | |
# | |
# Watch current directory (recursively) for file changes, and execute | |
# a command when a file or directory is created, modified or deleted. | |
# | |
# Written by: Senko Rasic <[email protected]> | |
# | |
# Requires Linux, bash and inotifywait (from inotify-tools package). | |
# | |
# To avoid executing the command multiple times when a sequence of |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# prerequisites : | |
# sudo apt-get install nmap | |
# | |
# nmap.py | |
# Network Radar | |
# | |
# | |
# This program is free software; you can redistribute it and/or modify |
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
#XLarge DBInstanceClassMemory = 15892177440 = 14.8GB | |
#/32 = 496630545 = 473MB | |
#/64 = 248315272 = 236MB | |
#/128 = 124157636 = 118MB | |
#/256 = 62078818 = 59MB | |
#/512 = 31039409 = 29MB | |
#/12582880 = 1263 #default same divisor as max_connections = 4041.6MB = 4237924762 | |
#/25165760 = 623 # half of max_connections = 1993.6MB | |
#/50331520 = 315 # quarter of max_connections = 1008MB = 1056964608 | |
#*(3/4) #default innodb pool size = 11922309120 |
#!/usr/bin/env python | |
# Public domain. | |
"""A script to establish an SSH SOCKS proxy and enable it in the OS X network configuration. | |
Cleanly handles failure to connect. Kills ssh and removes network configuration on CTRL-C. | |
First argument gives the hostname for use with ssh.""" | |
import subprocess, sys, signal | |
proxy_command_base = ['networksetup', '-setsocksfirewallproxystate', 'Wi-Fi'] |
#!/usr/bin/env ruby | |
progress = 'Progress [' | |
1000.times do |i| | |
# i is number from 0-999 | |
j = i + 1 | |
# add 1 percent every 10 times | |
if j % 10 == 0 |