Skip to content

Instantly share code, notes, and snippets.

echo ""
echo "Usage: $0 -a parameterA -b parameterB -c parameterC"
echo -e "\t-a Description of what is parameterA"
echo -e "\t-b Description of what is parameterB"
echo -e "\t-c Description of what is parameterC"
exit 1 # Exit script after printing help
pacozaa /
Created Oct 28, 2016
Parses a NORAD two line element set into a Python dictionary.
def parse_tle_number(tle_number_string):
split_string = tle_number_string.split('-')
if len(split_string) == 3:
new_number = '-' + str(split_string[1]) + 'e-' + str(int(split_string[2])+1)
elif len(split_string) == 2:
new_number = str(split_string[0]) + 'e-' + str(int(split_string[1])+1)
elif len(split_string) == 1:
new_number = '0.' + str(split_string[0])
raise TypeError('Input is not in the TLE float format')
pacozaa /
Created Oct 24, 2016 — forked from xrstf/
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for and


For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

pacozaa /
Created Jun 5, 2016 — forked from dulichan/
COM port printer writing java example
package app.posmachine.machine;
import java.util.Enumeration;
import javax.comm.CommPortIdentifier;
import javax.comm.SerialPort;
public class PosPrinter {
pacozaa / compass+pid+motors.js
Created Mar 22, 2016
Compass PID controller integration with motors using
View compass+pid+motors.js
var five = require('johnny-five');
var board = new five.Board();
var motorRight;
var motorLeft;
var compass;
var PID = require('pid-controller');
var heading = 0;
var headingSetpoint = 0;
var Kp = 5;
pacozaa / gist:e625ac9b1f4447c8e7df
Created Feb 21, 2016 — forked from fajrif/gist:1265203
git clone specific tag
View gist:e625ac9b1f4447c8e7df
git clone <repo-address>
git tag -l
git checkout <tag-name>
git branch -D master
git checkout -b master
pacozaa / gist:78b602244990cd261523
Created Jan 31, 2016 — forked from jonleighton/base64ArrayBuffer.js
Encode an ArrayBuffer as a base64 string
View gist:78b602244990cd261523
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then
// use window.btoa' step. According to my tests, this appears to be a faster approach:
function base64ArrayBuffer(arrayBuffer) {
var base64 = ''
var encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
var bytes = new Uint8Array(arrayBuffer)
var byteLength = bytes.byteLength
pacozaa / nodejs-tcp-example.js
Created Nov 19, 2015 — forked from tedmiston/nodejs-tcp-example.js
Node.js tcp client and server example
View nodejs-tcp-example.js
In the node.js intro tutorial (, they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
var net = require('net');