This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ipset -N tor iphash | |
| wget -q https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=$MY_IP -O - | sed '/^#/d' |while read IP | |
| do | |
| ipset -q -A tor $IP | |
| done | |
| iptables -A INPUT -m set --match-set tor src -j DROP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if [[ ${EUID} == 0 ]] ; then | |
| PS1='\[\033[01;31m\][\h]\[\033[01;34m\]\w#\[\033[00m\] ' | |
| else | |
| PS1='\[\033[01;32m\][\u@\h]\[\033[01;34m\]\w:\[\033[00m\] ' | |
| fi | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!--[if lt IE 9]> | |
| <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | |
| <![endif]--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from subprocess import PIPE, Popen | |
| from threading import Thread | |
| try: | |
| from Queue import Queue, Empty | |
| except ImportError: | |
| from queue import Queue, Empty # python 3.x | |
| ON_POSIX = 'posix' in sys.builtin_module_names |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://habrahabr.ru/blogs/javascript/138773/ | |
| function deferrable(f) { | |
| return function() { | |
| return (function(f, args) { | |
| return function() { return f.apply(null, args); }; | |
| })(f, arguments); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // use enums to implement an interface. | |
| public interface Room { | |
| public Room north(); | |
| public Room south(); | |
| public Room east(); | |
| public Room west(); | |
| } | |
| public enum Rooms implements Room { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '?' + '&'.join([u'%s=%s' % (urllib.quote(str(k)), urllib.quote(str(v))) \ | |
| for k, v in p.items()]).replace(' ', '%20') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.ajax({ | |
| url:url, | |
| type:"POST", | |
| data:data, | |
| contentType:"application/json; charset=utf-8", | |
| dataType:"json", | |
| success: function(){ | |
| // .. http://api.jquery.com/jQuery.ajax/ | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import jinja2 | |
| import scrubber # http://pypi.python.org/pypi/scrubber | |
| def sanitize_html(text): | |
| return jinja2.Markup(scrubber.Scrubber().scrub(text)) | |
| jinja_env.filters['sanitize_html'] = sanitize_html | |