Skip to content

Instantly share code, notes, and snippets.

View pyropeter's full-sized avatar

PyroPeter pyropeter

View GitHub Profile
@pyropeter
pyropeter / LICENSE
Last active December 2, 2016 12:25
python module de/encoding bencoded data
Copyright (c) 2015, PyroPeter <$nickname@$nickname.eu>
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@pyropeter
pyropeter / compare.py
Created September 26, 2010 14:50
AUR: that language stuff
#! /usr/bin/python -O
# -*- coding: utf-8 -*-
from findkeys import findkeys
from parsepo import parseall
def dings():
used = findkeys()
translations, langs = parseall()
@pyropeter
pyropeter / base64.c
Created September 2, 2010 19:28
base64 de/encode in C
static const char b64[] = "\
ABCDEFGHIJKLMNOPQRSTUVWXYZ\
abcdefghijklmnopqrstuvwxyz\
0123456789+/";
static const unsigned char b64dec[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x00
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x10
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 63, //0x20
@pyropeter
pyropeter / aurupload.sh
Last active September 5, 2015 22:05
AUR upload helper script
#!/bin/bash
set -u
set -e
declare -A categorys
categorys[daemons]=2
categorys[devel]=3
categorys[editors]=4
categorys[emulators]=5
@pyropeter
pyropeter / aurit.sh
Created August 26, 2010 19:41
AUR-tools
#!/usr/bin/env bash
set -e
set -u
# Does like everything you can do with a PKGBUILD:
# * Builds source package
# * TODO: Runs namcap on PKGBUILD
# * Builds binary package
# * Runs namcap on the binary package
#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/syscall.h>
@pyropeter
pyropeter / LICENSE
Last active June 7, 2021 16:49
PKGBUILD parser
Copyright (c) 2010 PyroPeter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@pyropeter
pyropeter / gist:506166
Created August 3, 2010 10:31
Google Search API documentation
# http://www.google.com/uds/GwebSearch?q=foo%20bar&v=1.0
{ responseStatus: 200
, responseData:
{ results:
[ { visibleUrl: 'www.foobar2000.org'
, titleNoFormatting: 'foobar2000'
, cacheUrl: 'http://www.google.com/search?q=cache:obAJTkESjhwJ:www.foobar2000.org'
, title: 'foobar2000'
, content: 'Media player with simple UI and low memory use. Offers plugin support for new features. Includes link to forum focused on application. [Win32]'
@pyropeter
pyropeter / Successful recovery.log
Created July 28, 2010 09:38
Undelete /lib on Arch-Linux
acl-2.2.49-1
lib/
lib/libacl.so
lib/libacl.so.1.1.0
lib/libacl.so.1
attr-2.4.44-1
lib/
lib/libattr.so.1
lib/libattr.so
lib/libattr.so.1.1.0
@pyropeter
pyropeter / duplicates.js
Created July 27, 2010 14:16
Find duplicate files
#!/usr/bin/env node
var sys = require('sys'),
fs = require('fs'),
childProcess = require('child_process')
hashtable = {}
md5table = {}
fileblacklist = []