Skip to content

Instantly share code, notes, and snippets.

View hh's full-sized avatar

Hippie Hacker hh

View GitHub Profile
@hh
hh / build-kube-e2e.sh
Last active April 12, 2018 02:48 — forked from ethernetdan/build-kube-e2e.sh
Build Docker image of Kubernetes E2E tests
#!/bin/bash -x
set -euo pipefail
echo "Building conformance image..."
echo
APT_PACKAGES="rsync"
# build docker image of repository
docker build -t "${IMAGE_NAME}:${IMAGE_TAG}" - <<EOF
FROM golang:1.8
@hh
hh / .zshrc
Last active August 29, 2015 14:26 — forked from SlexAxton/.zshrc
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@hh
hh / gist:e4923e0bd67ba4741b7a
Last active August 29, 2015 14:25 — forked from tranthamp/gist:2721326
D-Bus and Connman notes
# Connman Technology API examples: (Object Path: /net/connman/technology/<wifi/ethernet>, Interface: net.connman.Technology)
# GetProperties
dbus-send --system --dest=net.connman --print-reply /net/connman/technology/wifi net.connman.Technology.GetProperties
# Scan
dbus-send --system --dest=net.connman --print-reply /net/connman/technology/wifi net.connman.Technology.Scan
# Disable/Enable wifi
dbus-send --system --dest=net.connman --print-reply /net/connman/technology/wifi net.connman.Technology.SetProperty string:Powered variant:boolean:true
@hh
hh / x.output
Last active December 11, 2015 07:59 — forked from taylor/x.rb
aoeuaoeu
😱 Something terrible happened! 😱
#!./bin/knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
user@laptop:~$ lsb_release  -a
No LSB modules are available.
Distributor ID:  Ubuntu
Description:	Ubuntu 12.04.1 LTS
Release:	12.04
Codename:	precise

user@laptop:~$ certutil -d ~/.mozilla/firefox/fk9tyf55.default -L
require 'fileutils'
class Chef
class Provider
class File
class Copy < Chef::Provider::File
def content_differs
checksum(@current_resource.path) != checksum(@new_resource.content)
end
require 'openssl'
require 'base64'
publishfile = Dir.glob('*publishsettings').first
publishxml = open(publishfile).read
cert_base64 = /(?<=ManagementCertificate=\")(?<cert>.*)\">/.match(publishxml)['cert']
cert_pks12 = Base64.decode64(cert_base64)
cert = OpenSSL::PKCS12.new cert_pks12
#cert.certificate
#=> #<OpenSSL::X509::Certificate subject=/CN=Windows Azure Tools,
@hh
hh / gist:1500073
Created December 20, 2011 03:16 — forked from taylor/gist:1500071
faked shared console session
So I will type a command in the comment. You reply in the next comment.
So now I can edit it more.
@hh
hh / example.yml
Created December 14, 2011 23:31 — forked from mattray/example.yml
nodes:
- windows_winrm windowswinrmhost windowshost2 windowshost3:
- role[webserver],role[base]
- -x Administrator -P 'super_secret_password'
- windows_ssh windowssshhost sshhost2 sshhost4:
- role[foobar]
- -x 'Administrator' -P barpass -d windows-preinstalled