Skip to content

Instantly share code, notes, and snippets.

@deniszh
deniszh / whisper-cyanite.py
Last active February 16, 2023 03:39
Quick and dirty script to migrate Graphite from whisper to cyanite
#!/usr/bin/env python
import os
import mmap
import struct
import signal
import optparse
import cql
try:
@tobyink
tobyink / AcmeConstructorPythonic.pm
Created October 21, 2012 09:09
As per Hercynium's suggestion...
use strict;
use warnings;
BEGIN {
package Acme::Constructor::Pythonic;
no thanks;
use Data::OptList qw(mkopt);
use Sub::Install qw(install_sub);
use Module::Runtime qw(use_module);
sub import {
@netj
netj / relpath
Created January 7, 2012 06:32
A Bash script providing a command for computing relative path between two filesystem paths
#!/bin/bash
# relpath -- Compute relative path from a given DIR to given PATHs
# Usage: relpath DIR PATH...
#
# Example: relpath /a/b/c /a/d/e/f
# prints: ../../d/e/f
#
# Example: relpath /a/b/c /
# prints: ../../../
#
@jberger
jberger / usex-declare.pm
Created December 31, 2011 07:19
A basic use_from implementation
package UseX::Declare;
use strict;
use warnings;
use Carp;
use Devel::Declare ();
my $verbose = 0;
# wget --header='Accept-Encoding: gzip' -O root.bin.gz http://bellard.org/jslinux/root.bin
# gunzip root.bin.gz
# mkdir mnt
# mkdir files
# sudo mount -t ext2 -o loop root.bin mnt
# dd if=/dev/zero of=files/root.bin bs=1k count=4096
# sudo mke2fs -m 0 -i 2000 files/root.bin
# mkdir mnt2
# sudo mount -t ext2 -o loop files/root.bin mnt2
# sudo cp -dpR mnt/* mnt2/