Skip to content

Instantly share code, notes, and snippets.

View chrisxaustin's full-sized avatar

Chris Austin chrisxaustin

  • Somerville, MA, US
View GitHub Profile
#!/bin/bash
org=foo
gh api --paginate -H "Accept: application/vnd.github+json" -X GET -F include=git /orgs/$org/audit-log | jq -r '.[] | select(.action=="git.clone" and .actor!="github-actions[bot]" and .actor!="dependabot[bot]") | [.actor, .action, .repo, .programmatic_access_type] | @tsv'
#!/bin/bash
org=foo
gh api --paginate -H "Accept: application/vnd.github+json" -X GET -F include=git /orgs/$org/audit-log | jq
#!/opt/homebrew/bin/python3
import re
import json
import sys
import datetime
for filename in sys.argv[1:]:
with open(filename, 'r') as fh:
repo = re.split(r'/', filename)[-1]
raw = fh.read()
#!/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
#!/bin/bash
org=foo
repo=$1
gh api --paginate -H "Accept: application/vnd.github+json" /repos/$org/$repo/commits
#!/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 '.[]'
#!/bin/bash
org=foo
gh api --paginate -H "Accept: application/vnd.github+json" /orgs/$org/repos | jq -r '.[] | .name'
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
@chrisxaustin
chrisxaustin / tshark-syslog
Last active October 5, 2023 14:35
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 - eth0 -q -d udp.port==514,syslog -T fields -E separator=" " -e ip.src -e syslog.msg
@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/