Skip to content

Instantly share code, notes, and snippets.

Aki Tuomi cmouse

Block or report user

Report or block cmouse

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sendchange.py
#!/usr/bin/env python
import requests
import subprocess
import sys
PRIVATE_TOKEN="<redacted>"
def get_branch_head(repo, branch):
repo = repo.replace("/","%2f")
@cmouse
cmouse / sendchange.py
Created Aug 27, 2017
Sending a change to buildbot
View sendchange.py
#!/usr/bin/env python
import requests
import subprocess
import sys
PRIVATE_TOKEN="<removed>"
def get_branch_head(repo, branch):
repo = repo.replace("/","%2f")
@cmouse
cmouse / decrypt.rb
Created Aug 21, 2017
Analyze / decrypt dovecot lib-dcrypt stream
View decrypt.rb
#!/usr/bin/env ruby
require 'openssl'
require 'optparse'
def read_oid(stream)
## read length
tmp = stream.read(2)
if tmp[1].ord & 0x80 != 0
# read bit more
@cmouse
cmouse / openswan-to-rsa.c
Created Jul 12, 2016
Convert OpenSwan key to RSA key
View openswan-to-rsa.c
#include <stdio.h>
#include <openssl/rsa.h>
#include <openssl/bn.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
int main(void) {
BIGNUM *bn;
RSA *rsa = RSA_new();
bn = BN_new();
View import.rb
#!/usr/bin/env ruby
key = File.read("input.der").force_encoding('ascii-8bit')
# determine key size
File.open("ssl-parameters.dat", "wb") do |f|
f.write [4096, key.size].pack 'll'
f.write key
f.write [0].pack 'l'
end
View ciro.lua
---
--- Domain blacklist/override - LUA evaluation script
---
--- v0.1 (20141025) - Ciro Iriarte <ciro.iriarte@gmail.com>
--- - First release
--- v0.2 (20141029) - Ciro Iriarte <ciro.iriarte@gmail.com>
--- - Added verification for *.arpa requests, exit inmediatly
--- - Added support for "domain ending in", with *.badboy.com
--- - ToDo: cleanup duplicated code?
--- v0.3 (20141215) - Ciro Iriarte <ciro.iriarte@gmail.com>
@cmouse
cmouse / post-update
Last active Aug 29, 2015
NLNOG Ring key management
View post-update
#!/bin/sh
set -o errexit
git archive --format=tar HEAD | tar -Ox --wildcards '*.key' > $HOME/ssh-keys.new
if [ -s $HOME/ssh-keys.new ]; then
cat > $HOME/ssh-keys.tmp <<EOF
## THIS FILE IS AUTOGENERATED FROM GIT
## Do not edit by hand - instead add your key
View check-v4.rb
#!/usr/bin/ruby
require 'socket'
# our IP here
@target = 'x.212'
# bind these to lo using ip addr add x.x.x.x/32 dev lo
@routes = %w[ x.245/32 x.8/32 x.6/32 x.22/32 x.7/32 ]
@sockfile = '/var/run/pdns_recursor.controlsocket'
@state = :announce
View tkey.cc
#include "config.h"
#include "namespaces.hh"
#include "dns.hh"
#include "dnsparser.hh"
#include "dnspacket.hh"
#include "dnsrecords.hh"
#include "tkey.hh"
#include <boost/foreach.hpp>
#include <boost/shared_ptr.hpp>
View gist:27c2af929d0e3c31d24b
require 'rubygems'
require 'bgp4r'
require 'yaml'
require 'observer'
require 'daemons'
include BGP
# Set this where your config file is
configFile = "/etc/bgp-daemon.conf"
You can’t perform that action at this time.