Skip to content

Instantly share code, notes, and snippets.

View cpu's full-sized avatar
❄️

Daniel McCarney cpu

❄️
View GitHub Profile
@cpu
cpu / backgroundTile.sh
Last active August 29, 2015 13:57
Generate random p4m tile backgrounds with ImageMagick and feh.
#!/bin/bash
################################################################################
# About
################################################################################
#
# Dumb script to generate a random 100x100 tile in the p4m background group.
# Uses 'feh' to tile the image as a desktop background.
#
# Install to crontab -e to rengerate at a fixed interval. E.g. every 5 min:
@cpu
cpu / fuck_boingo.py
Created March 11, 2014 08:02
So you're stuck in an Airport overnight too huh?
#!/usr/bin/python
# Fuck Boingo. Fuck $7 wifi
# requests module is a non-optional dependency
# gntp is an optional dependency for Growl support
from os import sys
from random import randint
from shlex import split
from subprocess import check_call
@cpu
cpu / keybase.md
Created March 7, 2014 04:53
Keybase Github Identity Claim

Keybase proof

I hereby claim:

  • I am binaryparadox on github.
  • I am cpu (https://keybase.io/cpu) on keybase.
  • I have a public key whose fingerprint is EA93 53F3 1EAA C378 B854 99AE 9599 2CFB 3537 3091

To claim this, I am signing this object:

@cpu
cpu / ShittyCrypto.java
Last active December 31, 2015 23:58
Example code using BSAFE & DUAL_EC_DRBG to generate n bytes of randomness from a terrifically suspect CSRNG, unlike https://gist.github.com/binaryparadox/8063008 this version allows you to supply your own backdoored curve points instead of using the NIST standard points for DUAL_EC_DRBG. You must have the BSAFE shareCrypto.jar library on your cl…
import java.math.BigInteger;
import java.security.Provider;
import java.security.SecureRandom;
import java.security.Security;
import com.rsa.crypto.ECPoint;
import com.rsa.jsafe.provider.ECDRBGInstantiationParameterSpec;
import com.rsa.jsafe.provider.ECPointVerifiable;
import com.rsa.jsafe.provider.SecureRandomEx;
import com.rsa.jsafe.provider.SensitiveData;
@cpu
cpu / ShittyCrypto.java
Last active December 31, 2015 23:49
Example code using BSAFE & DUAL_EC_DRBG to generate n bytes of randomness from a terrifically suspect CSRNG. You must have the BSAFE shareCrypto.jar library on your classpath. If you can't find a copy of that you should get in touch with me.
import java.math.BigInteger;
import java.security.Provider;
import java.security.SecureRandom;
import java.security.Security;
import com.rsa.jsafe.provider.SensitiveData;
//Largely cribbed from RSA BSAFE Docs.
public class ShittyCrypto {
@cpu
cpu / dnscrypt.configure.log
Created June 3, 2013 19:24
DNSCrypt configure/build output to be shared.
checking build system type... checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
@cpu
cpu / geoLookup.py
Last active December 10, 2015 04:48
Look up one or more IPs using the free Maxmind Geolookup API (http://www.maxmind.com/en/geoip_demo). Print the results in a plain format easily processed by script/human.
#!/usr/bin/env python
#
# geoLookup.py
# https://gist.github.com/4383810
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@cpu
cpu / nexus_watch.sh
Created November 13, 2012 19:28
Watch a URL for a specific phrase, use Pushover to alert with back-off.
#!/bin/bash
# Pushover API key
TOKEN="PUSHOVER_API_KEY_HERE"
# List of device keys to push to
KEYS=( KEY_ONE KEY_TWO )
# Url to monitor
URL=https://play.google.com/store/devices/details?id=nexus_4_16gb
@cpu
cpu / gist:4002482
Created November 2, 2012 16:34
Left Screen Tmux Setup
#!/bin/sh
# Create a new session called 'left' and open a ssh connection
tmux new-session -d -s left 'ssh danm_mud@pdox'
# Run 'resume' inside the ssh connection
tmux send-keys -t left:1 resume C-m
# Splice the screen in half by 50%
tmux splitw -h -p 50 -t left:1 'bash'
@cpu
cpu / post-commit.sh
Created May 2, 2012 21:27
SVN Post-commit hook for Pushover messages.
#!/bin/bash
#
# SVN Post-commit hook for the Pushover API
# Filters commits to only push when specific authors commit.
# Sends commit messages to one or more device KEYS.
# List of keys to push to
KEYS=( DEVICE_KEY_ONE DEVICE_KEY_TWO DEVICE_KEY_THREE )
# Which commit authors should generate push messages?