Skip to content

Instantly share code, notes, and snippets.

@nickludlam
nickludlam / opi_plus_dmesg.txt
Created May 5, 2015 16:55
Orange Pi Plus dmesg
[ 0.000000] Booting Linux on physical CPU 0
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.4.39 (allwinner@steven) (gcc version 4.6.3 20120201 (prerelease) (crosstool-NG linaro-1.13.1-2012.02-20120222 - Linaro GCC 2012.02) ) #20 SMP PREEMPT Sat May 2 16:01:42 HKT 2015
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: sun8i
[ 0.000000] Ignoring tag cmdline (using the default kernel command line)
[ 0.000000] cma: CMA: reserved 256 MiB at 70000000
[ 0.000000] Memory policy: ECC disabled, Data cache writealloc
[ 0.000000] On node 0 totalpages: 262144
@nickludlam
nickludlam / gist:5e306a7abdd546dfae0d
Created May 8, 2015 17:41
Example ship for pimpmyship.com
'Core Dynamics' => {
"Eagle Mk. 2" => {
stats: { value: 44800, mass: 50, shields: 60, armour: 40, top_speed: 240, boost_speed: 350, landing_pad_size: 1, manoeuvrability: 10, crew: 1 },
common_internal_sizes: { reactor: 2, thrusters: 3, fsd: 3, env: 1, pc: 2, sensor: 2, fuel: 2 }, # Sizes of each ship slot
hardpoints: [1, 1, 1], # Size of hardpoint. 1 = small, 2 = medium, 3 = large, 4 = huge
utilities: 1, # Number of utility slots
internal_compartments: [3,2,1], # Size of each Internal Compartment, biggest to smallest
default_modules: ["shield_3e", "cargo_2", "bds"], # Default modules in each internal compartment defined above, 'nil' for none
bulkhead_costs: [26880, 90048, 140089, 150393]
}
@nickludlam
nickludlam / fix_metal_api_validation.rb
Last active July 25, 2021 12:09
Fix Metal API validation in an auto-generated XCode project
#!/usr/bin/env ruby
require 'xcodeproj' # Requires https://github.com/CocoaPods/Xcodeproj
scheme = Xcodeproj::XCScheme.new("Unity-iPhone.xcodeproj/xcshareddata/xcschemes/Unity-iPhone.xcscheme")
scheme.launch_action.xml_element.attributes['enableGPUValidationMode'] = "1"
scheme.save!
@nickludlam
nickludlam / eddn_simple_client.rb
Last active May 1, 2017 21:45
Testing EDDN with Ruby
require "rbzmq"
require "zlib"
require "thread"
require "json"
$queue = Queue.new
should_run = true
EDDN_RELAY = 'tcp://eddn-relay.elite-markets.net:9500'
EDDN_TIMEOUT = 60000
@nickludlam
nickludlam / hutton_helper.conf
Created August 31, 2017 21:04
Hutton Helper upstart script
description "hutton_helper"
version "1.0"
author "Entarius Fusion"
env LANG=en_US.UTF-8
env APP_ROOT=/home/forthemug/ruby/
start on startup
stop on shutdown
respawn
Shader "Custom/XRayTransparency"
{
Properties
{
_RimColor ("Rim Color", Color) = (0.26,0.19,0.16,0.0)
_RimPower ("Rim Power", Range(0.5,8.0)) = 3.0
}
SubShader
{
@nickludlam
nickludlam / travelling_trucker.py
Last active January 31, 2021 02:37
Looking at how to optimise the Travelling Trucker problem for The Hutton Orbital Truckers group
import sys
import time
import json
import random
import operator
from enum import Enum
import vector
import networkx as nx
@nickludlam
nickludlam / source.json
Created January 26, 2021 21:21
The current Hutton owned systems
{"Narenses":{"x":-1.15625,"y":-11.03125,"z":21.875},"George Pantazis":{"x":-12.09375,"y":-16,"z":-14.21875},"Barnards Star":{"x":-3.03125,"y":1.375,"z":4.9375},"Hill Pa Hsi":{"x":29.46875,"y":-1.6875,"z":25.375},"Epsilon Indi":{"x":3.125,"y":-8.875,"z":7.125},"Haghole":{"x":-5.875,"y":0.90625,"z":23.84375},"Ross 671":{"x":-17.53125,"y":-13.84375,"z":0.625},"Karsinanari":{"x":-29.875,"y":-46.1875,"z":-8.03125},"LP 532-81":{"x":-1.5625,"y":-27.375,"z":-32.3125},"Wolf 1481":{"x":5.1875,"y":13.375,"z":13.5625},"Wolf 25":{"x":-11.0625,"y":-20.46875,"z":-7.125},"Trepin":{"x":26.375,"y":10.5625,"z":9.78125},"Alpha Centauri":{"x":3.03125,"y":-0.09375,"z":3.15625},"Luyten 145-141":{"x":13.4375,"y":-0.8125,"z":6.65625},"LP 525-39":{"x":-19.71875,"y":-31.125,"z":-9.09375},"Wolf 124":{"x":-7.25,"y":-27.15625,"z":-19.09375},"LP 245-10":{"x":-18.96875,"y":-13.875,"z":-24.28125},"Epsilon Eridani":{"x":1.9375,"y":-7.75,"z":-6.84375},"Stein 2051":{"x":-9.46875,"y":2.4375,"z":-15.375},"WISE 0855-0714":{"x":6.53125,"y":-2.15625
@nickludlam
nickludlam / vector.py
Created January 31, 2021 01:36
Not sure where I got this from.
# vector.py
from math import sqrt
class Vector3(object):
"""
3-D vector implementation.
Purpose: Provide
* Core functionality to ray tracing implementation.
‘vide’/‘420v’ 192x 144, { 1- 60 fps}, HRSI:4032x3024, fov:64.720, no bin, no vis, max zoom:189.00 (upscales @21.00), AF System:2, ISO:34.0-3264.0, SS:0.000014-1.000000, supports HDR, no wide color support, no multicam
’vide’/‘420f’ 192x 144, { 1- 60 fps}, HRSI:4032x3024, fov:64.720, no bin, no vis, max zoom:189.00 (upscales @21.00), AF System:2, ISO:34.0-3264.0, SS:0.000014-1.000000, supports HDR, supports wide color, no multicam
’vide’/‘420v’ 352x 288, { 1- 60 fps}, HRSI:3696x3024, fov:59.327, no bin, no vis, max zoom:189.00 (upscales @10.50), AF System:2, ISO:34.0-3264.0, SS:0.000014-1.000000, supports HDR, no wide color support, no multicam
’vide’/‘420f’ 352x 288, { 1- 60 fps}, HRSI:3696x3024, fov:59.327, no bin, no vis, max zoom:189.00 (upscales @10.50), AF System:2, ISO:34.0-3264.0, SS:0.000014-1.000000, supports HDR, supports wide color, no multicam
’vide’/‘420v’ 480x 360, { 1- 60 fps}, HRSI:4032x3024, fov:64.720, no bin, no vis, max zoom:189.00 (upscales @