Skip to content

Instantly share code, notes, and snippets.

@ksexton
ksexton / README
Last active November 18, 2023 16:01 — forked from jmatsushita/README
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
# Inspired by https://github.com/malob/nixpkgs I highly recommend looking at malob's repo for a more thorough configuration
#
# Some people are coming directly to this Gist from search results and not the original post[1]. If that sounds like you, you should also know there is a video[2] that accompanies this.
#
# [1] https://discourse.nixos.org/t/simple-workable-config-for-m1-macbook-pro-monterey-12-0-1-with-nix-flakes-nix-darwin-and-home-manager/16834
# [2] https://www.youtube.com/watch?v=KJgN0lnA5mk
#
# Let's get started
@ksexton
ksexton / _aws_golang_examples.md
Created November 1, 2018 19:21 — forked from eferro/_aws_golang_examples.md
golang aws: examples

AWS Golang SDK examples

@ksexton
ksexton / altnetworking.sh
Created April 14, 2017 23:04 — forked from level323/altnetworking.sh
Run a command inside a customised networking environment (using cgroups)
#!/bin/bash
# === INFO ===
# altnetworking.sh
# Description: Run the specified application in a custom networking environment.
# Uses cgroups to run process(es) in a network environment of your own choosing (within limits!)
VERSION="0.1.0"
# Author: John Clark
# Requirements: Debian 8 Jessie (plus iptables 1.6 from unstable)
#
@ksexton
ksexton / chefdk-rvm.sh
Created January 31, 2017 17:21 — forked from asnodgrass/chefdk-rvm.sh
Making ChefDK work with RVM
# Assumption: Mac OS X
CHEFDK="/opt/chefdk/embedded"
CHEFDK_USER="$HOME/.chefdk/gem/ruby/2.1.0"
RVM_GEMS="$HOME/.rvm/gems"
RVM_RUBIES="$HOME/.rvm/rubies"
RUBY_NAME="ext-chefdk-ruby"
mkdir -p $RVM_RUBIES/$RUBY_NAME
ln -s $CHEFDK/bin $RVM_RUBIES/$RUBY_NAME
@ksexton
ksexton / InstallBerkshelfOnCygwin.md
Created December 10, 2015 16:43 — forked from DQNEO/InstallBerkshelfOnCygwin.md
How to Install Berkshelf version3 on Cygwin 64bit

How to Install Berkshelf version3 on Cygwin 64bit

Installation of Berkshelf v3 on Cygwin is known to be very diffcult, but I have finally found the way. 😄

You can successfully install it by following the procedure below.

(As at 2014/6/8, v3.1.3 is available)

Why is it so difficult ?

@ksexton
ksexton / trackmac.rb
Created September 15, 2013 14:36 — forked from gerad/trackmac.rb
require 'rubygems'
require 'bundler/setup'
require 'appscript'
# http://stackoverflow.com/questions/480866/get-the-title-of-the-current-active-window-document-in-mac-os-x
while true
frontmost = Appscript.app('System Events').application_processes.get.select{ |a| a.frontmost.get }.first
if frontmost
puts frontmost.name.get
if frontmost.windows.count > 0
c2950#sh interfaces FastEthernet 0/1 status
Port Name Status Vlan Duplex Speed Type
Fa0/1 --> to end-user wo connect 1000 auto auto 10/100BaseTX
c2950#sh etherchannel 1 summary
Flags: D - down P - in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
# in /etc/puppet/hieradata/
---
someclass::setting1: 'blah'
someclass::another_setting: 1234
someclass::array_setting:
- 'oneval'
- 'twoval'
- 'redval'
- 'blueval'
@ksexton
ksexton / README.md
Created August 14, 2012 14:43 — forked from filler/README.md
RHEL 6.3 veewee templates for vagrant use

RHEL 6.3 veewee templates for vagrant use

These templates can be used to feed to veewee to spin up an el6 basebox for use with vagrant.

There are some coded values in definition.rb and ks.cfg which point at Yale-ishness. Amend to point at local RHEL iso/yum repo.

Built successfully with veewee 0.2.3, vagrant 1.0.3, Virtualbox 4.1.18.

Config Management

@ksexton
ksexton / jappo.pl
Created March 16, 2012 19:40 — forked from mrdaemon/jappo.pl
use strict;
use vars qw($VERSION %IRSSI);
use Irssi;
$VERSION = '0.01';
%IRSSI = (
authors => 'Alexandre Gauthier',
contact => 'alex@underwares.org',