This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
org=foo | |
gh api --paginate -H "Accept: application/vnd.github+json" -X GET -F include=git /orgs/$org/audit-log | jq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
org=foo | |
repo=$1 | |
gh api --paginate -H "Accept: application/vnd.github+json" /repos/$org/$repo/commits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 '.[]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
org=foo | |
gh api --paginate -H "Accept: application/vnd.github+json" /orgs/$org/repos | jq -r '.[] | .name' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/ |
NewerOlder