Skip to content

Instantly share code, notes, and snippets.

@eapen
eapen / gist:9f7d879a7ab13b190d4c73237ceaf068
Created August 10, 2020 19:35
Android phone unlock via adb
ul='adb shell input keyevent KEYCODE_POWER && adb shell input touchscreen swipe 530 1420 530 100 && adb shell input text 1111 && adb shell input keyevent 66'
# custom Android Studio VM options, see https://developer.android.com/studio/intro/studio-config.html
#-Dcom.sun.net.ssl.checkRevocation=false
#-Xms128m
#-Xmx4g
#-Xss512k
#-XX:MaxPermSize=1024m
# -XX:ReservedCodeCacheSize=200m
# -XX:+UseCompressedOop
@eapen
eapen / README.md
Created June 26, 2018 23:25
Stop and start CrashPlan / code42 backups on OS X

This script enables you stop and start CrashPlan / Code42 backup on OS X

If you are concerned about exceeding data usage plans if you are tethering etc., you can utilize this script but be aware that your data WILL NOT BE BACKED UP

To launch the UI agent in the menubar, you'll need to open CrashPlan app after you have started the background service (daemon)

Credits: Most of this script is borrowed from Steve Jansen's script to Start/Stop Symantec Endpoint Protection and CrashPlan documentation

@eapen
eapen / README.md
Last active June 26, 2018 21:41
Stop and start CrashPlan / code42 backups on OS X

This script enables you stop and start CrashPlan / Code42 backup on OS X

If you are concerned about exceeding data usage plans if you are tethering etc., you can utilize this script but be aware that your data WILL NOT BE BACKED UP

To launch the UI agent in the menubar, you'll need to open CrashPlan app after you have started the background service (daemon)

Credits: Most of this script is borrowed from Steve Jansen's script to Start/Stop Symantec Endpoint Protection and CrashPlan documentation

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eapen
eapen / yosemite-half-2017.py
Created May 21, 2017 15:08
Acquire free finisher photos from Yosemite Half 2017 since I wasnt wearing my bib
import urllib2
import json
RANGE = 1500
USERAGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36'
url = 'http://www.lucidimagesutshop.com/services/api/json/1.4.0/?galleryType=album&albumId=102388214&albumKey=w5FkcP&nodeId=9pBRHQ&PageNumber=1&imageId=0&imageKey=&returnModelList=true&PageSize=' + str(RANGE) + '&method=rpc.gallery.getalbum'
BASE_URL = 'http://www.lucidimagesutshop.com/2017-Races/Yosemite/FREE-Finisher-Photos/{}'
# URL:
# https://photos.smugmug.com/2017-Races/Yosemite/FREE-Finisher-Photos/i-VctQZ5B/0/9c28fe3c/D/387%201-D.jpg

Keybase proof

I hereby claim:

  • I am eapen on github.
  • I am eapen (https://keybase.io/eapen) on keybase.
  • I have a public key whose fingerprint is E5C7 4D7E 8333 C7F8 D146 5421 8A59 3594 4DAE 4965

To claim this, I am signing this object:

import urllib2
import lxml.html as lh
import re
USERAGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36'
url = 'http://www.marathonfoto.com/Proofs?PIN=R9R731&LastName=EAPEN'
BASE_URL = 'http://www.marathonfoto.com/Ajax/Zoom/?frameid={}'
# URL:
# http://www.marathonfoto.com/Proofs?PIN=XXXX&LastName=XXXX
import urllib2
import lxml.html as lh
import re
USERAGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36'
url = 'http://www.marathonfoto.com/Proofs?PIN=XXXX&LastName=XXXX'
BASE_URL = 'http://www.marathonfoto.com/Ajax/Zoom/?frameid={}'
# URL:
# http://www.marathonfoto.com/Proofs?PIN=XXXX&LastName=XXXX
@eapen
eapen / dmv-appointment-santa-clara
Last active May 25, 2017 23:03
DMV appointment
from lxml import html
from pprint import pprint
import requests
dmvpayload = {'officeId': 632, 'numberItems': 1, 'taskVR': 'true', 'firstName': 'FNAME', 'lastName': 'LNAME', 'telArea': '123', 'telPrefix': '456', 'telSuffix': '7890', 'resetCheckFields': 'true'}
headers = {'User-Agent': 'oh gist'}
url = 'https://www.dmv.ca.gov/wasapp/foa/findOfficeVisit.do'
r = requests.post(url, headers=headers, data=dmvpayload)
tree = html.fromstring(r.content)
appointment = tree.cssselect("p.alert")[1]