Skip to content

Instantly share code, notes, and snippets.

@ingshtrom
ingshtrom / README.md
Last active November 12, 2021 16:21
Docker Pull Debug with Curl
@ingshtrom
ingshtrom / README.md
Created April 14, 2021 13:54
fluent-bit 1.7.3 crashes

fluent-bit is crashing for some reason and I'm not entirely sure why. I am running this inside Kubernetes as a sidecar to an HAProxy deployment. We are fine on memory (10% of limit usage) and cpu (no limits). We are getting exit code 135 and no stack trace, like I've seen for some other crashes.

As for the Kubernetes configuration, I'm not sure that it's especially useful, but we do use a config map to load the config into the fluent-bit container and an emptyDir volume mounting to /tmp/fluent-bit, which as-per the docs is what is used by the s3 plugin as a disk buffer space, I think?

@ingshtrom
ingshtrom / hammerspoon-init.lua
Last active March 5, 2021 19:58
zoom mute audio/video
local canvas = require("hs.canvas")
hs.window.animationDuration = 0
local units = {
right50 = {x = 0.50, y = 0.00, w = 0.50, h = 1.00},
left50 = {x = 0.00, y = 0.00, w = 0.50, h = 1.00},
top50 = {x = 0.00, y = 0.00, w = 1.00, h = 0.50},
bot50 = {x = 0.00, y = 0.50, w = 1.00, h = 0.50},
maximum = {x = 0.00, y = 0.00, w = 1.00, h = 1.00}
}
@ingshtrom
ingshtrom / haproxy-metrics.prom
Created October 21, 2019 20:33
example HAProxy with built-in Prometheus metrics
# HELP haproxy_process_nbthread Configured number of threads.
# TYPE haproxy_process_nbthread gauge
haproxy_process_nbthread 4
# HELP haproxy_process_nbproc Configured number of processes.
# TYPE haproxy_process_nbproc gauge
haproxy_process_nbproc 1
# HELP haproxy_process_relative_process_id Relative process id, starting at 1.
# TYPE haproxy_process_relative_process_id gauge
haproxy_process_relative_process_id 1
# HELP haproxy_process_start_time_seconds Start time in seconds.
@ingshtrom
ingshtrom / haproxy.log
Created January 30, 2019 14:40
haproxy but report docs
"_messagetimems","_messagetime","container_name","message"
"1548793228554","01/29/2019 15:20:28.554 -0500","k8s_haproxy_haproxy-router-d5csc_routing-external-default_23340a5e-23c6-11e9-a7e5-0242ac11000b_59","7ffd6cfef000-7ffd6cff1000 r-xp 00000000 00:00 0 [vdso]"
"1548793228554","01/29/2019 15:20:28.554 -0500","k8s_haproxy_haproxy-router-d5csc_routing-external-default_23340a5e-23c6-11e9-a7e5-0242ac11000b_59","ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]"
"1548793228550","01/29/2019 15:20:28.550 -0500","k8s_haproxy_haproxy-router-d5csc_routing-external-default_23340a5e-23c6-11e9-a7e5-0242ac11000b_59","7ffd6cfec000-7ffd6cfef000 r--p 00000000 00:00 0 [vvar]"
"1548793228549","01/29/2019 15:20:28.549 -0500","k8s_haproxy_haproxy-router-d5csc_routing-external-default_23340a5e-23c6-11e9-a7e5-0242ac11000b_59","7f99cb65a000-7f99cb65b000 rw-p 00024000 ca:10 534226 /lib/x86_64-linux-gnu/ld-2.24.so"
"1548793228549"
2018-05-22 19:35:55.721 WARN [SIGTERM handler] [logstash.runner] [invoke] [sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source)] - SIGTERM received. Shutting down.
2018-05-22 19:35:56.235 WARN [nioEventLoopGroup-8-1] [io.netty.channel.AbstractChannel] [warn] [io.netty.util.internal.logging.Slf4JLogger.warn(Slf4JLogger.java:146)] - Force-closing a channel whose registration task was not accepted by an event loop: [id: 0x95df02c8, L:/172.18.0.3:7002 - R:/10.1.14.123:59451]
java.util.concurrent.RejectedExecutionException: event executor terminated
at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:840) ~[logstash-input-tcp-5.0.3.jar:?]
at io.netty.util.concurrent.SingleThreadEventExecutor.offerTask(SingleThreadEventExecutor.java:342) ~[logstash-input-tcp-5.0.3.jar:?]
at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:335) ~[logstash-input-tcp-5.0.3.jar:?]
at io.netty.util.concurrent.SingleThreadEventExecutor.execute(S
May 22nd 2018, 11:17:02.833 time="2018-05-22T15:17:02.223472753Z" level=error msg="Error getting service ucp-interlock: service ucp-interlock not found"
- ip-10-52-47-66 -
May 22nd 2018, 11:17:05.054 time="2018-05-22T15:17:04.615733447Z" level=warning msg="unable to pin image docker/ucp-agent-s390x:3.0.1 to digest: manifest unknown: manifest unknown"
- ip-10-52-47-66 -
May 22nd 2018, 11:17:13.057 time="2018-05-22T15:17:12.084822088Z" level=error msg="Error getting service ucp-interlock: service ucp-interlock not found"
- ip-10-52-47-66 -
May 22nd 2018, 11:17:24.060 time="2018-05-22T15:17:23.615882242Z" level=error msg="Error getting service ucp-interlock-extension: service ucp-interlock-extension not found"
- ip-10-52-47-66 -
May 22nd 2018, 11:17:24.060 time="2018-05-22T15:17:23.614770969Z" level=error msg="Error getting service ucp-interlock: service ucp-interlock not found"
- ip-10-52-47-66 -
ubuntu@ip-10-1-31-84:~$ docker logs logstash
+ workers=4
+ batch=1000
+ exec env XPACK_MONITORING_ENABLED=false /usr/share/logstash/bin/logstash -f /usr/share/logstash/logstash.conf -w 4 -b 1000 -r
Sending Logstash's logs to /usr/share/logstash/logs which is now configured via log4j2.properties
2018-05-22 13:20:53.567 INFO [main] [logstash.modules.scaffold] [invoke0] [sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)] - Initializing module {:module_name=>"netflow", :directory=>"/usr/share/logstash/modules/netflow/configuration"}
2018-05-22 13:20:53.582 INFO [main] [logstash.modules.scaffold] [invoke0] [sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)] - Initializing module {:module_name=>"fb_apache", :directory=>"/usr/share/logstash/modules/fb_apache/configuration"}
2018-05-22 13:20:54.433 INFO [main] [logstash.modules.scaffold] [invoke0] [sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)] - Initializing module {:module_name=>"arcsight", :directory=>"/usr/share/logstash/vendor/b
@ingshtrom
ingshtrom / keybase.md
Created May 9, 2018 13:18
keybase.md

Keybase proof

I hereby claim:

  • I am ingshtrom on github.
  • I am ingshtrom (https://keybase.io/ingshtrom) on keybase.
  • I have a public key ASAMPj8ed5JaKn6X60v_nUV_NtBCwguIHDK7EfMgAvzu8Qo

To claim this, I am signing this object:

@ingshtrom
ingshtrom / mastermind.js
Created February 16, 2018 17:11
mastermind
function getMasterSequences(colors, sequenceLength) {
return genSequences(colors, sequenceLength);
}
function genSequences(colors, totalLength, indices = []) {
// console.log('genSequences');
if (indices.length === totalLength) {
const seq = genSeq(colors, indices);
indices = [];