Skip to content

Instantly share code, notes, and snippets.

View 0xPr0xy's full-sized avatar
🎯
Focusing

Peter IJlst 0xPr0xy

🎯
Focusing
View GitHub Profile
@0xPr0xy
0xPr0xy / detect_mobile
Created September 23, 2011 14:17
minidetector
from microdetector import detect_mobile
@detect_mobile
def my_mobile_view(request):
if request.mobile:
#do something with mobile
@0xPr0xy
0xPr0xy / Install all locales
Created September 27, 2011 13:33
Install all locales
#! /bin/sh
cd /usr/share/locales
./install-language-pack eo.UTF-8
./install-language-pack ia.UTF-8
./install-language-pack ie.UTF-8
./install-language-pack io.UTF-8
./install-language-pack vo.UTF-8
./install-language-pack ca.UTF-8
./install-language-pack fr_AD.UTF-8
@0xPr0xy
0xPr0xy / passgen
Created October 5, 2011 16:25
password generator
from string import digits, ascii_letters
from random import choice
from sys import argv
def generator(length):
chac = digits + ascii_letters
pwd = list()
for p in range(length):
pwd.append(choice(chac))
print("".join(pwd))
@0xPr0xy
0xPr0xy / passgen.py
Created October 5, 2011 16:27
password generator
from string import digits, ascii_letters
from random import choice
from sys import argv
def generator(length):
chac = digits + ascii_letters
pwd = list()
for p in range(length):
pwd.append(choice(chac))
print("".join(pwd))
@0xPr0xy
0xPr0xy / python
Created February 13, 2012 13:01
autoregister.py
def autoregister(*app_list):
from django.db.models import get_models, get_app
from django.contrib import admin
from django.contrib.admin.sites import AlreadyRegistered
for app_name in app_list:
app_models = get_app(app_name)
for model in get_models(app_models):
try:
admin.site.register(model)
except AlreadyRegistered:
@0xPr0xy
0xPr0xy / Picasa.py
Created July 25, 2012 18:33
Simple Picasa Class
import gdata.photos.service
import gdata.media
import gdata.geo
import getpass
class Picasa:
def upload(self,filename, title):
gd_client = gdata.photos.service.PhotosService()
@0xPr0xy
0xPr0xy / blogger-cli.bash
Created July 25, 2012 18:44
blogger post command
./blogger.py 'Hello World!' "First post from command line through Google's Blogger API ^^"
@0xPr0xy
0xPr0xy / sound.py
Created July 26, 2012 17:37
sound made with pyknon
from pyknon.genmidi import Midi
from pyknon.music import NoteSeq
notes1 = NoteSeq("D4 F#8 A Bb4")
midi = Midi(1, tempo=90)
midi.seq_notes(notes1, track=0)
midi.write("demo.mid")
@0xPr0xy
0xPr0xy / request.py
Created July 27, 2012 09:35
automate making requests (flooding ^^)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests as request
import sys
class Requester:
def __init__(self, flood_max, url):
<html>
<head>
<style type="text/css">
#containername {
background-color:red;
width: 500;
height: 500;
}
</style>
</head>