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 / 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 / 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 / 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;
export TFENV_ARCH=arm64
alias tf=terraform
alias tfi='terraform init'
alias tfia='terraform init && terraform apply'
alias tfa='terraform apply'
alias tfaa='terraform apply -auto-approve'
alias mvcd='mvn versions:set && mvn clean deploy -DskipTests'
alias mcd='mvn clean deploy -DskipTests'
alias gsps='git stash && git pull && git stash apply'
This file has been truncated, but you can view the full file.
alerts-es-hot-0
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
ESTAB 0 0 172.16.54.28:39108 172.16.45.112:9300 timer:(keepalive,2min41sec,0) uid:1000 ino:3039544091 sk:1 <->
ts sack cubic wscale:7,7 rto:204 rtt:2.106/3.232 ato:40 mss:8949 pmtu:9001 rcvmss:8949 advmss:8949 cwnd:10 ssthresh:26 bytes_sent:443922732 bytes_retrans:42576 bytes_acked:443880157 bytes_received:433237555 segs_out:322679 segs_in:191894 data_segs_out:177343 data_segs_in:179809 send 339943020bps lastsnd:2172 lastrcv:2172 lastack:2172 pacing_rate 679684328bps delivery_rate 3029505560bps delivered:177344 busy:206368ms retrans:0/11 dsack_dups:11 rcv_rtt:1 rcv_space:251134 rcv_ssthresh:1104828 minrtt:0.186
ES
set maxmempattern=30000
set nocompatible
set nowrap
set noswapfile
set background=dark
set ai
set ts=2
set shiftwidth=2
set et
set textwidth=0
#!/bin/bash
org=foo
gh api --paginate -H "Accept: application/vnd.github+json" /orgs/$org/repos | jq -r '.[] | .name'
#!/bin/bash
org=foo
$repo=$1
gh api --paginate -XGET -H "Accept: application/vnd.github+json" -f 'state=all' /repos/$org/$repo/pulls | jq -r '.[]'
@chrisxaustin
chrisxaustin / list-commits
Last active November 24, 2024 14:46
List github commits for a repo
#!/bin/bash
org=foo
repo=$1
gh api --paginate -H "Accept: application/vnd.github+json" /repos/$org/$repo/commits
@chrisxaustin
chrisxaustin / list-contrib
Last active November 24, 2024 14:45
List the github contributors for a repo using the stats/contributors api.
#!/bin/bash
org=foo
pause=2
retries=6
for repo in $(./repos|sort); do
out=stats/contrib/$repo
for i in 1 2 3 4 5 6; do
gh api --paginate -H "Accept: application/vnd.github+json" /repos/$org/$repo/stats/contributors | jq > $out
lines=$(cat $out | wc -l)
if [[ $lines -gt 2 ]]; then