Skip to content

Instantly share code, notes, and snippets.

View lorin's full-sized avatar
🤷‍♂️
Nominal

Lorin Hochstein lorin

🤷‍♂️
Nominal
View GitHub Profile
@lorin
lorin / prepare-commit-msg.py
Last active April 7, 2023 19:06
Git prepare-commit-msg hook for using git with pivotal tracker
#!/usr/bin/python
"""
This is a prepare-commit-msg hook for use with Pivotal Tracker.
Copy this file to $GITREPOSITORY/.git/hooks/prepare-commit-msg
and mark it executable.
It will prepend [#<story id>] to your commit message.
See https://www.pivotaltracker.com/help/api?version=v3#scm_post_commit
@lorin
lorin / preseed-fragment.seed
Last active November 30, 2022 04:04
Automated partitioning with Ubuntu preseed
# Use LVM for partitioning
d-i partman-auto/method string lvm
# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. Preseed this away
d-i partman-lvm/device_remove_lvm boolean true
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true
@lorin
lorin / vagrant.py
Created September 25, 2014 21:25
Vagrant dynamic inventory script for Ansible
#!/usr/bin/env python
# Adapted from Mark Mandel's implementation
# https://github.com/ansible/ansible/blob/devel/plugins/inventory/vagrant.py
import argparse
import json
import paramiko
import subprocess
import sys
@lorin
lorin / mkpasswd.py
Created June 5, 2013 19:24
Generate a password hash suitable for /etc/shadow. Warning: Gives incorrect value on OS X.
#!/usr/bin/env python
"""
Generate a password hash, suitable for /etc/shadow
Inspired by this code from OpenStack:
https://github.com/openstack/nova/blob/stable/grizzly/nova/virt/disk/api.py#L549
Usage:
mkpasswd <passwd> [--algo=<hash>]
@lorin
lorin / log.txt
Last active May 13, 2020 18:05
Stack overflow error in keel tests
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.StackOverflowError
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1055) ~[spring-webmvc-5.2.3.RELEASE.jar:5.2.3.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.3.RELEASE.jar:5.2.3.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) [spring-webmvc-5.2.3.RELEASE.jar:5.2.3.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) [spring-webmvc-5.2.3.RELEASE.jar:5.2.3.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) [spring-webmvc-5.2.3.RELEASE.jar:5.2.3.RELEASE]
at org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDisp
@lorin
lorin / bad.txt
Last active May 12, 2020 20:53
Good and bad logs from keel test runs
##[group]Run ./gradlew build
./gradlew build
shell: /bin/bash -e {0}
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx2g -Xms2g
JAVA_HOME: /opt/hostedtoolcache/jdk/8.0.252/x64
JAVA_HOME_8.0.252_x64: /opt/hostedtoolcache/jdk/8.0.252/x64
##[endgroup]
Downloading https://services.gradle.org/distributions/gradle-6.4-bin.zip
.........10%..........20%..........30%..........40%.........50%..........60%..........70%..........80%.........90%..........100%
@lorin
lorin / thread-dump.txt
Created May 8, 2020 00:02
Example thread dump for keel instance stuck with high CPU
2020-05-07 23:04:08
Full thread dump OpenJDK 64-Bit Server VM (25.251-b09 mixed mode):
"default connection adder" #5051 daemon prio=5 os_prio=0 tid=0x00007efd742bb000 nid=0x73f5 waiting on condition [0x00007efd72ae8000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000006d2ff9eb8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2083)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
@lorin
lorin / trace-1
Last active April 20, 2020 16:36
Keel out of memory error stack trace examples
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:717)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:957)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1367)
at io.sentry.connection.AsyncConnection.send(AsyncConnection.java:96)
at io.sentry.SentryClient.sendEvent(SentryClient.java:135)
at io.sentry.SentryClient.sendEvent(SentryClient.java:152)
at io.sentry.Sentry.capture(Sentry.java:215)
at io.sentry.logback.SentryAppender.append(SentryAppender.java:106)
@lorin
lorin / after breaking change
Created April 14, 2020 22:37
Change in call stacks for instantiation of keelApplication bean
createBean:517, AbstractAutowireCapableBeanFactory (org.springframework.beans.factory.support) [3]
lambda$doGetBean$0:323, AbstractBeanFactory (org.springframework.beans.factory.support)
getObject:-1, 1709321711 (org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$233)
getSingleton:222, DefaultSingletonBeanRegistry (org.springframework.beans.factory.support)
doGetBean:321, AbstractBeanFactory (org.springframework.beans.factory.support)
getBean:202, AbstractBeanFactory (org.springframework.beans.factory.support)
getBeansWithAnnotation:666, DefaultListableBeanFactory (org.springframework.beans.factory.support)
getBeansWithAnnotation:1264, AbstractApplicationContext (org.springframework.context.support)
resolve:44, SpringPackageVersionResolver (com.netflix.spinnaker.kork.version)
resolve:57, ServiceVersion (com.netflix.spinnaker.kork.version)
@lorin
lorin / bad-thread-dump-1.txt
Created April 7, 2020 21:26
Keel thread dumps
2020-04-06 17:19:04
Full thread dump OpenJDK 64-Bit Server VM (25.241-b08 mixed mode):
"default connection adder" #1166 daemon prio=5 os_prio=0 tid=0x0000000000743000 nid=0x2bdf waiting on condition [0x00007efcb3a33000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000006d204d2d0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2083)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)