Skip to content

Instantly share code, notes, and snippets.

View Nixes's full-sized avatar

Callum Bryant Nixes

View GitHub Profile
@Nixes
Nixes / rust piston dependencies.md
Last active February 13, 2016 02:26
Fixing rust piston dependencies on windows

General instructions for fixing the dependencies required for piston on windows:

  • install msys2
  • configure msys2 database (look for some general config instructions)
  • install relevant libfreetype through pacman package manager
  • copy libfreetype .a files from mingw folder into rust lib folder, rename so that they follow libfreetype-6.a pattern
  • add C:\msys64\mingw64\bin to path
@Nixes
Nixes / Easy SQLite Gogs Installation for Ubuntu and Debian.md
Last active August 3, 2019 12:34
Easy SQLite Gogs Installation for Ubuntu and Debian

This is a tutorial that describes how to set up a private git (github) server for a smallish development team.

  • Download GOGS binary Zip File
  • Unzip to folder
  • Run: sudo apt-get install sqlite3
  • Run GOGS: ./gogs web
  • Goto install page: http://hostname:3000/install
  • Set to use sqlite3 as the database backend
  • Set USER to run as, preferrably not root if it will be internet facing.
  • Set Database file location (Make sure database file location is set to a folder where that same user has write permissions)
@Nixes
Nixes / WIFIBroadcast_log.md
Last active April 29, 2017 12:08
Experimental Log for WIFIBroadcast

TLDR

  • Gstreamer on the receiving end has terrible latency, DO NOT USE
  • Mplayer works great
  • Mplayer -nocache cuts 28ms

Good command line options

best fec settings -b 8 and -r 16 using 24M rate = basically indestructible video feed: -80 db is maximum reliable video feed signal so far

using -b 8 -r 4 -75db max

@Nixes
Nixes / libserialport example.c
Last active February 25, 2021 02:55
libserialport example
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <unistd.h> // for sleep function
#include <libserialport.h> // cross platform serial port lib
const char* desired_port = "COM8";
@Nixes
Nixes / gist:a5732e7440902991255281eea2ac467f
Created January 18, 2017 05:16
Commands to change git / github commit email and user references
git pull
git filter-branch -f --env-filter 'if [ "$GIT_AUTHOR_EMAIL" = "[email protected]" ]; then [email protected]; GIT_AUTHOR_NAME="Github_username"; GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL; GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; fi' -- --all
git push origin master --force
@Nixes
Nixes / gist:d39f7a795554c9dd7133e40178329c8a
Created February 19, 2017 07:05
Scarab OSD mini minimosd calibration
These were determined with a cheap crappy multimeter. Hopefully they save someone some time :)
Main voltage adjust: 211
Precision +- 0.5v
@Nixes
Nixes / Installing atom php-integrator on windows
Last active December 1, 2017 06:38
Installing atom php-integrator on windows
Installation is a bit harder than unix but absolutely worth it.
1) Install composer using windows installer
2) enable extension=php_pdo_sqlite.dll in php.ini
3) start atom and watch it fail to install php-integrator
4) run composer install --no-dev from core folder. something like C:\Users\<username>\.atom\packages\php-integrator-base\core\3.0.0
5) enjoy excellent php IDE
@Nixes
Nixes / update-gogs.sh
Last active May 6, 2018 02:45
Update gogs server, requires all paths to be set to gogs-data folder
echo "Downloading update"
curl -s -L https://github.com/gogits/gogs/releases/latest | egrep -o '/gogits/gogs/releases/download/[v][0-9\.]*\/raspi2_armv6.zip' | wget --base=http://github.com/ -i - -O gogs-latest.zip
echo "Stopping gogs service"
sudo service gogs stop
echo "Starting backup"
today=`date +%Y-%m-%d.%H:%M:%S`
zip -r gogs-backup-$today.zip gogs gogs-data
echo "Moving config to tmp directory"
cp -r gogs/custom gogs-custom-tmp
echo "Deleting original gogs folder"
@Nixes
Nixes / silex_to_symfony_routes_migrate.php
Last active February 4, 2020 04:17
Script that generates a symfony compatible routes.php file from an existing silex application for migration, including middlewares
#!/usr/bin/env php
<?php
/***
* Dumps routes from silex route registation to yaml file for use with symfony
run with php silex_to_symfony_routes_migrate.php > ../app/routes.php
*/
use Silex\Application;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCompiler;
use Symfony\Component\Yaml\Yaml;
@Nixes
Nixes / convert-tensorflow-model-to-tensorboard-logs.py
Created March 9, 2020 23:44
convert tensorflow model to tensorboard logs
# last tested with tensorflow 2.1.0
import tensorflow as tf
LOG_DIR = 'logs' # The path where you want to save tensorboard events
tf.compat.v1.disable_eager_execution()
with tf.compat.v1.Session() as sess:
model_filename = 'frozen_inference_graph.pb' # your model path
with tf.compat.v1.gfile.FastGFile(model_filename, 'rb') as f: