Skip to content

Instantly share code, notes, and snippets.

@bruceadams
bruceadams / rbx-segv
Created March 7, 2015 23:27
SIGSEGV running the test suite for bruceadams/pmap
The Rubinius process is aborting with signal: SIGSEGV
--- begin system info ---
sysname: Linux
nodename: ba
release: 3.13.0-46-generic
version: #77-Ubuntu SMP Mon Mar 2 18:23:39 UTC 2015
machine: x86_64
--- end system info ---
--- begin rubinius info ---
program name: rbx
@bruceadams
bruceadams / first
Created August 18, 2014 22:18
Thread dumps from `rake test:extended` at "TestThread#test_new_thread_in_list = "
This file has been truncated, but you can view the full file.
0SECTION TITLE subcomponent dump routine
NULL ===============================
1TICHARSET UTF-8
1TISIGINFO Dump Event "user" (00004000) received
1TIDATETIME Date: 2014/08/18 at 18:10:45
1TIFILENAME Javacore filename: /git/jruby/javacore.20140818.181045.2363.0002.txt
1TIREQFLAGS Request Flags: 0x81 (exclusive+preempt)
1TIPREPSTATE Prep State: 0x104 (exclusive_vm_access+trace_disabled)
NULL ------------------------------------------------------------------------
@bruceadams
bruceadams / lsmod.txt
Created July 10, 2014 16:02
lsmod output (run as root)
Module Size Used by
veth 13331 0
btrfs 835954 0
raid6_pq 97812 1 btrfs
xor 21411 1 btrfs
ufs 74890 0
qnx4 13317 0
hfsplus 107516 0
hfs 54677 0
minix 36140 0
@bruceadams
bruceadams / lxc-attach.txt
Created July 10, 2014 14:51
lxc-attach for several namespaces
$ for ns in MOUNT PID UTSNAME IPC NETWORK; do lxc-attach -n try1 -s $ns -- echo $ns; done
lxc-attach: Invalid argument - failed to set namespace 'mnt'
lxc-attach: failed to enter the namespace
lxc-attach: Invalid argument - failed to set namespace 'pid'
lxc-attach: failed to enter the namespace
lxc-attach: Invalid argument - failed to set namespace 'uts'
lxc-attach: failed to enter the namespace
lxc-attach: Invalid argument - failed to set namespace 'ipc'
lxc-attach: failed to enter the namespace
lxc-attach: Invalid argument - failed to set namespace 'net'
@bruceadams
bruceadams / ifconfig
Created July 10, 2014 12:43
`ifconfig` inside an lxc container
$ ssh root@10.0.3.235 ifconfig
root@10.0.3.235's password:
eth0 Link encap:Ethernet HWaddr 00:16:3e:63:2f:8b
inet addr:10.0.3.235 Bcast:10.0.3.255 Mask:255.255.255.0
inet6 addr: fe80::216:3eff:fe63:2f8b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:212 errors:0 dropped:0 overruns:0 frame:0
TX packets:101 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:32481 (31.7 KiB) TX bytes:18056 (17.6 KiB)
@bruceadams
bruceadams / gist:0ed19c465dce29a0b392
Created July 10, 2014 12:32
`strace` of lxc-info
$ sudo strace -fF lxc-info -n try1
execve("/usr/bin/lxc-info", ["lxc-info", "-n", "try1"], [/* 17 vars */]) = 0
brk(0) = 0x7f40414f0000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4041123000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=144667, ...}) = 0
mmap(NULL, 144667, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f40410ff000
close(3) = 0
[195040.249262] type=1400 audit(1404941232.778:139): apparmor="DENIED" operation="mount" info="failed flags match" error=-13 profile="lxc-container-default" name="/" pid=1268 comm="mount" flags="ro, remount, relatime"
[195042.538986] lxcbr0: port 1(vethIHIG82) entered disabled state
[195042.628425] lxcbr0: port 1(vethIHIG82) entered disabled state
[195042.629516] device vethIHIG82 left promiscuous mode
[195042.629533] lxcbr0: port 1(vethIHIG82) entered disabled state
[195042.739451] userif-3: sent link down event.
[195042.739463] userif-3: sent link up event.
[195043.736297] userif-3: sent link down event.
[195043.736315] userif-3: sent link up event.
[195139.720100] device veth1MFA2N entered promiscuous mode
@bruceadams
bruceadams / shell session
Created July 9, 2014 21:32
Unexpected errors from LXC
adams ~$ sudo lxc-create -t download -n test-ubuntu -- -d ubuntu -r trusty -a amd64 ; sudo lxc-start -n test-ubuntu -d ; sudo lxc-ls -f test-ubuntu ; sudo lxc-stop -n test-ubuntu -k ; sudo lxc-destroy -n test-ubuntu
Setting up the GPG keyring
Downloading the image index
Downloading the rootfs
Downloading the metadata
The image cache is now ready
Unpacking the rootfs
---
You just created an Ubuntu container (release=trusty, arch=amd64, variant=default)
(ns mazejam.core
(:require [clojure.set :as set]))
(defn to-json
[maze]
(clojure.pprint/cl-format
true
"[~{[~{~3d~^, ~}]~^,\n ~}]~%"
maze))