start new:
tmux
start new with session name:
tmux new -s myname
| #!/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'] |
| #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 |
| # 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 |
| class LogWrappedFunction(object): | |
| def __init__(self, function): | |
| self.function = function | |
| def logAndCall(self, *arguments, **namedArguments): | |
| print "Calling %s with arguments %s and named arguments %s" %\ | |
| (self.function.func_name, arguments, namedArguments) | |
| self.function.__call__(*arguments, **namedArguments) | |
| def logwrap(function): |
| class SetterNGetter(): | |
| def __init__(self, *args, **kwargs): | |
| self.my_age = kwargs['age'] | |
| self.my_name = kwargs['name'] | |
| @property | |
| def my_age(self): | |
| return self.my_age |
| def outsideFunc(Func): | |
| def one(*args, **kwargs): | |
| print Func(*args, **kwargs) | |
| def two(*args, **kwargs): | |
| print Func(*args, **kwargs) | |
| def nothing(*args, **kwargs): | |
| print Func(*args, **kwargs) |
| #!/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 |
| #!/usr/bin/python | |
| import gtk | |
| class StatusIcon: | |
| def __init__(self): | |
| self.statusicon = gtk.StatusIcon() |
| #!/usr/bin/env python | |
| import sys | |
| import os | |
| def restart_program(): | |
| """Restarts the current program. | |
| Note: this function does not return. Any cleanup action (like | |
| saving data) must be done before calling this function.""" | |
| python = sys.executable | |
| os.execl(python, python, * sys.argv) |