Skip to content

Instantly share code, notes, and snippets.

View hh's full-sized avatar

Hippie Hacker hh

View GitHub Profile
@hh
hh / spacemacs.el
Created May 29, 2017 16:42
hhspacemacs.el
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory

We modiified bento to support vsphere : https://github.com/ii/bento/tree/vsphere

You need to set some variables to export to vsphere:

#Path is to a local build from source of commit 37fe7647279ed79ec86020b7852e08f04b079dcc
export PATH=/tmp/chrisgo/src/github.com/mitchellh/packer/bin/packer:$PATH
export VI_USERNAME=DOMAIN\\XXXXX.cmcclimans
export VI_PASSWORD=XXXXXX
export VI_HOST=vsphere.MY.com
$ MACHINE_DRIVER=openstack docker-machine create rancher
Running pre-create checks...
Creating machine...
(rancher) Creating machine...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...

Detecting the provisioner...
@hh
hh / creds
Last active December 3, 2015 21:27
creds and winrm and rdp using fingerprints from ec2 via chef-provisoning-aws
$ cat ./bin/creds
#!/usr/bin/env bash
#JSON=$(knife node show $* -a chef_provisioning.reference -Fjson)
#eval $(echo $JSON | jq -r '.[]["chef_provisioning.reference"]' |grep -Ev '{|}' |sed 's/\s*"\([^"]*\)": /\1=/')
# sets winrm_ssl_thumbprintprint and others at that level
# use this later
export NODE_NAME="$*"
INSTANCE_ID=$(aws ec2 describe-instances --filters "Name=tag:Name,Values=$NODE_NAME" | jq .Reservations[0].Instances[0].InstanceId | sed -e 's/\"//g')
@hh
hh / _1.mkd
Last active November 18, 2015 20:28
Trying to get connman to talk to ofono to talk to my Sierra Wireless card => Verizon```;
@hh
hh / hardened_winrm_ssl_aws_windows.rb
Created October 1, 2015 16:19
Winrm over SSL reusing rdp certificate
require 'chef/provisioning/aws_driver'
require 'byebug'
current_dir = File.dirname(__FILE__) # to get relative files... encrypted databag
with_chef_server "https://api.chef.io/organizations/#{ENV['CHEF_ORG']}",
:client_name => Chef::Config[:node_name],
:signing_key_filename => Chef::Config[:client_key]
setup_winrm_ssl_user_data = <<EOD
<powershell>
@hh
hh / Gemfile
Last active September 18, 2015 11:14
chef-provisioning-aws-1.4.0 - Aws::EC2::Errors::InvalidParameterValue: Invalid BASE64 encoding of user data
source 'https://rubygems.org'
gem 'berkshelf'
gem 'kitchen-ec2'
gem 'knife-ec2'
gem 'byebug'
gem 'chef-provisioning', '=1.4.0'
gem 'chef-provisioning-aws', '=1.4.0'
gem 'chef', '=12.4.1'
@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 / github_authorized_keys.rb
Created July 7, 2015 17:42
.ssh/authorized_keys from github user list
file '/root/.ssh/authorized_keys' do
content github_users.map do |u|
Chef::HTTP.new('https://github.com').get("/#{u}.keys") + " #{u}"
end.join("\n")
end