Skip to content

Instantly share code, notes, and snippets.

John Ott jbott

Block or report user

Report or block jbott

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jbott
jbott / proxy.sh
Created May 29, 2013
Automatically create a ssh socks proxy and turn it on in network settings
View proxy.sh
#!/bin/sh
#######################################
#Remote settings
USER=USERNAME
HOST=HOSTNAME
PORT=22
#Local settings
INAME=Wi-Fi
LPORT=8080
@jbott
jbott / download.sh
Created Dec 7, 2013
Script to update minecraft server to latest version, either snapshot or release
View download.sh
#!/bin/sh
# Can be snapshot or release
DEFAULTREVISION=release
# Pull out latest snapshot version
REVISION=${1-$DEFAULTREVISION}
REGEX="(?<=$REVISION\": \").*?[^\\\\](?=\")"
VERSION=`curl -silent "http://s3.amazonaws.com/Minecraft.Download/versions/versions.json" | grep -Po "$REGEX"`
if [ "$VERSION" = "" ]; then
echo "Invalid Version"; exit
@jbott
jbott / add_metro_pl_models.lua
Created Jul 12, 2014
MetroPlayerModels Garry's Mod
View add_metro_pl_models.lua
AddCSLuaFile()
player_manager.AddValidModel("ranger1", "models/metro2033/nikout/ranger1.mdl")
player_manager.AddValidModel("ranger1_pl", "models/metro2033/nikout/player/ranger1.mdl")
player_manager.AddValidModel("ranger2_pl", "models/metro2033/nikout/player/ranger2.mdl")
@jbott
jbott / mqtt-tree.py
Last active Aug 29, 2015
MQTT Tree in python, very rough
View mqtt-tree.py
#pip install paho-mqtt
#pip install git+https://github.com/mbr/asciitree.git
import asciitree
import paho.mqtt.client as mqtt
import sys
from collections import defaultdict
from time import sleep
tr = asciitree.LeftAligned()
@jbott
jbott / init.sh
Created Jun 19, 2015
Minecraft init script for tmux
View init.sh
#!/bin/sh
# Go to script directory
BINDIR=$(dirname "$(readlink -fn "$0")")
cd "$BINDIR"
### Configuration ###
XMS="1G"
XMX="1G"
JAR="minecraft_server.jar"
JAVA_BIN="../java/jdk1.8.0_45/bin"
View VoltageRead.ino
#define READ_COUNT 5
float volts[READ_COUNT];
void setup()
{
Serial.begin(9600);
}
void loop()
@jbott
jbott / appify.sh
Last active Aug 29, 2015 — forked from advorak/appify.sh
appify — create the simplest possible Mac app from a shell script (adds an application icon) (Working with ZSH with spaces in the name)
View appify.sh
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF
appify v3.0.0 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
View github_organization_clone.sh
#!/bin/bash
#
# How this works:
# Curl -> Grabs the organization repos from the github api
# grep -> Filter to only clone_url's
# grep -> Select the url from that line
# xargs -> For each line, run git clone [line]
curl -s "https://api.github.com/orgs/${1}/repos?per_page=200" | grep clone_url | grep -oh "https.*git" | xargs -L1 git clone
@jbott
jbott / sklearn_iris_tensorflow.py
Created Nov 12, 2015
Scikit-learn iris data set classification using TensorFlow
View sklearn_iris_tensorflow.py
import sklearn
import tensorflow as tf
from sklearn import datasets
iris = datasets.load_iris()
# Convert targets to one hot
targets_onehot = [0] * len(iris.target)
for i,target in enumerate(iris.target):
targets_onehot[i] = [0] * 3
@jbott
jbott / docker-container@.service
Last active Feb 9, 2016
A docker container systemd service file. This has no support for container dependencies.
View docker-container@.service
[Unit]
Description=Docker %i container
Requires=docker.service
After=docker.service
[Service]
Restart=always
ExecStart=/usr/bin/docker start -a %I
ExecStop=/usr/bin/docker stop -t 2 %I
You can’t perform that action at this time.