gh api graphql --paginate \
--jq '.data.organization.repositories.nodes[] | .defaultBranchRef.name + "\t" + .name' \
-F org=SomeOrg \
-f query='
query($org:String!, $endCursor:String) {
organization(login:$org) {
repositories(first: 100, after: $endCursor, isFork:false, orderBy: {field:NAME, direction:ASC}) {
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
fragment branchProtection on BranchProtectionRule { | |
allowsDeletions | |
allowsForcePushes | |
creator { | |
login | |
} | |
id | |
isAdminEnforced | |
requiredStatusCheckContexts | |
requiredApprovingReviewCount |
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
sudo ufw allow in on zcctun0 proto any from 10.0.0.0/8 to 100.64.0.1 port 9000 | |
sudo ufw allow in on zcctun0 proto any from 100.64.0.0/16 to 100.64.0.1 port 9000 | |
sudo ufw allow in on zcctun0 proto any from 100.64.0.0/16 to 100.64.0.1 port 9010 | |
sudo ufw allow in on zcctun0 proto udp from 100.64.0.0/16 to 100.64.0.1 |
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 -euo pipefail | |
IFS=$'\n\t' | |
if (( $# != 1 )); then | |
echo "This script takes 1 argument, the GitHub org name" >&2 | |
exit 1 | |
fi |
Run this at the root of a golang project, where it contains a go.mod
file.
Here is how to get the graph for the karpenter project:
cd /tmp
gh clone aws/karpenter
cd karpenter
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 | |
# Use docker to run the aws cli. | |
# This bash script can be put anywhere on your $PATH. | |
# Inspired from https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-docker.html | |
AWS_CLI_VERSION=2.8.6 | |
debug() { | |
if [[ -n ${AWS_CONTAINER_DEBUG} ]]; 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
package main | |
import ( | |
"fmt" | |
"os" | |
) | |
func forEachInRange(start, end int, title string, callback func(int)) { | |
if start > end { | |
fmt.Fprintf(os.Stderr, "start %q must be smaller than end %q", start, end) |
To install zscaler on Pop!_OS 22.04, download the connector from the admin zscaler site by clicking the Client Connector link on the sidebar, then clicking Client Connector App Store, New Releases, Linux and download 1.4.0.105.
Before installing, you must temporarily replace your /etc/os-release file:
cd /etc
sudo mv os-release os-release.old
sudo cat <<EOF >> os-release
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
Sometimes in the course of your job you might need to approve a bunch of pull requests that were automatically created.
The gh
cli is a handy tool to simplify this process.
In this example we'll approve all pull requests in the Foo
org that request you as a reviewer and contains autoscaling
:
for PR_URL in $(gh search prs org:Foo --review-requested @me --state open autoscaling --json url --jq ".[].url"); do
echo $PR_URL
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 | |
# Strict mode | |
set -euo pipefail | |
if [ $# -ne 3 ]; then | |
echo "Usage: $0 <helm_release_name> <old_api_version> <new_api_version>" | |
exit 1 | |
fi |