Skip to content

Instantly share code, notes, and snippets.

View robbat2's full-sized avatar

Robin H. Johnson robbat2

View GitHub Profile
@robbat2
robbat2 / gist:c44677ee4d425947af1b
Created July 14, 2015 22:29
postgres explain problems
2015-07-14 22:21:55 GMT LOG: duration: 103068.100 ms plan:
Query Text:
SELECT DISTINCT
x.value,
x.id,
x.push,
x.restrict,
x.weight,
x.ts_rank_cd,
#!/bin/bash
set -e -x
rm -rf .git pkgdir #log.*
git init
LOGNAME=log.merge
dumplog() {
git log
git whatchanged --pretty='%%at:%at %%ct:%ct' -m
}
#!/bin/bash
set -e -x
rm -rf .git pkgdir #log.*
git init
LOGNAME=log.merge
dumplog() {
git log --format=raw
git whatchanged --pretty='%%at:%at %%ct:%ct' -m
}
commit c9a48623402ffb46be4f01b7b6e6f88d958b47eb
tree c5375a5248ff32029c58253c1f062832d7c46514
parent 4063c91a9b4ae71a4d572179c969285e3184f849
parent 1ed098019e02bcbef20eef6d776b16f43c4a9234
author Robin H. Johnson <dev2@example.com> 1454095915 -0800
committer Robin H. Johnson <robbat2@gentoo.org> 1454095915 -0800
merge branch2
commit 4063c91a9b4ae71a4d572179c969285e3184f849
commit aad47594dab9c2564e1596fff968cd92b8a8218d
tree c5375a5248ff32029c58253c1f062832d7c46514
parent 0a26839d633608c7497994fab5be62787c4b9a10
author Robin H. Johnson <dev2@example.com> 1450000000 +0000
committer Robin H. Johnson <robbat2@gentoo.org> 1454095917 -0800
Dev2 commit.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
inherit flag-o-matic
KERNEL_SOURCES="hardened-sources"
KERNEL_NAME="hardened"
KERNEL_PV="$PV"
@robbat2
robbat2 / fakefile.py
Last active March 19, 2016 09:03
A determinisic fake file object with low memory growth
#!/usr/bin/python
#
# A determinisic fake file object with low memory growth
#
# Authors:
# Robin Johnson <robin.johnson@dreamhost.com> (original author)
#
# License: This file is copyright under BSD-2 license:
# Copyright (c) 2016, Dreamhost
# All rights reserved.
@robbat2
robbat2 / foo.diff
Created July 7, 2016 23:27
normal boot vs kexec, ubuntu 14.04
--- dmesg.normal 2016-07-07 16:05:21.096379507 -0700
+++ dmesg.kexec 2016-07-07 16:05:21.096379507 -0700
@@ -2,13 +2,13 @@
Initializing cgroup subsys cpu
Initializing cgroup subsys cpuacct
Linux version 3.13.0-35-generic (buildd@panlong) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014 (Ubuntu 3.13.0-35.62-generic 3.13.11.6)
-Command line: BOOT_IMAGE=/boot/vmlinuz-3.13.0-35-generic root=UUID=f7e9595f-d61e-49fc-975a-50e96194f1ce ro crashkernel=384M-:128M crashkernel=384M-:128M
+Command line: root=UUID=f7e9595f-d61e-49fc-975a-50e96194f1ce ro crashkernel=384M-:128M crashkernel=384M-:128M
KERNEL supported cpus:
Intel GenuineIntel
@robbat2
robbat2 / -
Last active July 19, 2016 19:46
genkernel use-modules load.sh proof of concept from consus
#!/bin/bash
load() {
# TODO: validate the path to avoid escapes
. ./$2
# FIX: This loop could be replaced w/ set+awk
for modules_group in ${!MODULES_*}; do
echo ${1}_${modules_group}=\"${!modules_group}\"
done
}
#!/bin/bash
cat | \
fgrep ' -- osd_op(' | \
grep -v -e ' notify' -e 'pgls start_epoch' | \
awk '{print $12,$13,$14,$15,$16,$17,$18,$19,$20}' | \
sed 's, snapc.*,,g'