Skip to content

Instantly share code, notes, and snippets.

View ianblenke's full-sized avatar
🎯
Focusing

Ian Blenke ianblenke

🎯
Focusing
View GitHub Profile
@ianblenke
ianblenke / fire_consul_event.sh
Created March 2, 2016 21:47
Firing consul events
#!/bin/bash
consul event -name 'Name of your event' -token=$CONSUL_TOKEN 'Some payload, you should probably use JSON here'
@ianblenke
ianblenke / consul_blocking_query.sh
Last active July 23, 2017 09:18
Consul blocking queries using X-Consul-Index via curl
#!/bin/bash
while true; do
INDEX_FILE="$(mktemp -t consul_index_XXX)"
CONSUL_INDEX=$(
curl -isL -H "X-Auth-Token: $CONSUL_TOKEN" \
-H 'X-Consul-Index: 1' \
--cacert /etc/consul/ssl/ca.cert "https://consul.service.consul:8500/v1/event/list?index=$CONSUL_INDEX&wait=1m" | \
tee "$INDEX_FILE" | \
grep X-Consul-Index | \
sed -e 's/^.*: *//' | \
@ianblenke
ianblenke / fix_submodule_remotes.sh
Created February 16, 2016 14:58
Fix submodule remotes to match .gitmodules
#!/bin/bash
find . -name '.gitmodules' | while read gitmodules; do
parent_path="$(echo $gitmodules | sed -e 's/.gitmodules//')"
git config -f $gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
gitmodules_url=$(git config -f $gitmodules --get "$url_key")
@ianblenke
ianblenke / mac_java.sh
Last active February 14, 2016 19:30
Scripted install of Java on Mac
#!/bin/bash
which brew || /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap caskroom/cask
# Install java
brew cask install java
# Install ant, and the Android NDK and SDK
brew install ant android-ndk android-sdk
@ianblenke
ianblenke / docker.ps1
Last active February 6, 2016 23:30
Installing docker, docker-machine, docker-compose, git, ssh, using chocolatey
# To run this in a Powershell, copy and paste this:
# Set-ExecutionPolicy Unrestricted ; icm $executioncontext.InvokeCommand.NewScriptBlock((New-Object Net.WebClient).DownloadString('https://gist.githubusercontent.com/ianblenke/a7654bcbbc2f4c83c0f3/raw'))
$coreEditions = @(0x0c,0x27,0x0e,0x29,0x2a,0x0d,0x28,0x1d)
$IsCore = $coreEditions -contains (Get-WmiObject -Query "Select OperatingSystemSKU from Win32_OperatingSystem" | Select -ExpandProperty OperatingSystemSKU)
cd $Env:USERPROFILE
Set-Location -Path $Env:USERPROFILE
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
@ianblenke
ianblenke / aws_ec2_interface_info.sh
Last active January 27, 2016 20:44
List network interface information
for mac in $(curl -qsL http://169.254.169.254/2014-11-05/meta-data/network/interfaces/macs/); do
printf "\n[$mac]"
curl -qsL http://169.254.169.254/2014-11-05/meta-data/network/interfaces/macs/$mac | while read line ; do
echo $line=$(curl -qsL http://169.254.169.254/2014-11-05/meta-data/network/interfaces/macs/$mac$line/);
done ;
done
diff -u rtpproxy-1.2.1/main.c rtpproxy-1.2.1-adv2/main.c
--- rtpproxy-1.2.1/main.c 2012-10-04 22:09:35.000000000 +0200
+++ rtpproxy-1.2.1-adv2/main.c 2013-07-18 10:54:02.000000000 +0200
@@ -98,7 +98,8 @@
fprintf(stderr, "usage: rtpproxy [-2fvFiPa] [-l addr1[/addr2]] "
"[-6 addr1[/addr2]] [-s path]\n\t[-t tos] [-r rdir [-S sdir]] [-T ttl] "
"[-L nfiles] [-m port_min]\n\t[-M port_max] [-u uname[:gname]] "
- "[-n timeout_socket] [-d log_level[:log_facility]]\n");
+ "[-n timeout_socket] [-d log_level[:log_facility]] "
+ "[-A addr1[/addr2]]\n");
@ianblenke
ianblenke / defaults.xml
Last active October 15, 2015 02:21
C:\tools\MinGW\var\lib\mingw-get\data\defaults.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile project="MinGW" application="mingw-get">
<!--
<repository uri="http://www.pllab.riec.tohoku.ac.jp/smlsharp/download/mingw32/%F.xml.lzma">
<package-list catalogue="smlsharp-package-list" />
</repository>
$Id: profile.xml,v 1.4 2010/08/24 20:02:10 keithmarshall Exp $
Written by Keith Marshall <[email protected]>
Copyright (C) 2009, 2010, MinGW Project
@ianblenke
ianblenke / kCTLanguageAttributeName.patch
Last active October 2, 2015 01:50
harfbuzz kCTLanguageAttributeName patch
diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc
index 13ba5d9..015d801 100644
--- a/src/hb-coretext.cc
+++ b/src/hb-coretext.cc
@@ -719,9 +719,9 @@ retry:
/* What's the iOS equivalent of this check?
* The symbols was introduced in iOS 7.0.
* At any rate, our fallback is safe and works fine. */
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
+/*#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090*/
@ianblenke
ianblenke / linphone-mac-build.sh
Last active October 10, 2015 01:22
Mac build environment preparation and compilation script for linphone
#!/bin/bash
# Author: Ian Blenke <[email protected]>
# Purpose: Prepare and build linphone for Mac
# Note: This script is idempotent, and should be runnable multiple times in succession without issue.
#export HOMEBREW_GITHUB_API_TOKEN=
set -ex
sudo perl -pi -e 's/^#%wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers