start new:
tmux
start new with session name:
tmux new -s myname
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import urllib2 | |
| gh_url = 'https://api.github.com' | |
| req = urllib2.Request(gh_url) | |
| password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() |
| bootstrap-tooltip.js | |
| bootstrap-popover.js | |
| bootstrap-alert.js | |
| bootstrap-button.js | |
| bootstrap-carousel.js | |
| bootstrap-collapse.js | |
| bootstrap-dropdown.js | |
| bootstrap-modal.js | |
| bootstrap-scrollspy.js | |
| bootstrap-tab.js |
| # dropping a database via pymongo | |
| from pymongo import Connection | |
| c = Connection() | |
| c.drop_database('mydatabase') | |
| # drop a collection via pymongo | |
| from pymongo import Connection | |
| c = Connection() | |
| c['mydatabase'].drop_collection('mycollection') |
| HTML | |
| ===== | |
| <script type='text/javascript'> | |
| window.jQuery || document.write('<script src="js/jquery-1.7.1.js">\x3C/script>') | |
| </script> | |
| <script src='http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.0.6/modernizr.min.js' type='text/javascript'></script> | |
| <script type='text/javascript'> | |
| window.Modernizr || document.write('<script src="js/modernizr-2.0.6.js">\x3C/script>') | |
| </script> |
| # How to generate a secret key with Python | |
| # via http://flask.pocoo.org/docs/quickstart/ | |
| import os | |
| os.urandom(24) |
| #!/usr/bin/env sh | |
| # Download lists, unpack and filter, write to stdout | |
| curl -s https://www.iblocklist.com/lists.php \ | |
| | sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \ | |
| | xargs wget -O - \ | |
| | gunzip \ | |
| | egrep -v '^#' |
| clear; | |
| alpha = rand(1, 1000); | |
| beta = rand(1, 1000); | |
| val1 = sqrt(-2 * log(alpha)) .* sin(2 * pi * beta); | |
| val2 = sqrt(-2 * log(alpha)) .* cos(2 * pi * beta); | |
| hist([val1,val2], 20); |
This guide will explain how you can make irc messages in a screen on a remote server appear in your Mac OS X Lion Notification Center with the help of terminal-notifier.
We will also explain how the process can be automatically started each time you log in to your Mac and ensure the connection to the server is kept alive.
| #define _XOPEN_SOURCE 700 | |
| #include <signal.h> | |
| #include <unistd.h> | |
| int main() | |
| { | |
| sigset_t set; | |
| int status; | |
| if (getpid() != 1) return 1; |