Select the types of activity you want to include in your feed.
Personal dotfiles for Linux, mostly for Nixpkgs/NixOS-based and Termux setups. Mirrored using GitLab's push mirroring feature.
gitlab.com/andreijiroh-dev/dotfiles
···11+# What protocol to use when performing git operations. Supported values: ssh, https
22+git_protocol: https
33+# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.
44+editor:
55+# When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled
66+prompt: enabled
77+# A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager.
88+pager:
99+# Aliases allow you to create nicknames for gh commands
1010+aliases:
1111+ co: pr checkout
1212+# The path to a unix socket through which send HTTP connections. If blank, HTTP traffic will be handled by net/http.DefaultTransport.
1313+http_unix_socket:
1414+# What web browser gh should use when opening URLs. If blank, will refer to environment.
1515+browser:
···11+[Unit]
22+Description=Make proxied services available under *-ajhalili2006.vern.cc via Caddy
33+44+[Service]
55+WorkingDirectory=/home/ajhalili2006/projects/andreijiroh.dev/tilde
66+# in case of power loss and we still need to do this
77+#ExecStartPre="/run/current-system/sw/bin/rm -f /home/ajhalili2006/.webserver.sock"
88+ExecStart=/run/current-system/sw/bin/bash /home/ajhalili2006/projects/andreijiroh.dev/tilde/start-caddy-tildeserv.sh
99+Restart=on-failure
1010+StartLimitBurst=3
1111+StartLimitInterval=90
1212+1313+[Install]
1414+WantedBy=multi-user.target
1515+
+139
bin/backup-pgp-keys
···11+#!/usr/bin/env bash
22+33+# a script to generate backups for my GPG keys
44+55+# literally all of active keys I use for different purposes
66+# https://ajhalili2006.vern.cc/
77+DEFAULT_PRIVATE_KEYS="A30EBE40AD856D88 67BFC91B3DA12BE8 940047813E9D641C 120C218ED2291996 7067DB4C7768552F 7E4E0EF8B968A952"
88+DEFAULT_PUBLIC_KEYS="A30EBE40AD856D88 67BFC91B3DA12BE8 940047813E9D641C 120C218ED2291996"
99+1010+# allow anybody to automate this via envvars
1111+PRIVATE_KEYS="${PRIVATE_KEYS:-"$DEFAULT_PRIVATE_KEYS"}"
1212+PUBLIC_KEYS="${PUBLIC_KEYS:-"$DEFAULT_PUBLIC_KEYS"}"
1313+1414+# Command snippet taken from OpenKeychain FAQs
1515+# https://www.openkeychain.org/faq/#what-is-the-best-way-to-transfer-my-own-key-to-openkeychain
1616+BACKUP_FILE_PASSWORD=$(gpg --armor --gen-random 1 20)
1717+TIMESTAMP=$(date +%s)
1818+1919+generate_pubkey_bak() {
2020+ echo "[Stage 1]: Export all public keys per PUBLIC_KEYS to '$EXPORT_DIR/personal-$TIMESTAMP.asc'"
2121+ echo
2222+ sleep 3
2323+2424+ if [[ $_arg_secretkeys_only == "true" ]]; then
2525+ echo "warning: Skipping because --only-secret flag is used"
2626+ return
2727+ fi
2828+2929+ for key in $PUBLIC_KEYS; do
3030+ echo "Exporting keyid $key's public key"
3131+ if [[ $_arg_dryrun == "true" ]]; then
3232+ echo "+ gpg --armor --export \"$key\" >> \"$EXPORT_DIR/personal-$TIMESTAMP.asc\""
3333+ else
3434+ gpg --armor --export "$key" >> "$EXPORT_DIR/personal-$TIMESTAMP.asc"
3535+ fi
3636+ sleep 3
3737+ done
3838+}
3939+4040+generate_privkey_bak() {
4141+ echo "[Stage 2]: Export all private keys per PRIVATE_KEYS to '$EXPORT_DIR/backup-personal-$TIMESTAMP.asc'"
4242+ echo
4343+ sleep 3
4444+4545+ if [[ $_arg_pubkeys_only == "true" ]]; then
4646+ echo "warning: Skipping because --only-public flag is used"
4747+ return
4848+ fi
4949+5050+ if [[ $_arg_dryrun == "true" ]]; then
5151+ for key in $PRIVATE_KEYS; do
5252+ echo "Exporting keyid $key with private key"
5353+ echo "+ gpg --armor --export-secret-keys $key >> $EXPORT_DIR/backup-personal-$TIMESTAMP.asc"
5454+ sleep 5
5555+ done
5656+ echo "+ gpg --batch --asymmetric --passphrase \"$BACKUP_FILE_PASSWORD\" --output \"$EXPORT_DIR/private-keys-backup-$TIMESTAMP.sec.asc\""
5757+ return
5858+ fi
5959+6060+ for key in $PRIVATE_KEYS; do
6161+ echo "Exporting keyid $key with private key"
6262+ gpg --armor --export-secret-keys "$key" >> "$EXPORT_DIR/backup-personal-$TIMESTAMP.asc"
6363+ sleep 5
6464+ done
6565+ echo "warning: Use the following passphrase for encrypting the private key backup in case"
6666+ echo "warning: both --batch and --passphrase flags didn't work in 10 seconds below."
6767+ echo "warning:"
6868+ echo "warning: $BACKUP_FILE_PASSWORD"
6969+ echo "warning:"
7070+ sleep 10
7171+ gpg --batch --asymmetric --passphrase "$BACKUP_FILE_PASSWORD" --output "$EXPORT_DIR/private-keys-backup-$TIMESTAMP.sec.asc"
7272+}
7373+7474+check_export_dir() {
7575+ echo "[Stage 0]: Check if the \$EXPORT_DIR exists and create if necessary"
7676+ echo
7777+ sleep 3
7878+ # dry-run
7979+ if [[ $_arg_dryrun == "true" ]]; then
8080+ echo "+ mkdir $EXPORT_DIR"
8181+ return
8282+ fi
8383+8484+ if [[ ! -d "$EXPORT_DIR" ]]; then
8585+ echo "warning: Directory $EXPORT_DIR doesn't exist, attempting to create dir..."
8686+ if mkdir "$EXPORT_DIR"; then
8787+ true
8888+ else
8989+ error_code=$?
9090+ echo "error: Something gone horribly wrong while creating export directory."
9191+ echo "error: Check the logs, fix perms with chmod/chown/sudo and try again."
9292+ exit $error_code
9393+ fi
9494+ else
9595+ echo "info: export directory exists, contiuning..."
9696+ fi
9797+}
9898+9999+usage() {
100100+ echo "USAGE: [EXPORT_DIR=\$(pwd)] $0 [--only-public | --only-secret | --dry-run]"
101101+}
102102+103103+main() {
104104+ if [[ $DEBUG != "" ]]; then
105105+ set -x
106106+ fi
107107+108108+ _arg_pubkeys_only=false
109109+ _arg_secretkeys_only=false
110110+ _arg_dryrun=false
111111+ EXPORT_DIR=${EXPORT_DIR:-"$HOME/.export-toolkit"}
112112+113113+ # arg parser goes here
114114+ for _arg in "${@}"; do {
115115+ if test "$_arg" != "--" && [[ "$_arg" == -* ]]; then {
116116+ case "$_arg" in
117117+ --help | -h)
118118+ usage; exit 0
119119+ ;;
120120+ --public-keys-only | --pubkeys | --only-public | -p)
121121+ _arg_pubkeys_only=true
122122+ ;;
123123+ --private-keys-only | --secretkeys | --only-secret | -s)
124124+ _arg_secretkeys_only=true
125125+ ;;
126126+ --dryrun | --dry-run | -d)
127127+ _arg_dryrun=true
128128+ ;;
129129+ esac
130130+ shift;
131131+ } fi
132132+ } done
133133+134134+ check_export_dir
135135+ generate_pubkey_bak
136136+ generate_privkey_bak
137137+}
138138+139139+main "$@"