Skip to content

Instantly share code, notes, and snippets.

View calmh's full-sized avatar
:bowtie:
I may be slow to respond.

Jakob Borg calmh

:bowtie:
I may be slow to respond.
View GitHub Profile
package main
import (
"reflect"
"testing"
)
// This implements a flatten function for arbitrarily nested integer lists.
// I've chosen Go as the implementation language as it's the one I'm most
// comfortable in right now, but in a way this problem is a bad fit for the
[I6KAH] 2016/03/11 08:50:58.817883 protocol.go:430: DEBUG: decompressed to 652 bytes
[I6KAH] 2016/03/11 08:50:58.817938 protocol.go:439: DEBUG: message data:
00000000 00 00 00 02 73 32 00 00 00 00 00 09 73 79 6e 63 |....s2......sync|
00000010 74 68 69 6e 67 00 00 00 00 00 00 1b 76 30 2e 31 |thing.......v0.1|
00000020 33 2e 30 2d 62 65 74 61 2e 30 2b 31 31 35 2d 67 |3.0-beta.0+115-g|
00000030 37 31 30 64 64 66 37 00 00 00 00 02 00 00 00 07 |710ddf7.........|
00000040 64 65 66 61 75 6c 74 00 00 00 00 03 00 00 00 20 |default........ |
00000050 47 94 03 ff de f4 96 b5 f5 e5 bc 9c 0a 15 22 1e |G.............".|
00000060 70 07 31 64 50 9f a3 07 61 af 63 09 4f 6f 94 5c |p.1dP...a.c.Oo.\|
00000070 00 00 00 02 73 31 00 00 00 00 00 01 00 00 00 15 |....s1..........|
jb@zlogin5:~/s/g/i/telegraf $ make
go get github.com/sparrc/gdm
gdm restore
======= Go Dependency Manager =======
= working dir: /home/jb/src/github.com/influxdata/telegraf
= GOPATH: /home/jb
=====================================
> Restoring /home/jb/src/git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.golang.git to 617c801af238c3af2d9e72c5d4a0f02edad03ce5
> Restoring /home/jb/src/github.com/Shopify/sarama to 8aadb476e66ca998f2f6bb3c993e9a2daa3666b9
> Restoring /home/jb/src/github.com/Sirupsen/logrus to 219c8cb75c258c552e999735be6df753ffc7afdc
@calmh
calmh / Outage.md
Last active April 21, 2023 17:13
Outage report

Outage Report

So we had an outage on a couple of things. The reason was that those things live on a server of mine hosted at a place, and there was a fiber cut to that place. However it could, for the same effect, equally well have been a failure of the server hardware or the firewall that protects it. Most of the things living on that server are quite non essential:

  • The forum. I'm sad when it's down because I enjoy it, but in the end no one gets hurt and files are still synchronized all over the world.
  • The website. We make a less than optimal impression with it down, but again it's a minor inconvenience.
  • One of the three discovery servers. The discovery service is redundant for this reason, so no worry.
  • The build server. Hampers development, prevents doing an actual release in the proper way while it's unreachable. We get by.
  • The usage reporting server. We get a blip in the usage reports while it's down but that's all.
jb@syno:/V/R/test $ ../bin/syncthing -version
syncthing v0.13.0-beta.0+74-g764e3f0 "Copper Cockroach" (go1.5.2 darwin-amd64) jb@syno 2016-02-03 07:58:14 UTC
jb@syno:/V/R/test $ go test -v -tags "integration benchmark" -run e2G
=== RUN TestBenchmarkTransferLargeFile2G
2016/02/04 00:40:41 Cleaning...
2016/02/04 00:40:41 Generating files...
2016/02/04 00:40:45 Total 2048.0 MiB in 1 files
2016/02/04 00:40:45 Starting instance 1...
2016/02/04 00:40:57 Starting instance 2...
2016/02/04 00:40:58 {9 2016-02-04 00:40:58.229436178 +0100 CET StateChanged map[to:scanning folder:default from:idle]}
#!/bin/bash
set -euo pipefail
src=$1
dst=$2
tags=$(GIT_DIR="$1/.git" git tag | grep -E '^v\d+\.\d+\.\d+$')
for tag in $tags ; do
date=$(GIT_DIR="$1/.git" git log --pretty=format:%aI -n1 "$tag")
if ! GIT_DIR="$2/.git" git rev-parse -q --verify $tag >/dev/null ; then
@calmh
calmh / -
Created December 17, 2015 12:03
root@ddceb8b7-3834-4af2-92d1-bb8f1f129645:~# ps auxwf
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 80766 0.0 0.3 6852 3544 ? Ss 05:02 0:00 /bin/login -h zone:global -f
root 80929 0.0 0.4 8788 4380 ? S 05:02 0:00 \_ -bash
root 81180 0.0 0.2 6928 2580 ? R 05:03 0:00 \_ ps auxwf
root 1 0.0 0.3 6428 3788 ? S 05:02 0:00 init
16 80742 0.0 0.2 4028 2768 ? Ssl 05:02 0:00 ipmgmtd
root 80854 0.0 0.1 5268 1792 ? S 05:02 0:00 upstart-udev-bridge --daemon
root 80860 0.0 0.2 11968 2576 ? Ss 05:02 0:00 /lib/systemd/systemd-udevd --daemon
message+ 80943 0.0 0.2 6608 2440 ? Ss 05:02 0:00 dbus-daemon --system --fork
package main
import (
"fmt"
"runtime"
"time"
)
func main() {
// One million slices
@calmh
calmh / compiled with -N -S
Created November 4, 2015 20:47
builds with go version devel +3bc0601 Tue Oct 20 03:16:09 2015 +0000 darwin/amd64 of syncthing v0.12.0-rc6-13-g9df7019
"".(*Model).Completion t=1 size=2032 value=0 args=0x40 locals=0x190
0x0000 00000 (/Users/jb/src/github.com/syncthing/syncthing/lib/model/model.go:330) TEXT "".(*Model).Completion(SB), $400-64
0x0000 00000 (/Users/jb/src/github.com/syncthing/syncthing/lib/model/model.go:330) MOVQ (TLS), CX
0x0009 00009 (/Users/jb/src/github.com/syncthing/syncthing/lib/model/model.go:330) LEAQ -272(SP), AX
0x0011 00017 (/Users/jb/src/github.com/syncthing/syncthing/lib/model/model.go:330) CMPQ AX, 16(CX)
0x0015 00021 (/Users/jb/src/github.com/syncthing/syncthing/lib/model/model.go:330) JLS 2018
0x001b 00027 (/Users/jb/src/github.com/syncthing/syncthing/lib/model/model.go:330) SUBQ $400, SP
0x0022 00034 (/Users/jb/src/github.com/syncthing/syncthing/lib/model/model.go:330) FUNCDATA $0, gclocals·621c01eb3bfd828ed6dddd720d7e58a0(SB)
0x0022 00034 (/Users/jb/src/github.com/syncthing/syncthing/lib/model/model.go:330) FUNCDATA $1, gclocals·323c374e00803fa8bd43cb2b623a955c(SB)
0x0022 00034 (/Users/jb/src/github.com/syncthing/syn
@calmh
calmh / -
Created November 3, 2015 18:06
[root@relays ~]# pkgin up -y
reading local summary...
processing local summary...
pkg_info: cannot read meta data file +CONTENTS of package solaris_amd64: No such file or directory
processing remote summary (http://pkgsrc.joyent.com/packages/SmartOS/2014Q4/x86_64/All)...
pkg_summary.bz2 100% 2110KB 703.3KB/s 125.9KB/s 00:03
[root@relays ~]# pkgin in nginx
calculating dependencies... done.
nothing to upgrade.