Personal dotfiles for Linux, mostly for Nixpkgs/NixOS-based and Termux setups. Mirrored using GitLab's push mirroring feature. gitlab.com/andreijiroh-dev/dotfiles
linux dotfiles
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(global): stage config and scripts to version control

Including just one script from ~sircmpwn for signing release source tarballs.

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@gmail.com>

+240
+15
.config/gh/config.yml
··· 1 + # What protocol to use when performing git operations. Supported values: ssh, https 2 + git_protocol: https 3 + # What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment. 4 + editor: 5 + # When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled 6 + prompt: enabled 7 + # A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager. 8 + pager: 9 + # Aliases allow you to create nicknames for gh commands 10 + aliases: 11 + co: pr checkout 12 + # The path to a unix socket through which send HTTP connections. If blank, HTTP traffic will be handled by net/http.DefaultTransport. 13 + http_unix_socket: 14 + # What web browser gh should use when opening URLs. If blank, will refer to environment. 15 + browser:
+2
.config/glab-cli/aliases.yml
··· 1 + ci: pipeline ci 2 + co: mr checkout
+61
.config/htop/htoprc
··· 1 + # Beware! This file is rewritten by htop when settings are changed in the interface. 2 + # The parser is also very primitive, and not human-friendly. 3 + htop_version=3.2.1 4 + config_reader_min_version=3 5 + fields=0 48 17 18 38 39 40 2 46 47 49 1 6 + hide_kernel_threads=1 7 + hide_userland_threads=0 8 + shadow_other_users=0 9 + show_thread_names=0 10 + show_program_path=1 11 + highlight_base_name=0 12 + highlight_deleted_exe=1 13 + highlight_megabytes=1 14 + highlight_threads=1 15 + highlight_changes=0 16 + highlight_changes_delay_secs=5 17 + find_comm_in_cmdline=1 18 + strip_exe_from_cmdline=1 19 + show_merged_command=0 20 + header_margin=1 21 + screen_tabs=1 22 + detailed_cpu_time=0 23 + cpu_count_from_one=0 24 + show_cpu_usage=1 25 + show_cpu_frequency=0 26 + show_cpu_temperature=0 27 + degree_fahrenheit=0 28 + update_process_names=0 29 + account_guest_in_cpu_meter=0 30 + color_scheme=0 31 + enable_mouse=1 32 + delay=15 33 + hide_function_bar=0 34 + header_layout=two_50_50 35 + column_meters_0=AllCPUs Memory Swap 36 + column_meter_modes_0=1 1 1 37 + column_meters_1=Tasks LoadAverage Uptime 38 + column_meter_modes_1=2 2 2 39 + tree_view=1 40 + sort_key=46 41 + tree_sort_key=0 42 + sort_direction=-1 43 + tree_sort_direction=1 44 + tree_view_always_by_pid=0 45 + all_branches_collapsed=0 46 + screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command 47 + .sort_key=PERCENT_CPU 48 + .tree_sort_key=PID 49 + .tree_view=1 50 + .tree_view_always_by_pid=0 51 + .sort_direction=-1 52 + .tree_sort_direction=1 53 + .all_branches_collapsed=0 54 + screen:I/O=PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE 55 + .sort_key=IO_RATE 56 + .tree_sort_key=PID 57 + .tree_view=0 58 + .tree_view_always_by_pid=0 59 + .sort_direction=-1 60 + .tree_sort_direction=1 61 + .all_branches_collapsed=0
.config/systemd/.gitkeep

This is a binary file and will not be displayed.

+15
.config/systemd/user/tildeverse-vern-caddy.service
··· 1 + [Unit] 2 + Description=Make proxied services available under *-ajhalili2006.vern.cc via Caddy 3 + 4 + [Service] 5 + WorkingDirectory=/home/ajhalili2006/projects/andreijiroh.dev/tilde 6 + # in case of power loss and we still need to do this 7 + #ExecStartPre="/run/current-system/sw/bin/rm -f /home/ajhalili2006/.webserver.sock" 8 + ExecStart=/run/current-system/sw/bin/bash /home/ajhalili2006/projects/andreijiroh.dev/tilde/start-caddy-tildeserv.sh 9 + Restart=on-failure 10 + StartLimitBurst=3 11 + StartLimitInterval=90 12 + 13 + [Install] 14 + WantedBy=multi-user.target 15 +
+139
bin/backup-pgp-keys
··· 1 + #!/usr/bin/env bash 2 + 3 + # a script to generate backups for my GPG keys 4 + 5 + # literally all of active keys I use for different purposes 6 + # https://ajhalili2006.vern.cc/ 7 + DEFAULT_PRIVATE_KEYS="A30EBE40AD856D88 67BFC91B3DA12BE8 940047813E9D641C 120C218ED2291996 7067DB4C7768552F 7E4E0EF8B968A952" 8 + DEFAULT_PUBLIC_KEYS="A30EBE40AD856D88 67BFC91B3DA12BE8 940047813E9D641C 120C218ED2291996" 9 + 10 + # allow anybody to automate this via envvars 11 + PRIVATE_KEYS="${PRIVATE_KEYS:-"$DEFAULT_PRIVATE_KEYS"}" 12 + PUBLIC_KEYS="${PUBLIC_KEYS:-"$DEFAULT_PUBLIC_KEYS"}" 13 + 14 + # Command snippet taken from OpenKeychain FAQs 15 + # https://www.openkeychain.org/faq/#what-is-the-best-way-to-transfer-my-own-key-to-openkeychain 16 + BACKUP_FILE_PASSWORD=$(gpg --armor --gen-random 1 20) 17 + TIMESTAMP=$(date +%s) 18 + 19 + generate_pubkey_bak() { 20 + echo "[Stage 1]: Export all public keys per PUBLIC_KEYS to '$EXPORT_DIR/personal-$TIMESTAMP.asc'" 21 + echo 22 + sleep 3 23 + 24 + if [[ $_arg_secretkeys_only == "true" ]]; then 25 + echo "warning: Skipping because --only-secret flag is used" 26 + return 27 + fi 28 + 29 + for key in $PUBLIC_KEYS; do 30 + echo "Exporting keyid $key's public key" 31 + if [[ $_arg_dryrun == "true" ]]; then 32 + echo "+ gpg --armor --export \"$key\" >> \"$EXPORT_DIR/personal-$TIMESTAMP.asc\"" 33 + else 34 + gpg --armor --export "$key" >> "$EXPORT_DIR/personal-$TIMESTAMP.asc" 35 + fi 36 + sleep 3 37 + done 38 + } 39 + 40 + generate_privkey_bak() { 41 + echo "[Stage 2]: Export all private keys per PRIVATE_KEYS to '$EXPORT_DIR/backup-personal-$TIMESTAMP.asc'" 42 + echo 43 + sleep 3 44 + 45 + if [[ $_arg_pubkeys_only == "true" ]]; then 46 + echo "warning: Skipping because --only-public flag is used" 47 + return 48 + fi 49 + 50 + if [[ $_arg_dryrun == "true" ]]; then 51 + for key in $PRIVATE_KEYS; do 52 + echo "Exporting keyid $key with private key" 53 + echo "+ gpg --armor --export-secret-keys $key >> $EXPORT_DIR/backup-personal-$TIMESTAMP.asc" 54 + sleep 5 55 + done 56 + echo "+ gpg --batch --asymmetric --passphrase \"$BACKUP_FILE_PASSWORD\" --output \"$EXPORT_DIR/private-keys-backup-$TIMESTAMP.sec.asc\"" 57 + return 58 + fi 59 + 60 + for key in $PRIVATE_KEYS; do 61 + echo "Exporting keyid $key with private key" 62 + gpg --armor --export-secret-keys "$key" >> "$EXPORT_DIR/backup-personal-$TIMESTAMP.asc" 63 + sleep 5 64 + done 65 + echo "warning: Use the following passphrase for encrypting the private key backup in case" 66 + echo "warning: both --batch and --passphrase flags didn't work in 10 seconds below." 67 + echo "warning:" 68 + echo "warning: $BACKUP_FILE_PASSWORD" 69 + echo "warning:" 70 + sleep 10 71 + gpg --batch --asymmetric --passphrase "$BACKUP_FILE_PASSWORD" --output "$EXPORT_DIR/private-keys-backup-$TIMESTAMP.sec.asc" 72 + } 73 + 74 + check_export_dir() { 75 + echo "[Stage 0]: Check if the \$EXPORT_DIR exists and create if necessary" 76 + echo 77 + sleep 3 78 + # dry-run 79 + if [[ $_arg_dryrun == "true" ]]; then 80 + echo "+ mkdir $EXPORT_DIR" 81 + return 82 + fi 83 + 84 + if [[ ! -d "$EXPORT_DIR" ]]; then 85 + echo "warning: Directory $EXPORT_DIR doesn't exist, attempting to create dir..." 86 + if mkdir "$EXPORT_DIR"; then 87 + true 88 + else 89 + error_code=$? 90 + echo "error: Something gone horribly wrong while creating export directory." 91 + echo "error: Check the logs, fix perms with chmod/chown/sudo and try again." 92 + exit $error_code 93 + fi 94 + else 95 + echo "info: export directory exists, contiuning..." 96 + fi 97 + } 98 + 99 + usage() { 100 + echo "USAGE: [EXPORT_DIR=\$(pwd)] $0 [--only-public | --only-secret | --dry-run]" 101 + } 102 + 103 + main() { 104 + if [[ $DEBUG != "" ]]; then 105 + set -x 106 + fi 107 + 108 + _arg_pubkeys_only=false 109 + _arg_secretkeys_only=false 110 + _arg_dryrun=false 111 + EXPORT_DIR=${EXPORT_DIR:-"$HOME/.export-toolkit"} 112 + 113 + # arg parser goes here 114 + for _arg in "${@}"; do { 115 + if test "$_arg" != "--" && [[ "$_arg" == -* ]]; then { 116 + case "$_arg" in 117 + --help | -h) 118 + usage; exit 0 119 + ;; 120 + --public-keys-only | --pubkeys | --only-public | -p) 121 + _arg_pubkeys_only=true 122 + ;; 123 + --private-keys-only | --secretkeys | --only-secret | -s) 124 + _arg_secretkeys_only=true 125 + ;; 126 + --dryrun | --dry-run | -d) 127 + _arg_dryrun=true 128 + ;; 129 + esac 130 + shift; 131 + } fi 132 + } done 133 + 134 + check_export_dir 135 + generate_pubkey_bak 136 + generate_privkey_bak 137 + } 138 + 139 + main "$@"
+8
bin/sign-tarball
··· 1 + #!/bin/sh 2 + project="$(basename $(pwd))" 3 + version="$(git describe)" 4 + 5 + git archive --format=tar.gz --prefix="$project-$version/" "$version" \ 6 + >"$project-$version.tar.gz" 7 + gpg --detach-sign "$@" --default-key 940047813E9D641C "$project-$version.tar.gz" \ 8 + >/tmp/"$project-$version".tar.gz.sig