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
···3535export EDITOR=nano
3636# For compartibility reasons and not to fuck things up on ~/go/bin.
3737# Custom path might be also on ~/.env too?
3838-export PATH="$DOTFILES_BIN:$HOME/go/bin:$HOME/.local/bin:$GOPATH/bin:$PATH"
3938# It would be nice if I would work on self-hosted reimplementation of
4039# proxy.golang.org, but in meanwhile, you need to fuck off Google on this.
4140# (Fucking Facebook and Microsoft off your lives are also hard too ICYMI.)
···1414# on my public GPG key btw, so YOLO it.
1515export DEBEMAIL="ajhalili2006@gmail.com"
16161717+# Customized PATH + Jetbrains Toolbox
1818+export PATH="$DOTFILES_BIN:$HOME/go/bin:$HOME/.local/bin:$GOPATH/bin:$PATH:$HOME/.local/share/JetBrains/Toolbox/scripts"
1919+1720##########################################################################################
1821# Code snippets from https://git.sr.ht/~sircmpwn/dotfiles/tree/db5945a4/item/.env
1922##########################################################################################
+6
.profile
···1313# then import the rest
1414source "$HOME/.env"
1515source "$HOME/.config/aliases"
1616+export POSIX_PROFILE_SOURCED=true
1717+1818+1919+# Added by Toolbox App
2020+export PATH="$PATH:/home/ajhalili2006/.local/share/JetBrains/Toolbox/scripts"
2121+
+25
bin/fix-wrong-emails
···11+#!/bin/bash
22+33+if [[ $1 != "" ]]; then
44+ git filter-branch --env-filter '
55+ WRONG_EMAIL=$1
66+ NEW_NAME="Andrei Jiroh Eugenio Halili"
77+ NEW_EMAIL="andreijiroh@madebythepins.tk"
88+99+ if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
1010+ then
1111+ export GIT_COMMITTER_NAME="$NEW_NAME"
1212+ export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
1313+ fi
1414+ if [ "$GIT_AUTHOR_EMAIL" = "$WRONG_EMAIL" ]
1515+ then
1616+ export GIT_AUTHOR_NAME="$NEW_NAME"
1717+ export GIT_AUTHOR_EMAIL="$NEW_EMAIL"
1818+ fi
1919+ ' --tag-name-filter cat -- --branches --tags
2020+else
2121+ echo "Usage $0 <wrong-email@host.me>"
2222+ echo "Easily fix wrong emails in Git commit history. It is advised to use this script only"
2323+ echo "on non-public commits, since this might be distaterous for forks to pull any changes"
2424+ echo "in the public commits."
2525+fi
+92
bin/open-editor
···11+#!/bin/env bash
22+33+# SPDX-License-Identifier: MPL-2.0
44+# An bloody script for opening text editors from the command line via $EDITOR and
55+# command flags, work in progress and probably abandoned.
66+77+# shellcheck disable=SC2034
88+VSCODE_PATH=$(command -v code) # TODO: Add PATH detection for VS Code Desktop+Server/OpenVSCode Server/VSCodium/code-server
99+NANO_PATH=$(command -v nano)
1010+VI_PATH=$(command -v vi) # maybe neovim?
1111+OPEN_EDITOR_LOCKFILE=$HOME/.dotfiles/config/open-editor
1212+1313+if [[ $1 == "" ]]; then
1414+ echo "open-editor: Want to learn more how to use me? Use the '--help' flag to see the docs."
1515+ exit
1616+fi
1717+1818+# Stack Overflow: https://stackoverflow.com/questions/7069682/how-to-get-arguments-with-flags-in-bash#21128172
1919+while test $# -gt 0; do
2020+ case "$1" in
2121+ -h|--help)
2222+ echo "$0 - shortcut to open editors within and from command line"
2323+ echo "By default, the script will attempt to guess what text editor to use as much"
2424+ echo "as possible. You can lock with the ~/.dotfiles/config/open-editor file."
2525+ echo
2626+ echo "$0 [options] filename"
2727+ echo " "
2828+ echo "options:"
2929+ echo "-h, --help show brief help"
3030+ echo "-c, --use-code use Visual Studio Code, with the 'wait' flag"
3131+ echo "-n, --use-nano use GNU Nano"
3232+ echo "--lockfile Generate a lockfile within your home directory"
3333+ echo " or edit if found."
3434+ exit 0
3535+ ;;
3636+ -c|--use-code)
3737+ shift
3838+ echo "open-editor: Firing up your editor, please wait..."
3939+ sleep 3
4040+ if test $# -gt 0; then
4141+ # shellcheck disable=SC2086
4242+ code --wait $1
4343+ else
4444+ echo "error: no file specified, aborting..."
4545+ exit 1
4646+ fi
4747+ shift
4848+ ;;
4949+ -n|--use-nano)
5050+ shift
5151+ echo "open-editor: Firing up your editor, please wait..."
5252+ sleep 3
5353+ if test $# -gt 0; then
5454+ # shellcheck disable=SC2086
5555+ nano $1
5656+ exit
5757+ fi
5858+ shift
5959+ ;;
6060+ --lockfile)
6161+ shift
6262+ if test $# -gt 0; then
6363+ export OUTPUT=$1
6464+ else
6565+ echo "no output dir specified"
6666+ exit 1
6767+ fi
6868+ shift
6969+ ;;
7070+ -*)
7171+ echo "open-editor: Unsupported flag, edit the script file to customize."
7272+ exit 1
7373+ ;;
7474+ esac
7575+done
7676+7777+if [[ $VSCODE_PATH != "" ]]; then
7878+ echo "open-editor: Firing up your editor, please wait..."
7979+ sleep 3
8080+ code --wait "$1"
8181+ exit
8282+elif [[ $NANO_PATH != "" ]]; then
8383+ echo "open-editor: Firing up your editor, please wait..."
8484+ sleep 3
8585+ nano "$1"
8686+ exit
8787+else
8888+ echo "open-editor: Firing up your editor, please wait..."
8989+ sleep 3
9090+ vi "$1"
9191+ exit
9292+fi
+36
bin/setup-chroot
···11+#!/usr/bin/bash
22+33+# Chroot command is optional and assume login binary
44+CHROOT_COMMAND=${2:-"/usr/bin/login"}
55+TARGET_DIR=$1
66+77+if [[ $TARGET_DIR == "" ]]; then
88+ echo "Usage: $0 TARGET_DIR [CHROOT_COMMAND]"
99+ exit 1
1010+fi
1111+1212+if [ $EUID != "0" ]; then
1313+ echo "error: Must be root to proceed!"
1414+ exit 1
1515+fi
1616+1717+echo "===> Mounting required parts for chroot operation..."
1818+mount -o bind /dev "$TARGET_DIR/dev"
1919+mount -t proc none "$TARGET_DIR/proc"
2020+mount -o bind /sys "$TARGET_DIR/sys"
2121+echo " Kernel and device mount setup done!"
2222+sleep 3
2323+2424+if [[ -f "$TARGET_DIR/setup-chroot-env.sh" ]]; then
2525+ echo "===> Preparing chroot environment..."
2626+ if ! bash "$TARGET_DIR/setup-chroot-env.sh"; then
2727+ echo "! Chroot env setup failed, please proceed at your own risk."
2828+ else
2929+ echo " Setup done!"
3030+ fi
3131+ sleep 3
3232+fi
3333+3434+echo "===> Teleporting to the chroot environment in 3 seconds..."
3535+sleep 3
3636+exec chroot "$TARGET_DIR" ${CHROOT_COMMAND}
+8
bin/update-discord
···11+#!/bin/bash
22+set -e
33+44+# An script to automate upgrading Discord via the deb download link.
55+# TODO:Implement checks and flags to support for rpms and tar.gz setups
66+77+wget "https://discord.com/api/download?platform=linux&format=deb" -O /tmp/discord-linux-amd64.deb
88+sudo apt install /tmp/discord-linux-amd64.deb