Skip to content

Instantly share code, notes, and snippets.

View xeb's full-sized avatar

Mark Kockerbeck xeb

View GitHub Profile
@xeb
xeb / Vagrantfile
Last active July 12, 2016 00:32
Basic Vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
#config.vm.box = "bento/centos-7.2"
#config.vm.box_url = "https://atlas.hashicorp.com/bento/boxes/centos-7.2"
config.vm.network "forwarded_port", guest: 5000, host: 5000
config.vm.synced_folder "scripts", "/home/vagrant/scripts"
@xeb
xeb / Dockerfile
Created July 10, 2016 16:38
TensorFlow Serving Issue 114
# Dockerfile to reproduce Issue 114 for TensorFlow Serving
# https://github.com/tensorflow/serving/issues/114
# Base Dockerfile from: https://github.com/tensorflow/serving/blob/master/tensorflow_serving/tools/docker/Dockerfile.devel
# To demonstrate this, just build the container & then run it:
# $ docker build -t tfserv_114 .
# $ docker run -it tfserv_114
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y \
@xeb
xeb / docker_cheatseet.md
Created July 10, 2016 05:40
Docker Cheatsheet

Remove unused images

docker rmi $(docker images --filter "dangling=true" -q --no-trunc)

@xeb
xeb / download.sh
Created December 22, 2013 04:40
Download all URLs from a file
while read p; do
wget $p
done < urls
@xeb
xeb / gist:7924287
Created December 12, 2013 07:19
Reset homebrew
cd `brew --repository`
git reset --hard HEAD
brew update
Sometimes the above doesn't work. In that case, do
cd `brew --repository`
git reset --hard origin/master
brew update
package main
import (
"fmt"
"io"
"net"
"os"
)
func main() {
@xeb
xeb / gist:6257472
Last active December 21, 2015 05:29
Marks system navigation
export MARKPATH=$HOME/.marks
function jump {
cd $MARKPATH/$1 2> /dev/null || echo "No such mark: $1"
}
function mark {
mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1
}
function unmark {
rm -i $MARKPATH/$1
}
@xeb
xeb / xamarin_tree_clean.py
Created July 2, 2013 05:42
A quick script to clean the hierarchy of .xib files as they related to .cs and .designer.cs files
#!/usr/bin/python
import sys, os
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import Element
namespace = "http://schemas.microsoft.com/developer/msbuild/2003"
def find_files_with_ext(extension):
return [f for f in os.listdir('.') if os.path.isfile(f) and os.path.splitext(f)[1] == extension]
@xeb
xeb / xamarin_switch.py
Last active December 19, 2015 03:28
A quick script to automatically change the Xamarin Studio Apple SDK from Xcode4 (for iOS 5.1 development) to Xcode5 (for iOS 7.0 development). The script will also automatically update the first (and only) csproj in the current directory and finally launch Xamarin Studio with the desired configuration.
#!/usr/bin/python
import sys, os, re
import getpass, getopt
import xml.etree.ElementTree as ET
pref_xcode4_loc = "/Applications/Xcode.app"
pref_xcode5_loc = "/Applications/Xcode5-DP.app"
pref_loc = "/Users/%s/Library/Preferences/XamarinStudio-4.0/MonoDevelopProperties.xml" % (getpass.getuser())
pref_key = "MonoDevelop.MacDev.AppleSdkRoot"
@xeb
xeb / install-tensorflow.sh
Created December 17, 2015 18:14
TensorFlow Install on Mac OS X with sudo PIP and Six pre-installed
#!/bin/bash
sudo -H pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py2-none-any.whl --ignore-installed six
# Modified install command from: https://www.tensorflow.org/versions/master/get_started/os_setup.html
# See: https://github.com/pypa/pip/issues/3165
# Because Apple has preinstalled the dependency Six that cannot be removed
# Some of the errors I experienced were the following:
# [Errno 1] Operation not permitted: '/tmp/pip-BriGIp-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib