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 / 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 / gist:d040734702a2d0062decc50c1d4c3772
Created May 21, 2020 19:35
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 / 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'
::: {alerts-es-hot-4}{-EeyMsEySdWaOrqgjuNvWg}{zxIWclJrTv6cLY8eqPrRYQ}{172.16.19.193}{172.16.19.193:9300}{hir}{k8s_node_name=ip-172-16-19-230.us-east-2.compute.internal, xpack.installed=true, data=hot, transform.node=false}
Hot threads at 2023-05-23T17:43:16.187Z, interval=500ms, busiestThreads=9999, ignoreIdleThreads=true:
61.5% [cpu=61.5%, other=0.0%] (307.6ms out of 500ms) cpu usage by thread 'elasticsearch[alerts-es-hot-4][[alerts-redacted-traffic-000052][0]: Lucene Merge Thread #218]'
2/10 snapshots sharing following 15 elements
app//org.apache.lucene.index.MultiTermsEnum.postings(MultiTermsEnum.java:359)
app//org.apache.lucene.index.MappedMultiFields$MappedMultiTermsEnum.postings(MappedMultiFields.java:127)
app//org.apache.lucene.codecs.PushPostingsWriterBase.writeTerm(PushPostingsWriterBase.java:127)
app//org.apache.lucene.codecs.blocktree.BlockTreeTermsWriter$TermsWriter.write(BlockTreeTermsWriter.java:907)
app//org.apache.lucene.codecs.blocktree.BlockT
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'