Skip to content

Instantly share code, notes, and snippets.

View jetsanix's full-sized avatar
💭
💭💭💭

jet tsang zeon-git jetsanix

💭
💭💭💭
View GitHub Profile
from subprocess import Popen,PIPE
import re
import time
import sqlite3
CONCURRENCY_ALLOWED = 30
OUTDATE_TIME = 86400
# initializing database
db = sqlite3.connect("/tmp/ddos.db3")
@jetsanix
jetsanix / parallets.sh
Created August 9, 2011 05:50
Parallels on lion
#!/bin/sh
sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_hypervisor.kext"
sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_hid_hook.kext"
sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_usb_connect.kext"
sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_netbridge.kext"
sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_vnic.kext"
@jetsanix
jetsanix / alphatown.js
Created August 31, 2011 20:22
alphatown map on
/* paste and run on chrome */
for(i=100;i<6000;i++){
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","http://alphatown.com/api/node/"+i+"/info?sync=true&d=1314820793143&p=&w=191&oz_tm=_alphatown_api_handler______3380______1314820793143",true);
xmlhttp.send();
}
@jetsanix
jetsanix / html5-notifications.md
Created July 12, 2012 09:22
OS X Notification Center in Safari 6 & Chrome 21+

OS X Notification Center in Safari 6 & Chrome 21+

OS X Mountain Lion adds Notification Center for managing alerts. Just like growl, but better.

Safari 6 and latest Chrome (21+) expose HTML5 notifications API to sites. Every site need to have permission for showing notifications.

Specification is very new and completely different from older version Chrome had. Developer doesn't have to watch for complicated NotificationCenter.

The syntax is very simple:

# Basic Strongswan ikev2 server setup
* paltform: atlantic.net ubuntu 14.04 x64
* the commands below are run with root account
## Strongswan
```
apt-get install strongswan
apt-get install iptables iptables-persistent
```
{
"Python": {
"python": '/usr/bin/python',
"pythonExtraPaths": ["/Users/YourUsername/PythonPath"]
},
"Python3": {
"python": '/usr/bin/python3',
"pythonExtraPaths": ["/Users/YourUsername/Python3Path"]
}
}
#!/usr/bin/env python
"""html2text: Turn HTML into equivalent Markdown-structured text."""
__version__ = "3.1"
__author__ = "Aaron Swartz (me@aaronsw.com)"
__copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3."
__contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes", "Kevin Jay North"]
# TODO:
# Support decoded entities with unifiable.
@jetsanix
jetsanix / podcast_downloader.py
Last active December 17, 2015 18:18
podcast downloader (with password)
#!/usr/bin/env python
# encoding: utf-8
# edit from https://github.com/hrktir/download_podcast_mp3/blob/master/download_podcast_mp3.py
# echo "http://podcasturl/xml podname" >> urls.txt # one podcast rss in each line
# python podcast_downloader.py urls.txt
import urllib2
from xml.dom.minidom import parse
import time
#!/bin/sh
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -U
count = 0;
jQuery(".time").each(function(){
var $t = jQuery(this);
var $del = $t.parent().parent().find('a.delete');
jQuery.ajax({
type: 'POST',
url: location.href,
data: {
action: 'msg.del',
msg: $t.attr('ffid'),