Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 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:4d798bb5d59792b3a379
Created April 16, 2015 22:51
Multiple level dropdown
<div class="container">
<div class="row">
<h2>Multi level dropdown menu in Bootstrap 3</h2>
<hr />
<div class="dropdown dropdown-select">
<a id="dropdown-content" role="button" data-toggle="dropdown" class="btn btn-primary dropdown-text" data-target="#">
Dropdown <span class="caret"></span>
</a>
<input type="hidden" name='ddname' />
<ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu">
@nickludlam
nickludlam / gist:23190c588df0eb93e84e
Created January 22, 2015 15:19
NodeJS mini-app for querying MongoDB
var express = require('express')
, mongoskin = require('mongoskin')
, bodyParser = require('body-parser')
var path = require('path');
var app = express()
app.set('views', path.join(__dirname, 'views'));
app.use(express.static(path.join(__dirname, 'public')));
app.use(bodyParser())
@nickludlam
nickludlam / wrtnode_packages.txt
Created October 26, 2014 23:25
WRTNode list of installed packages
root@OpenWrt:~# opkg list
alsa-lib - 1.0.27.2-1
alsa-utils - 1.0.27.2-1
base-files - 155-r41508
block-mount - 2014-06-22-e0430f5c62f367e5a8e02755412977b02c3fc45e
busybox - 1.22.1-2
bzip2 - 1.0.6-1
curl - 7.36.0-1
dnsmasq - 2.71-3
dropbear - 2014.63-1
@nickludlam
nickludlam / wrtnode_dmesg.txt
Created October 26, 2014 23:22
Dmesg output from a WRTNode boarf
[ 0.000000] Linux version 3.10.44 (noel@na) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r41508) ) #20 Wed Aug 13 21:00:28 UTC 2014
[ 0.000000] Board has DDR2
[ 0.000000] Analog PMU set to hw control
[ 0.000000] Digital PMU set to hw control
[ 0.000000] SoC Type: Ralink MT7620N ver:2 eco:6
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU revision is: 00019650 (MIPS 24KEc)
[ 0.000000] MIPS: machine is WRTNODE
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 04000000 @ 00000000 (usable)
@nickludlam
nickludlam / gist:d69fcd1eeca0e41c7c01
Last active August 29, 2015 14:05
Overwolf for Elite: Dangerous
1. Grab the latest Overwolf from their website.
2. Open AppData\Local\Overwolf\GamesList.7804102.xml
3. Paste this at the bottom, *above* the </ArrayOfGameInfo> tag:
<GameInfo>
<ID>105222</ID>
<GameTitle>Elite Dangerous</GameTitle>
<LuancherNames>
<string>EliteDangerous.exe</string>
</LuancherNames>