Skip to content

Instantly share code, notes, and snippets.

@zed
zed / .gitignore
Created April 2, 2010 10:20
xor string: numpy vs. pyublas vs. fortran vs. C vs. Cython vs. Boost.Python
boost-python/bin/
*.py[co]
*.so
*.o
/xorcy.c
@query
query / rtorrent_xmlrpc.py
Created April 2, 2011 17:25
Python module for interacting with rtorrent's XML-RPC interface directly over SCGI.
#!/usr/bin/python
# rtorrent_xmlrpc
# (c) 2011 Roger Que <[email protected]>
#
# Python module for interacting with rtorrent's XML-RPC interface
# directly over SCGI, instead of through an HTTP server intermediary.
# Inspired by Glenn Washburn's xmlrpc2scgi.py [1], but subclasses the
# built-in xmlrpclib classes so that it is compatible with features
# such as MultiCall objects.
@palexander
palexander / gist:2975305
Last active January 21, 2022 14:03
Compiling and running mosh on Dreamhost
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME
VERSION=1.2.3
# Install Protocol Buffers
wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
tar -xf protobuf-2.4.1.tar.bz2
cd protobuf-2.4.1
@mayli
mayli / authorized_keys
Created July 31, 2012 05:28
My public keys of ssh
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDByOEhRdY5ezKZmcZCbmJrFN8ot9jV3E8uvYzRgqcs13cvfNOl4s9YXHuZ/sjcEWPREIlfdQM27f2ZHy63F1dF3yUW1Msu+luNs+nrLnMlUzLRA2nauHR6/oK0VwiWcNfA0BGcW35gvyAy40iAZJYKfxO2OW1k/QpKMMraAR++P++azS6fdI8FsL0kIS4MXPq+oCdvJRoUPhZ2AA0XVOFYRPZ+aLic31KZfcRJLRJO1QQoH1esBgingfhMMs3a91FOaX8iqpVTbm2EMdVVY3SKrhifUWPcacJR5qT5eaJK40M2Pz3ou4H1rjt5tSjKheaoZXZmvDNk4jQzxOITfE7P mayli@Matrix7
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDt9wlh7DBoDW3JTmBCVLWPxzUWsZAWLMThq0TRbpgtQ5rZ224Bm0l+g5cB8/eVWDhwVQFidOneyfWziq5QKqmwhZ9Zq+8vYMw8fAWPfplUOyqBsPigDuvoNP6ZRVp2b07b0waaesd8tzyJ+7pDfqj/YixOanHXZ4DHyKhnpuXRSnioOpbNZrunRhtrAfh+fuZbi6xI4jwc102AKMixyhdv7borgNcw+sUww2h2NiY2VGW7F+FgjO0EKDK0wsaBTKwdK55yuJRIE5PrM8cM/gOKPYzgo7bER+dmACmSHSRNu8qV0pmOH49YC9qPt/usZdW5R1Y/Frcn73eWLssMhN0Z mayli@matrix
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsJL9n89aMBmv3uCm5CebwJnD/Gytd81FHFA4CPKKwwZPS7A2fVVzlUbig9gntn42O78JNlxUZu7VvQXjbdDW0kOI2tZojQG05rfEA8oYS9YD0FCs84rZhpgvCUacjgNvBsMycLG6bc+b2GfzL0+6qVfr7rPZ2PeGNXbbST/dku2wXfa0+2mfE4TK75/ay017BY17
@kwarrick
kwarrick / fncache.py
Last active September 19, 2024 12:23
Redis-backed LRU cache decorator in Python.
#!/usr/bin/env python
__author__ = 'Kevin Warrick'
__email__ = '[email protected]'
import cPickle
from functools import wraps
def redis_lru(capacity=5000, slice=slice(None)):
"""
Simple Redis-based LRU cache decorator *.
@zouppen
zouppen / README.md
Last active January 7, 2024 20:24
Tool for extracting compression ratio and amount of compressed memory from zram swap partitions.

zraminfo

This is a simple tool for displaying memory information including compression ratio and percentage of compressed memory in Linux kernel using zram. This tool works without zram, but in that case it displays only basic memory statistics.

With LC_NUMERIC=en_GB.utf8 the output of ./zraminfo looks like this:

@yetithefoot
yetithefoot / stuns
Last active October 17, 2024 21:42 — forked from zziuni/stuns
STUN+TURN servers list
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@grudko
grudko / gist:4c1dcd2a2eb29bc3d98cd19bfd916cbd
Created December 2, 2016 13:16
Asyncio aiohttp example with PonyORM
#!/usr/bin/env python3
import asyncio
from asyncio_extras import threadpool
from aiohttp import web
from pony.orm import *
db = Database()
@davidfraser
davidfraser / Google Drive Sync Wine Scripting.md
Last active July 9, 2023 01:00
Google Drive Sync Wine Scripting

Google Drive Sync Wine Scripting

This is a set of scripts that help running Google Drive Backup and Sync under Wine, with multiple Google accounts.

Each account is given its own Wine prefix (a separate wine configuration).

To install, run install-gdrive-sync google_account

List the accounts set up in ~/.config/gdrive-accounts