Skip to content

Instantly share code, notes, and snippets.

@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:

@kwarrick
kwarrick / fncache.py
Last active November 24, 2024 21:21
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 *.
@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
@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
@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.
@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