Skip to content

Instantly share code, notes, and snippets.

Avatar

/v\atthew L Daniel mdaniel

View GitHub Profile
View KUBEADM_591.sh
set -ex
hostname -f > /etc/hostname
hostname -F /etc/hostname
depmod -a || true
modprobe -v ip6_tables
for i in ip_vs ip_vs_rr ip_vs_wrr ip_vs_sh; do
modprobe -v $i
done
if ! type docker >/dev/null 2>&1; then
View .ci__script__cd.sh
#! /usr/bin/env bash
image_name="get the ECR image name through tomfoolery"
export JOB_Q='arn:our-ci-cd-queue'
python -u queue_worker.py &
worker_pid=$!
trap "kill -INT $worker_pid" EXIT
export TASK_ARN='arn:a-ci-cd-specific-task'
python -u queue_submit.py -<<DOIT
@mdaniel
mdaniel / CMakeLists.txt
Created Jan 1, 2018
CMake descriptor for PuTTY so CLion can work with it; It's not perfect, but it builds working executables, so there's that
View CMakeLists.txt
CMAKE_MINIMUM_REQUIRED(VERSION 3.9.0)
CMAKE_POLICY(VERSION 3.9)
SET(PUTTY_VERSION "0.70.20180101")
PROJECT(putty VERSION ${PUTTY_VERSION} LANGUAGES C)
FIND_PROGRAM(PERL_EXE
NAMES perl perl.exe
DOC "location of an executable Perl used to generate files within the project")
OPTION(NO_IPV6 [=[
@mdaniel
mdaniel / Vagrantfile
Last active Dec 22, 2017
Build [asuswrt-merlin](https://github.com/RMerl/asuswrt-merlin#readme) using Vagrant. This is just works-for-me, and not an officially supported mechanism
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# the resulting image won't be 64 bit,
# so adding that into the mix just makes life painful
config.vm.box = "ubuntu/trusty32"
config.vm.boot_timeout = 3600
config.vm.provider "virtualbox" do |vb|
@mdaniel
mdaniel / glide.yaml
Created Dec 6, 2017
Issue daemon-reload and install systemd unit files from golang
View glide.yaml
package: systemd-installer
import:
- package: github.com/coreos/go-systemd
version: v15
- package: github.com/godbus/dbus
version: v4.0.0
@mdaniel
mdaniel / docker2rc.py
Created Jan 29, 2016
Mostly convert the output of "docker inspect" into a Kubernetes ReplicationController
View docker2rc.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import json
import re
import sys
import yaml
@mdaniel
mdaniel / gradle-2.x.patch
Created Jan 13, 2016
Gradle patches that permit the use of a jarsigned plugin (as well as fixing two NPEs)
View gradle-2.x.patch
This patch was tested against every 2.x release tag in https://github.com/gradle/gradle.git and applies cleanly to all of them,
except for the following error message:
> warning: inexact rename detection was skipped due to too many files.
> warning: you may want to set your merge.renamelimit variable to at least 4384 and retry the command.
diff --git a/subprojects/core/src/main/groovy/org/gradle/api/internal/AsmBackedClassGenerator.java b/subprojects/core/src/main/groovy/org/gradle/api/internal/AsmBackedClassGenerator.java
index abbb13b..6e9f26d 100644
--- a/subprojects/core/src/main/groovy/org/gradle/api/internal/AsmBackedClassGenerator.java
+++ b/subprojects/core/src/main/groovy/org/gradle/api/internal/AsmBackedClassGenerator.java
@mdaniel
mdaniel / __main__.py
Created Jan 6, 2016
Driver for https://github.com/Roguelazer/onepasswordpy.git; ```mkdir onepassword/cli; touch onepassword/cli/__init__.py``` then put this `__main__.py` into `onepassword/cli` and invoke it with `python -m onepassword.cli -k path/to/my/keystore --list`
View __main__.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import json
import sys
from getopt import getopt
from getpass import getpass
# this is a factory method that one can find in "keychain.patch" below
from ..keychain import load_keychain
@mdaniel
mdaniel / ec2-fingerprint-key.sh
Created Jan 5, 2016
Create EC2 fingerprints for local PEM files
View ec2-fingerprint-key.sh
#! /bin/sh
# q.v. http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#verify-key-pair-fingerprints
for i in "$@"
do
echo "== $i =="
echo " if *AWS* generated the key, it's fingerprint will be:"
openssl pkcs8 -in "$i" -inform PEM -outform DER -topk8 -nocrypt | openssl sha1 -c
echo " if *you* generated the key, it's fingerprint will be:"
openssl rsa -in "$i" -pubout -outform DER 2>/dev/null | openssl md5 -c
echo