Skip to content

Instantly share code, notes, and snippets.

View chrisxaustin's full-sized avatar

Chris Austin chrisxaustin

  • Somerville, MA, US
View GitHub Profile
@chrisxaustin
chrisxaustin / WithReactor.java
Created January 20, 2022 15:16
Batching with Flux
package example;
import lombok.extern.slf4j.Slf4j;
import reactor.core.publisher.Flux;
import reactor.core.scheduler.Scheduler;
import reactor.core.scheduler.Schedulers;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
@chrisxaustin
chrisxaustin / WithSemaphore.java
Created January 20, 2022 00:01
Semaphore example
package example;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.LongAdder;
import java.util.stream.IntStream;
@chrisxaustin
chrisxaustin / userdata
Created June 8, 2020 18:52
userdata script to mount i3, i3en, and d2 instance storage on eks elasticsearch workers
#!/bin/bash
set -o xtrace
echo '* - nofile 65536' >> /etc/security/limits.conf
echo 'root - nofile 65536' >> /etc/security/limits.conf
echo "session required pam_limits.so" >> /etc/pam.d/common-session
echo 'vm.max_map_count=262144' >> /etc/sysctl.conf
# Identify the ephemeral volumes using either the nvme command for i3 disks or lsblk and the AWS API to query block device mappings
# https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-instance-store-volumes/
@chrisxaustin
chrisxaustin / list-k8s-nodes
Last active November 24, 2024 14:48
list kubernetes nodes, family, and kubelet version
kubectl get node -o json | jq -r '.items[] | .metadata.name + " - " + .metadata.labels.family + " - " + .status.nodeInfo.kubeletVersion'
@chrisxaustin
chrisxaustin / gist:d30df3527f35f02c3f27d42e90f5f27f
Created February 23, 2019 19:43
Troubleshooting Maven ECR access with Docker Toolbox on Windows 10
Remove the credsStore line from ~/.docker/config.json
This worked fine for me with Docker Desktop, but stopped working with Docker Toolbox
~/.m2/settings.xml
Update with the token from `aws ecr get-login --no-include-email`
Ugly solution but it works.
If that doesn't work, try restarting docker toolbox:
docker-machine stop
docker-machine start
@chrisxaustin
chrisxaustin / start minikube
Last active January 9, 2019 15:17
start minikube on windows with hyper-v
minikube start --vm-driver hyperv --hyperv-virtual-switch "minikube" -v=10
# Also needed to add an external "minikube" virtual switch
# Network performance was poor until I updated my wireless network driver
@chrisxaustin
chrisxaustin / headers.py
Last active November 24, 2024 14:58
Saltstack module to clean out /boot and call pkg.autoremove
import logging
import os
from glob import glob
from distutils.version import LooseVersion
log = logging.getLogger(__name__)
def __virtual__():
'''
Restrict this to Ubuntu minions
@chrisxaustin
chrisxaustin / lsof-deleted
Created May 18, 2017 16:06
lsof command to show deleted files
lsof -a +L1 / | grep deleted | wc -l
@chrisxaustin
chrisxaustin / tshark-syslog
Last active October 9, 2024 23:05
tshark - extract src and syslog message
# To read foo.pcap
tshark -ln -r foo.pcap -q -d udp.port==514,syslog -T fields -E separator=" " -e ip.src -e syslog.msg
# To listen on eth0
tshark -ln -i eth0 -q -d udp.port==514,syslog -T fields -E separator=" " -e ip.src -e syslog.msg
@chrisxaustin
chrisxaustin / dns-fix
Created June 20, 2016 21:05
osx - reload dns service
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist