Skip to content

Instantly share code, notes, and snippets.

Problem statement

It's your first day at HorribleLegacy, Inc. You've been told to investigate a performance issue within a system written by your predecessor. This sytem has no documentation. All we know is that it relies on the following program running inside a Docker image:

docker run gi11es/interview-exercise /usr/bin/helloworld

Ignoring the amount of time it takes to download the docker image for the first time, running the above command outputs "hello" after a while:

~ $ docker run gi11es/interview-exercise /usr/bin/helloworld
hello
@ioc32
ioc32 / gist:66675048004389675a824c374cda5e32
Created August 18, 2017 09:58 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
@ioc32
ioc32 / esnog19-elk-workshop
Created April 7, 2017 10:04
ELK configs, grok regexs and playbook
root@esnog19:/etc/logstash# cat conf.d/inputs-intermediate.conf
input {
file {
path => "/home/malibu/data/nokia.log"
start_position => "beginning"
type => "nokia"
codec => multiline {
pattern => "^\d+\s+\d{4}"
what => "previous"
@ioc32
ioc32 / logstash bind9 patterns
Created January 27, 2016 15:27
Logstash grok grammars for BIND9
PORT [0-9]+
BIND_TIME %{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME}
ZONE [0-9a-zA-Z.-]+
DNS_ZONE %{ZONE:zone}/%{DATA:class}/%{DATA:view}
STR [a-zA-Z\-]+
XFR_START1 zone %{DNS_ZONE}: %{DATA:daemon_status}\.
XFR_START2 client %{IP:client_ip}[@#]+%{PORT:client_port} \(%{ZONE}\): view %{DATA:view}: transfer of \'%{DATA:zone}/%{DATA:class}\': %{DATA:daemon_status} (?:\(serial %{PORT:serial}\)|\(serial %{PORT:serial_old} -> %{PORT:serial}\))
XFR_START (?:%{XFR_START1}|%{XFR_START2})
XFR_SERIAL zone %{DNS_ZONE}: %{DATA:daemon_status} serial %{POSINT:serial}
@ioc32
ioc32 / heka-ctest-errors.txt
Created November 6, 2015 15:37
heka-ctest-errors
[root@localhost build]# make clean-heka
Scanning dependencies of target clean-heka
[100%] Resynchronizing the Go workspace with the Heka repository
-- GeoIP.h was not found, GeoIP functionality will not be included in this build.
-- Docker plugins enabled.
-- sphinx-build was not found, the documentation will not be generated.
-- Configuring done
-- Generating done
-- Build files have been written to: /root/heka/build
[100%] Built target clean-heka
@ioc32
ioc32 / heka-queue-fix-tests.log
Created November 4, 2015 19:27
heka queue_full_shutdown_fix test results
[root@localhost build]# ctest
Test project /root/heka/build
Start 1: cmd/hekad
1/26 Test #1: cmd/hekad ........................ Passed 3.22 sec
Start 2: message
2/26 Test #2: message .......................... Passed 1.52 sec
Start 3: pipeline
3/26 Test #3: pipeline ......................... Passed 3.90 sec
Start 4: plugins
4/26 Test #4: plugins .......................... Passed 2.62 sec
@ioc32
ioc32 / gist:9f33607524714d1da66b
Created May 10, 2015 14:02
ASN, Holder names
This file has been truncated, but you can view the full file.
AS0 -Reserved AS-,ZZ
AS1 LVLT-1 - Level 3 Communications, Inc.,US
AS2 UDEL-DCN - University of Delaware,US
AS3 MIT-GATEWAYS - Massachusetts Institute of Technology,US
AS4 ISI-AS - University of Southern California,US
AS5 SYMBOLICS - Symbolics, Inc.,US
AS6 BULL-HN - Bull HN Information Systems Inc.,US
AS7 UK Defence Research Agency,GB
AS8 RICE-AS - Rice University,US
AS9 CMU-ROUTER - Carnegie Mellon University,US
@ioc32
ioc32 / get_apu_temp.sh
Last active August 29, 2015 14:19
get_apu_temp.sh
# cat get_apu_temp.sh
#!/bin/sh
date=$(date "+%Y-%m-%dT%H:%M:%S")
temp=$(sysctl hw.sensors.km0.temp0 | sed 's/.*=\([0-9\.]*\) degC/\1/')
ints=$(vmstat -w 1 -c 2 | awk 'END {print $14}')
echo $date,$temp,$ints >> /root/apu-temperatures.csv
# crontab -l | grep get_apu_temp
* * * * * /bin/sh /root/get_apu_temp.sh
@ioc32
ioc32 / gist:7a4f1965f54c26e99df4
Created April 18, 2015 10:25
A todo jazz - show list
iortiz@monet:~/Code/git/cifu-archive
$ ls -1 /mnt/storage/cifu/atj-*
/mnt/storage/cifu/atj-2008-08-28-A todo jazz - 280808.mp3
/mnt/storage/cifu/atj-2008-09-06-Primera hora - 060908.mp3
/mnt/storage/cifu/atj-2008-09-06-Segunda hora - 060908.mp3
/mnt/storage/cifu/atj-2008-09-13-Primera hora - 130908.mp3
/mnt/storage/cifu/atj-2008-09-13-Segunda hora - 130908.mp3
/mnt/storage/cifu/atj-2008-09-20-Primera hora - 200908.mp3
/mnt/storage/cifu/atj-2008-09-20-Segunda hora - 200908.mp3
/mnt/storage/cifu/atj-2008-09-27-Primera hora - 270908.mp3
@ioc32
ioc32 / gist:9e64a9948333fd9b126f
Created January 6, 2015 20:08
Heka issue1235
[hekad]
maxprocs = 2
base_dir = "/tmp/cache"
pid_file = "/tmp/hekad.pid"
share_dir = "/usr/share/heka"
[log1]
type = "LogstreamerInput"
log_directory = "/var/log/"
file_match = 'yum\.log'