Skip to content

Instantly share code, notes, and snippets.

View AlexAltea's full-sized avatar

Alexandro Sanchez AlexAltea

View GitHub Profile
@AlexAltea
AlexAltea / google-translate.py
Created November 24, 2014 06:45
Simple Google Translate access from Python
import httplib, urllib, string
# Just a quick, dirty function I made before a proper API appeared (e.g. goslate).
def translate(IN, OUT, text):
text = urllib.quote(text)
conn = httplib.HTTPConnection("translate.google.com")
conn.request("GET", "/translate_a/t?client=t&text="+text+"&hl="+IN+"&tl="+OUT)
res = conn.getresponse().read()
res = res[4:string.find(res,",\"\",\"\"]]")]
res = string.split(res, "],[")
@AlexAltea
AlexAltea / prx-info.py
Created July 23, 2014 02:13
Extract interesting information from PlayStation 3 PRX files
import os
import glob
# Get lv2 syscall group
def getLv2SyscallGroup(id):
if 1 <= id <= 31:
return "sys_process"
if 40 <= id <= 58:
return "sys_ppu_thread"
if 67 <= id <= 69 or id == 77: