Skip to content

Instantly share code, notes, and snippets.

@heckj
heckj / gist:1187999
Created September 2, 2011 05:57
Get MAC addresses of all interfaces
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <ifaddrs.h>
#include <errno.h>
#include <net/if_dl.h>
@heckj
heckj / gist:2048157
Created March 16, 2012 02:23
shell script to auth against keystone essex
#!/bin/bash
set -e
[[ $1 == "-c" ]] && {
CONTINUE=yes
shift
}
URL=$1
USER=$2
@heckj
heckj / bp.sh
Created March 26, 2012 20:41 — forked from vishvananda/bp.sh
Script for backporting OpenStack branches to milestone-proposed
#!/usr/bin/env bash
# This is a little script to make backporting patches to milestone proposed.
# Instructions
# ------------
# Make sure that milestone-proposed exists and is up to date:
# git branch -D milestone-proposed
# git checkout -b milestone-proposed origin/milestone-proposed
# Grab the file and stick it in your <project> directory:
# curl -OL https://raw.github.com/gist/2206428/bp.sh
# Make sure the script is runnable:
@heckj
heckj / .cloudenvy
Created October 28, 2012 17:41
cloudenvy files for DevStack
cloudenvy:
keypair_name: heckj
keypair_location: /home/heckj/.ssh/id_dsa.pub
clouds:
env4:
os_auth_url: http://myopenstack.instance.com:5000/v2.0/
os_username: heckj
os_password: **********
os_tenant_name: heckj-project
#!/usr/bin/env bash
# Automatically installs swiftenv and run's swiftenv install.
# This script was designed for usage in CI systems.
git clone --depth 1 https://github.com/kylef/swiftenv.git ~/.swiftenv
export SWIFTENV_ROOT="$HOME/.swiftenv"
export PATH="$SWIFTENV_ROOT/bin:$PATH"
eval $(swiftenv init -)
if [ -f ".swift-version" ] || [ -n "$SWIFT_VERSION" ]; then
@heckj
heckj / directions.md
Created December 29, 2015 07:12 — forked from kacole2/directions.md
RackHD Docker Installation WIP

RackHD Docker Installation WIP

This assumes you have a machine available, created with Docker Machine and VirtualBox

Create the docker images

Go into each folder with the Dockerfile and create the image. ie cd on-tftp.

Create the image with the tag:

  1. docker build -t rackhd/on-tftp .
curl -H "Content-Type: application/json" -X POST --data @testnodeadd.json http://localhost:9090/api/1.1/nodes
results:
{
"name": "namenioveno",
"type": "compute",
"obmSettings": [
{
"service": "ipmi-obm-service",
@heckj
heckj / Environment_for_Developing_Kubernetes.md
Created December 16, 2016 22:39 — forked from whitlockjc/Environment_for_Developing_Kubernetes.md
Resources on creating a development environment for contributing to Kubernetes.

Environment for Developing Kubernetes

First and foremost, this is not a document on how to create an environment for developing applications targeting Kubernetes as its runtime. This document is to outline the steps required to create an environment for contributing to Kubernetes based on recently setting up both Linux and Mac development environments. This document is written as if you will be creating your development enivonment on OS X but just know that things are basically the same when on other OSes. Of course, the installation and configuration of these tools will changed based on which OS you're on, and possibly other things, but the gist is that in this guide when you see that tool X is required, you follow whatever steps to install tool X on your OS.

@heckj
heckj / update-swift-dev
Created January 26, 2017 18:55 — forked from ddunbar/update-swift-dev
This is the script I currently use on OS X to get a working "swift-dev.xctoolchain" out of a built Swift. It isn't designed to work for anyone but me, but it should be easy to adapt. I always run this after every build, and then use `TOOLCHAINS=swift-dev swift build` (etc) to use the development compiler.
#!/bin/sh
set -e
if [ -z "${CONFIGURATION}" ]; then
CONFIGURATION=debug
fi
# Create the development toolchain.
rm -rf ~/public/swift-project/build/Ninja-ReleaseAssert/swift-dev.xctoolchain
@heckj
heckj / gist:ccb3c34a046f40a86c80159ddf7979ce
Created January 29, 2017 00:52
error building swift-package-manager with 1/27/17 dev snapshot on linux
vagrant    ~  src  swiftpm  master  $  ./Utilities/bootstrap test
--- bootstrap: note: building stage1: /opt/swift-DEVELOPMENT-SNAPSHOT-2017-01-27-a-ubuntu16.04/usr/bin/swift-build-tool -f /home/vagrant/src/swiftpm/.build/.bootstrap/build.swift-build
Compile Swift Module 'POSIX' (15 sources)
Link PackageDescription
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "CoreFoundation.h"
^
/opt/swift-DEVELOPMENT-SNAPSHOT-2017-01-27-a-ubuntu16.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:60:10: note: in file included from /opt/swift-DEVELOPMENT-SNAPSHOT-2017-01-27-a-ubuntu16.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:60:
#include <CoreFoundation/CFBase.h>
^