Skip to content

Instantly share code, notes, and snippets.

@davidyen1124
davidyen1124 / test_ip.py
Created Dec 30, 2013
Test every tku is available
View test_ip.py
import subprocess
import sys
import re
for i in range(2, 253):
ip = '163.13.129.%d' % (i)
#print '[+] Test %s...' % (ip)
subprocess.call('ifconfig eth0 %s netmask 255.255.255.0' % (ip), shell=True)
subprocess.call('route add default gw 163.13.129.254', shell=True)
p = subprocess.Popen(['ping', '8.8.8.8', '-c2'], stdout=subprocess.PIPE)
@davidyen1124
davidyen1124 / click_android.py
Created Dec 13, 2013
Touch the Android screen in an interval.
View click_android.py
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
import time
device = MonkeyRunner.waitForConnection()
while True:
device.touch(100, 100, MonkeyDevice.DOWN_AND_UP)
# Wait one hour
time.sleep(3600)
@davidyen1124
davidyen1124 / get_page_likes.py
Last active Dec 25, 2015
Get the likes of any facebook pages.
View get_page_likes.py
#!/usr/bin/python
# Get the likes of any facebook pages.
#
# You have to install https://github.com/pythonforfacebook/facebook-sdk first.
# Then go to Facebook Graph API Explorer, and copy the Access Token.
import facebook
import sys
@davidyen1124
davidyen1124 / monkeyrunner_browser.py
Last active Dec 22, 2015 — forked from AaronMT/gist:3172633
Use Android Monkey Runner to open Browser application on every attached device.
View monkeyrunner_browser.py
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
import os
devices = os.popen('adb devices').read().strip().split('\n')[1:]
package = 'com.android.browser'
activity = 'com.android.browser.BrowserActivity'
for serial in devices:
@davidyen1124
davidyen1124 / parking.py
Created Aug 1, 2013
Get parking lot API, and retrieve the address. After getting the address, I use pygeocoder to look for a rough coordinates. Finally I can use latitude and longitude to show all the parking lots on Google Maps by pygmaps.
View parking.py
#!/usr/bin/pyhton
# -*- encoding: utf-8 -*-
import urllib2
import json
import pygmaps
from pygeocoder import Geocoder, GeocoderError
url = 'http://data.taipei.gov.tw/opendata/apply/query/QzhBMEJFOTctMEEzRC00M0Q2LThDNDktNDVCNDc3NDNDRDBC?$format=json'
@davidyen1124
davidyen1124 / toilet.py
Created Aug 1, 2013
Get public toilet API, and show them on Google Maps by "pygmaps".
View toilet.py
#!/usr/bin/python
import urllib2
import json
import pygmaps
url = 'http://data.taipei.gov.tw/opendata/apply/query/NTQ4QTg2RjMtQjg0NC00REIxLUFCMUMtMzBGNTE5RTdCRUY3?$format=json'
def main():
@davidyen1124
davidyen1124 / wifly.py
Last active Dec 20, 2015
Get WiFly API, and use "pygmaps" to show all the hotspot in Google Maps.
View wifly.py
#!/usr/bin/python
# -*- encoding: utf-8 -*-
import urllib2
import json
import pygmaps
url = 'http://60.199.253.136/api/action/datastore_search?resource_id=d7a1b4c2-cad0-44f2-958a-a9d7a9330c95&limit=100000'
@davidyen1124
davidyen1124 / wifly.py
Created Aug 1, 2013
Get wifly API, and use "pygmaps" to show all the hotspot in Google Maps.
View wifly.py
#!/usr/bin/python
import urllib2
import json
import pygmaps
url = 'http://60.199.253.136/api/action/datastore_search?resource_id=d7a1b4c2-cad0-44f2-958a-a9d7a9330c95&limit=10000'
def main():
content = urllib2.urlopen(url).read()
View GetCaptcha.py
#!/usr/bin/python
import urllib2
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36'
base_url = 'https://isafe.moe.edu.tw/check_number2.php?time=1375012321&number={0}'
def getCaptcha(number):
@davidyen1124
davidyen1124 / attack_on_titan.py
Created Jul 13, 2013
This is a parser to check if there is a new episode of Attack On Titan, and it will notify the user by email.
View attack_on_titan.py
#!/usr/bin/python
import urllib2
import re
import os
import sys
import send
import time
You can’t perform that action at this time.