Skip to content

Instantly share code, notes, and snippets.

View isislovecruft's full-sized avatar
🐺
hacking in the forest

isis agora lovecruft isislovecruft

🐺
hacking in the forest
View GitHub Profile
@isislovecruft
isislovecruft / autobackup-0.1.0.sh
Created December 19, 2011 20:38
Bash script to automate encrypted Duplicity backups, runs a check on available bandwidth first.
#!/bin/bash
#
# autobackup.sh v.0.1.0
# Written by Isis Lovecruft, isis@patternsinthevoid.net
#
# Backup script to automate SSH, SCP, SFTP, FTP, and IMAP backups through
# Duplicity. Duplicity encrypts backup file through GPG before sending
# files through protocol. This script runs a check on the available
# bandwidth, and only runs the backup when the bandwidth available is
# above a configurable password.
@isislovecruft
isislovecruft / arm-eabi-gcc_on_ubuntu.markdown
Created December 25, 2011 06:31 — forked from steakunderscore/arm-eabi-gcc_on_ubuntu.markdown
How I installed arm-eabi-gcc on Ubuntu 11.04, fixed minor package dependencies

Install some needed libraries

sudo aptitude install libmpc-dev

Make the temp directory to build in

mkdir toolchain
cd toolchain

Get the required sources

@isislovecruft
isislovecruft / tahoe-client-tor-only.mbox
Last active August 29, 2015 14:06
Mbox profile for testing that Tahoe only makes connections to the local Tor instance's SocksPort
# tahoe-client-tor-only.mbox
# --------------------------
#
# An Mbox [0] profile for assuring that a Tahoe client only makes connections
# to the local Tor instance's SocksPort. (In this example, `59050`.)
#
# NOTE: You'll need a patched copy of Mbox, see this tor-dev mailing list
# post, [1] and this patch. [2]
#
# Example usage:
@isislovecruft
isislovecruft / ctypes-bzero-pystringobject.py
Created July 9, 2015 01:56
Implement bzero(3) in ctypes for PyStringObject/PyBytesObject.
#!/usr/bin/env python2.7
def PyStringObject_ctypes_bzero(string):
"""Use ctypes to manipulate the internal value of a PyStringObject (or
PyBytesObject, for Python>=2.7.8), setting all the bytes to ``"\x00"``
(``"\0"`` in C), similarly to the libc bzero(3) function.
.. note: This function avoids copying the PyStringObject, as CFFI might
do, since any changes to one of Python's "immutable" strings would
result in a new PyStringObject/PyBytesObject with a different
From ac848cc17543b4a2378bfba743b889b5fa1225db Mon Sep 17 00:00:00 2001
From: Isis Lovecruft <isis@torproject.org>
Date: Thu, 9 Jul 2015 01:58:16 +0000
Subject: [PATCH] Add wipe_memory() function, like bzero(3), via CFFI for
PyStringObjects.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This function would need to be manually called on keys and any other
@isislovecruft
isislovecruft / lib.rs
Created February 13, 2018 00:24
using trait bounds in a `where` clause
extern crate rand;
use rand::Rng;
use rand::chacha::ChaChaRng;
const PI: f64 = std::f64::consts::PI;
fn sin(x: f64) -> f64 {
x.sin()
}
/* automatically generated by rust-bindgen */
pub const _STDINT_H: u32 = 1;
pub const _FEATURES_H: u32 = 1;
pub const _DEFAULT_SOURCE: u32 = 1;
pub const _BSD_SOURCE: u32 = 1;
pub const _SVID_SOURCE: u32 = 1;
pub const __USE_ISOC99: u32 = 1;
pub const __USE_ISOC95: u32 = 1;
pub const __USE_POSIX_IMPLICITLY: u32 = 1;
/* automatically generated by rust-bindgen */
pub const _STDINT_H: u32 = 1;
pub const _FEATURES_H: u32 = 1;
pub const _DEFAULT_SOURCE: u32 = 1;
pub const _BSD_SOURCE: u32 = 1;
pub const _SVID_SOURCE: u32 = 1;
pub const __USE_ISOC99: u32 = 1;
pub const __USE_ISOC95: u32 = 1;
pub const __USE_POSIX_IMPLICITLY: u32 = 1;
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBE5qkHABEADVnasCm9w9hUff1E4iKnzcAdp4lx6XU5USmYdwKg2RQt2VFqWQ
Sm1e+7YXbuIsW0rUG26OU/8lyF2f7WHCxTpNt045N6uHP0N3Q14M9b7LuMpllUSc
mUL5rSX8gUiOkvf2q86upYm9KUZiniPhjPZimK8VGnGckh5sDW7uAd49iJLpdnbQ
fReDNlfKcbza5fW+XozGMXE7HvNT0eYgm+grnc1W7YzC6oiJxxHo4DErZmmdil66
iy3tgFSHTJzY686TVaQ7s6o/+p//ZUVNvgmrvXExDhGZszWafY47vD7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