Skip to content

Instantly share code, notes, and snippets.

View tomgco's full-sized avatar
☠️
Building stuff

Tom Gallacher tomgco

☠️
Building stuff
View GitHub Profile
@tomgco
tomgco / 01.bench.js
Created October 2, 2019 15:18
YLD Coding benchmarking
'use strict';
const impl = require('../danb/addon');
const common = require('./benchmarker');
const bench = common.createBenchmark(main, {
s: ['Beunos YLDias 19'],
iterations: (new Array(5)).fill(1000000),
});
@tomgco
tomgco / git log
Created October 26, 2018 14:18
Tom's font heaven
$ ps aux | head
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.1 0.0 215704 9900 ? Ss 11:34 0:16 /sbin/init
root 2 0.0 0.0 0 0 ? S 11:34 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? I< 11:34 0:00 [rcu_gp]
root 4 0.0 0.0 0 0 ? I< 11:34 0:00 [rcu_par_gp]
root 6 0.0 0.0 0 0 ? I< 11:34 0:00 [kworker/0:0H-kblockd]
root 8 0.0 0.0 0 0 ? I< 11:34 0:00 [mm_percpu_wq]
root 9 0.0 0.0 0 0 ? S 11:34 0:00 [ksoftirqd/0]
root 10 0.0 0.0 0 0 ? I 11:34 0:07 [rcu_preempt]
617fb80323479d6d6200ff55f1f24e63*74d21da24b2d*f0a2251aa0a5*54696d696420746f6164
2e49a6f4409a4ab26152a2a3385de4ef*74d21da24b2d*c495003bbcdc*54696d696420746f6164
0a1d1acec93a134794cd16757916595c*74d21da24b2d*4cefc036581b*54696d696420746f6164
112e2d1d1619f671e767fcd51548cee4*74d21da24b2d*c83a6bb19c9f*54696d696420746f6164
617fb80323479d6d6200ff55f1f24e63*74d21da24b2d*f0a2251aa0a5*54696d696420746f6164
2e49a6f4409a4ab26152a2a3385de4ef*74d21da24b2d*c495003bbcdc*54696d696420746f6164
0a1d1acec93a134794cd16757916595c*74d21da24b2d*4cefc036581b*54696d696420746f6164
112e2d1d1619f671e767fcd51548cee4*74d21da24b2d*c83a6bb19c9f*54696d696420746f6164
617fb80323479d6d6200ff55f1f24e63*74d21da24b2d*f0a2251aa0a5*54696d696420746f6164
2e49a6f4409a4ab26152a2a3385de4ef*74d21da24b2d*c495003bbcdc*54696d696420746f6164
@tomgco
tomgco / winterhaze.bsmx
Last active January 21, 2018 12:08
beer.xml
<?xml version="1.0" encoding="ISO-8859-1"?><RECIPES>
<RECIPE>
<NAME>Winter Haze</NAME>
<VERSION>1</VERSION>
<TYPE>All Grain</TYPE>
<BREWER>Tom Gallacher</BREWER>
<ASST_BREWER></ASST_BREWER>
<BATCH_SIZE>23.0000000</BATCH_SIZE>
<BOIL_SIZE>28.0000000</BOIL_SIZE>
<BOIL_TIME>60.0000000</BOIL_TIME>
@tomgco
tomgco / kube-conformance.sh
Last active January 2, 2018 16:36
Run the CNCF kubernetes conformance tests.
#!/usr/bin/env bash
###
#
# This suite of tests runs the cncf kubernetes cluster conformance tests.
# These tests can take upto an hour (60mins) to run, so sit back, grab a
# cup of tea and enjoy seeing your build going green! (we hope).
#
###
local audit = [[arch-audit -u]]
awful.spawn.easy_async(audit, function(stdout, stderr, reason, exit_code)
if stdout then naughty.notify { preset = naughty.config.presets.critical, text = stdout } end
end)
@tomgco
tomgco / README.md
Last active August 15, 2018 19:17
My arch linux installation

Pacman files

yay -Qqen

AUR files

yay -Qqem
@tomgco
tomgco / README.md
Last active July 20, 2016 13:20
Record GIFs in linux :]
  • Install ffcast
  • chmod +x recordgif
  • recordgif output.gif

gif from wed 20 jul 14 20 07 bst 2016

@tomgco
tomgco / README.md
Last active December 11, 2015 12:35
How to Flamegraph

How to flamegraph

node --perf_basic_prof index.js

This will create files based on the pid(s) like /tmp/perf-$pid which hold mapping of memory to function names. It will be automatically picked up by linux perf, so just run everything as your local user if you can.

@tomgco
tomgco / Dockerfile
Created August 28, 2015 15:09
Boot2docker - linux perf tools inside boot2docker
FROM boot2docker/boot2docker
ENV TCZ_DEPS_2 elfutils-dev \
elfutils
# Installing dependencies for compilation or linux perf tools
RUN apt-get update && apt-get install -y \
bison \
flex \
elfutils \
libelf-dev \