Skip to content

Instantly share code, notes, and snippets.

@heckj
heckj / fabfile.py
Created November 15, 2009 05:19 — forked from kogakure/fabfile.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabfile for Django
------------------
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle)
several additions, corrections and customizations, too
@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 / 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:
#!/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 .
@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:32f559e9665a5e4a074b02a99c4dfc7d
Created July 30, 2017 23:16 — forked from jessesquires/gitsl.sh
git "smartlog" / "pretty log"
git log --graph --pretty=format:'commit: %C(bold red)%h%Creset %C(red)<%H>%Creset %C(bold magenta)%d %Creset%ndate: %C(bold yellow)%cd %Creset%C(yellow)%cr%Creset%nauthor: %C(bold blue)%an%Creset %C(blue)<%ae>%Creset%n%C(cyan)%s%n%Creset'
@heckj
heckj / kubernetes_and_docker_install_xenial.sh
Last active December 25, 2018 20:41 — forked from indykish/dockerinstall_xenial.sh
Install Docker 1.12.6 on Ubuntu Xenial 16.04.4 x64
# Install Docker on Xenial 16.04.1 x64
# Ref https://docs.docker.com/engine/installation/linux/ubuntulinux/
# No interactive for now.
export DEBIAN_FRONTEND=noninteractive
# Update your APT package index.
sudo apt-get -y update
# Update package information, ensure that APT works with the https method, and that CA certificates are installed.
sudo apt-get -y install apt-transport-https ca-certificates
# Add the new GPG key.
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
@heckj
heckj / attributes.rb
Created April 20, 2019 21:33 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'