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 -e | |
# aws-run | |
# Usage: aws-run <profile-name> -- <command> | |
# | |
# To use this script with AWS IAM Identity Center user credentials, follow this guide: | |
# https://docs.aws.amazon.com/singlesignon/latest/userguide/howtogetcredentials.html#how-to-get-temp-credentials-automatic | |
# | |
# When asked for the CLI profile name, choose one that you don't mind typing | |
# every time you run a command. |
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
function git-read-branch() { | |
git ls-tree -r $1 | grep $2 | awk '{print $3}' | xargs git cat-file blob | |
} |
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 | |
# | |
# gh-dl-release! It works! | |
# | |
# This script downloads an asset from latest or specific Github release of a | |
# private repo. Feel free to extract more of the variables into command line | |
# parameters. | |
# | |
# PREREQUISITES | |
# |
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
B2_ACCOUNT_ID=XXXXXXXXXXXXXXXXXXXXXXXXX | |
B2_ACCOUNT_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
RESTIC_REPOSITORY=b2:XXXXXXXXXXXXXXXXXX:/ | |
RESTIC_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
BACKUP_PATHS="/home/naomi.nagata" | |
BACKUP_EXCLUDES="--exclude-file /home/rupert/.restic_excludes --exclude-if-present .exclude_from_backup" | |
RETENTION_DAYS=7 | |
RETENTION_WEEKS=4 |
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
http { | |
log_format json_combined escape=json | |
'{' | |
'"ts":"$time_iso8601",' | |
'"remote_addr":"$remote_addr",' | |
'"remote_user":"$remote_user",' | |
'"request_time":"$request_time",' | |
'"request":{' | |
'"http_referrer":"$http_referer",' | |
'"http_user_agent":"$http_user_agent",' |
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
export interface Result<T> { | |
success: true | |
data: T | |
} | |
export interface InternalError { | |
success: false | |
user: false | |
error: string | |
} |
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
#!/usr/bin/bash -xe | |
cat <<EOF > "${HOME}/.config/systemd/user/zoom.slice" | |
[Slice] | |
AllowedCPUs=0-4 | |
MemoryHigh=6G | |
EOF | |
cat /usr/share/applications/Zoom.desktop | sed -E 's#^(Exec=).*$#Exec=/usr/bin/systemd-run --user --slice=zoom.slice /opt/zoom/ZoomLauncher#' > "${HOME}/.local/share/applications/Zoom.desktop" |
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 dsn | |
type DSN string | |
func (d DSN) String() string { | |
i := strings.Index(string(d), "&password=") | |
if i == -1 { | |
return string(d) | |
} | |
ret := []byte(d) |
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 ( | |
"bufio" | |
"fmt" | |
"net/http" | |
_ "net/http/pprof" | |
"os" | |
"reflect" | |
"runtime" |
NewerOlder