Skip to content

Instantly share code, notes, and snippets.

View jayalane's full-sized avatar

Chris Lane jayalane

View GitHub Profile
goroutine 149 [syscall, 14 minutes]:
syscall.Syscall6(0x101, 0xffffffffffffff9c, 0xc012842ee0, 0x80000, 0x0, 0x0, 0x0)
/usr/local/go1.18/src/syscall/asm_linux_amd64.s:43 +0x5
syscall.openat(0x6a?, {0xc012842af0?, 0x7?}, 0x1?, 0x0?)
/usr/local/go1.18/src/syscall/zsyscall_linux_amd64.go:68 +0x105
syscall.Open(...)
/usr/local/go1.18/src/syscall/syscall_linux.go:155
os.openFileNolog({0xc012842af0, 0x6a}, 0x0, 0x0)
/usr/local/go1.18/src/os/file_unix.go:216 +0x9b
@jayalane
jayalane / gist:08ee11d68d14d7bcda7e2ebc9e015331
Created February 8, 2022 00:16
Non-Blocking os.ReadDir()
// readDir reads the directory and returns the list
// it uses a little separate go-routine in order to handle timeouts
func (s scannerApp) readDir(d string) ([]os.DirEntry, error) {
ch := make(chan []os.DirEntry, 2)
go func(d string) {
deList, err := os.ReadDir(d)
if err != nil {
"""parses terraform code and provides SAX-style callbacks to code that
can return values to change the terraform. I re-read
http://www.paulgraham.com/avg.html last week and had a conversation
about what capabilities the TF team is building. The ability to
change our code with code is a useful capability.
Paul G:
As long as our hypothetical Blub programmer is looking down the
power continuum, he knows he's looking down. Languages less
chattr -i /usr/lib/tmpfiles.d/squid.conf
#yum install -y squid
yum update -y
yum upgrade -y
yum erase -y squid || echo "No squid already there"
yum install -y squid-3.5.20-17.amzn2.4.1.x86_64
# somehow in newer AWS Linux 2 tmpfiles is restarting squid
@jayalane
jayalane / journalctl -b
Created May 27, 2021 20:08
Squid getting restarted
-- Logs begin at Tue 2020-12-01 20:49:18 UTC, end at Thu 2021-05-27 20:02:32 UTC. --
May 27 20:00:11 localhost systemd-journal[678]: Runtime journal is using 8.0M (max allowed 386.2M, trying to leave 579.3M free of 3.7G available → current limit 386.2M).
May 27 20:00:11 localhost kernel: Linux version 4.14.232-176.381.amzn2.x86_64 (mockbuild@ip-10-0-1-103) (gcc version 7.3.1 20180712 (Red Hat 7.3.1-12) (GCC)) #1 SMP Wed May 19 00:31:54 UTC 2021
May 27 20:00:11 localhost kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-4.14.232-176.381.amzn2.x86_64 root=LABEL=ROOT ro console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 nvme_core.io_timeout=4294967295 rd.emergency=poweroff rd.shell=0 LANG=en_US.UTF-8 KEYTABLE=us
May 27 20:00:11 localhost kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
May 27 20:00:11 localhost kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
May 27 20:00:11 localhost kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
May 27
@jayalane
jayalane / fix.sh
Created May 17, 2020 03:14
recover from qt4 removal in debian
#! /bin/bash
# pairs was just a package that randomly showed up in the broken dependencies.
# almost any apt-get command would have a spew of broken packages like this:
# # pairs : Depends: kde-runtime (> 4:4.10) but it is not installable
# Depends: libkdeclarative5 (>= 4:4.7.0) but it is not going to be installed
# Depends: libkdecore5 (>= 4:4.4.95) but it is not going to be installed
# Depends: libkdeui5 (>= 4:4.7.0) but it is not going to be installed
# Depends: libkio5 (>= 4:4.3.4) but it is not going to be installed
# Depends: libknewstuff3-4 (>= 4:4.4.0) but it is not going to be installed
(gdb) bt
#0 0x000000000047d36b in process_chk_conn (t=0x77b390) at include/proto/connection.h:700
#1 process_chk (t=0x77b390) at src/checks.c:2283
#2 0x00000000004c4cef in process_runnable_tasks () at src/task.c:229
#3 0x0000000000482b80 in run_thread_poll_loop (argc=<value optimized out>, argv=0x7fffffffeac8) at src/haproxy.c:2326
#4 main (argc=<value optimized out>, argv=0x7fffffffeac8) at src/haproxy.c:2925
[root@..... haproxy-1.8.0]# ./haproxy -vv
Sharing filter with vars
Sharing email_alert with comp_state