Skip to content

Instantly share code, notes, and snippets.

beep boop

Daniel Douglas ormaaj

beep boop
View GitHub Profile
View profile.bash
# /etc/profile
if ${BASH_VERSION+\:} \false; then
\shopt -s extglob lastpipe expand_aliases
\shopt -u assoc_expand_once
\set -o vi +o histexpand
\alias unset2=unset
ormaaj / .py
Created Jul 19, 2022
In _hash_filter._apply_hash_filter()
View .py
(ins)root@ormaaj-laptop (3852812) /home/ormaaj # PATH=$(readlink -sne ~ormaaj/doc/programs/portage/bin):${PATH##+(:)} PYTHONPATH=$(readlink -sne ~ormaaj/doc/programs/portage/lib):${PYTHONPATH##+(:)} NOLTO= NOGRAPHITE= NOGRAPHITE2= emerge -j 1 -bav dev-lang/python
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ] dev-lang/python [3.11.0_beta4-r2:3.11::gentoo] USE="bluetooth examples gdbm ncurses readline sqlite ssl -build -hardened -libedit -lto -pgo -test -tk -verify-sig -wininst" 0 KiB
Total: 1 package (1 reinstall), Size of downloads: 0 KiB
Would you like to merge these packages? [Yes/No]
ormaaj / .bash
Created Jun 22, 2022
run gpg-agent
View .bash
function setupGpgAgent {
# gpg-agent uses .gnupg but will not create the directory itself for new users.
if ! { [[ -d ~/.gnupg ]] || mkdir -p -- ~/.gnupg; }; then
printf 'bashrc: %s\n' 'No ~/.gnupg directory exists and failed to create it.' >&2
return 0
if [[ -t 0 ]] && { GPG_TTY=$(readlink -sne /dev/fd/0) || GPG_TTY=$(tty); }; then
export GPG_TTY
View dircolors.bash
function setupDirColors {
if [[ ${FUNCNAME[0]} == "${FUNCNAME[1]}" ]]; then
typeset -n LS_COLORS=$1
typeset dirc
if dirc=$("$(type -P dircolors 2>/dev/null)" -b); then
alias export=:; eval "$dirc"; unalias export
typeset colors ret
if ! shopt -q expand_aliases; then
View init.bash
if [[ ${KSH_VERSION+${!KSH_VERSION}} == .sh.version ]]; then
typeset -n
if builtin pids 2>/dev/null; then
function BASHPID.get { .sh.value=$(pids -f '%(pid)d'); }
elif [[ -r /proc/self/stat ]]; then
function BASHPID.get { read -r .sh.value _ </proc/self/stat; }
View .xinitrc
shopt -s extglob lastpipe
shopt -u assoc_expand_once
function xinitrc_main {
typeset myRootPath
if myRootPath=$(dirname "$(readlink -sne -- "${BASH_SOURCE[0]}")") && [[ -d $myRootPath ]]; then
source "${myRootPath}/shell/functions"
ormaaj / .bash
Last active Sep 23, 2022
builtin loader
View .bash
shopt -s lastpipe extglob globstar
shopt -u assoc_expand_once
function initializeBuiltins {
typeset -a a
typeset x y z
set +m
typeset libdir=${fsRoot%%+(/)}/usr/lib64
[[ -d ${libdir}/bash ]] || libdir=${rootPath%%+(/)}/lib64
View filemerge.ksh
typeset -T FileComparer=(
typeset src dst
typeset -a mv diff rm
compound _=(
_Bool unpackComplete=false
_Bool scanComplete=false
ormaaj / minecraft.bash
Created Dec 4, 2021
minecraft function
View minecraft.bash
# Stupid game.
# minecraft -c | -s [ -p ]
function minecraft {
typeset \
jvm=${JAVA_HOME}/bin/java \
worldPath=~/doc/mcdata2 \
serverPath=~/doc/programs/ServerJarStorage/Release\ 1.8/minecraft_server.jar \
View fixperms.bash
# Quickly adds world read permissions to files and world read/write permissions
# to directories recursively. «-u user[:group]» will additionally chmod files
# and directories recursively.
function fixperms {
typeset -a paths
typeset chownUserGroup
until ${1+'false'}; do
case $1 in