2019-11-23 19:46:58 +00:00
|
|
|
|
|
|
|
indicator()
|
|
|
|
{
|
|
|
|
if [ $(whoami) != root ]; then
|
|
|
|
echo "%"
|
|
|
|
else echo "#"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-03-02 03:13:12 +00:00
|
|
|
export GTK_THEME=steppenwolf-dark
|
|
|
|
export GPG_TTY=$(tty)
|
|
|
|
export VISUAL=micro
|
|
|
|
export EDITOR=micro
|
|
|
|
export BROWSER=firefox
|
|
|
|
export MICRO_TRUECOLOR=1
|
|
|
|
if [ "$TERM" = "dumb" ]; then
|
|
|
|
PS1='$(indicator) '
|
|
|
|
else
|
|
|
|
PS1='\033]0;$(whoami)@$(hostname): ${PWD}\007[ $(hostname): ${PWD} ]\n$(indicator) '
|
|
|
|
fi
|
|
|
|
bind -m '^L'='^C'clear'^J'
|
|
|
|
|
2019-11-23 19:46:58 +00:00
|
|
|
silence()
|
|
|
|
{
|
|
|
|
"$@" > /dev/null & exit
|
|
|
|
}
|
|
|
|
|
|
|
|
search()
|
|
|
|
{
|
2021-03-02 03:13:12 +00:00
|
|
|
$BROWSER https://duckduckgo.com/?q="$*" > /dev/null & exit
|
2019-11-23 19:46:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
acmeInit()
|
|
|
|
{
|
2021-03-02 03:13:12 +00:00
|
|
|
export tabstop=2
|
|
|
|
acme -aib -f /mnt/font/SauceCodeProNerdFontComplete-Regular/9a/font &
|
|
|
|
#transset -n "acme" 0.85
|
2019-11-23 19:46:58 +00:00
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2021-03-02 03:13:12 +00:00
|
|
|
sshmount()
|
|
|
|
{
|
|
|
|
sshfs $1 $2
|
|
|
|
}
|
|
|
|
|
|
|
|
sshumount()
|
|
|
|
{
|
|
|
|
fusermount3 -u $1
|
|
|
|
}
|
|
|
|
|
|
|
|
decryptmount()
|
|
|
|
{
|
|
|
|
cryptsetup luksOpen $1 $2
|
|
|
|
mount /dev/mapper/$2 $3
|
|
|
|
}
|
|
|
|
|
|
|
|
encryptumount()
|
|
|
|
{
|
|
|
|
umount $1
|
|
|
|
cryptsetup luksClose $1
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# one extra step with a logical volume:
|
|
|
|
# open the luks disk, activate the volume group,
|
|
|
|
# then finally mount the volume at the desired mount point
|
|
|
|
decryptmountlv()
|
|
|
|
{
|
|
|
|
cryptsetup luksOpen $1 $2
|
|
|
|
vgchange -ay
|
|
|
|
mount /dev/mapper/$3 $4
|
|
|
|
}
|
|
|
|
|
|
|
|
# unmount the logical volume,
|
|
|
|
# close the logical volume,
|
|
|
|
# then close the disk
|
|
|
|
encryptumountlv()
|
|
|
|
{
|
|
|
|
umount $1
|
|
|
|
cryptsetup luksClose $1
|
|
|
|
cryptsetup luksClose $2
|
|
|
|
}
|
|
|
|
|
|
|
|
cuegen()
|
|
|
|
{
|
|
|
|
if [ ! -z "$2" ]; then
|
|
|
|
echo "FILE \"$1\" BINARY" > $2
|
|
|
|
echo " TRACK 01 MODE1/2352" >> $2
|
|
|
|
echo " INDEX 01 00:00:00" >> $2
|
|
|
|
else
|
|
|
|
echo "usage: cuegen IMAGE CUEFILE"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
mssqldb()
|
|
|
|
{
|
|
|
|
if [ -z $1 ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "clear" ]; then
|
|
|
|
docker volume rm mssql_data mssql_log mssql_secrets
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "persist" ]; then
|
|
|
|
volumes="-v mssql_data:/var/opt/mssql/data -v mssql_log:/var/opt/mssql/log -v mssql_secrets:/var/opt/mssql/secrets"
|
|
|
|
shift
|
|
|
|
else
|
|
|
|
volumes=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
app=$1
|
|
|
|
|
|
|
|
if [ ! -z $2 ]; then
|
|
|
|
docker run -it --rm -e SA_PASSWORD="BadDefaultPassword!" -e MOCK_DATA="$2" -p 1433:1433 ${volumes} ${app}_db
|
|
|
|
else
|
|
|
|
docker run -it --rm -e SA_PASSWORD="BadDefaultPassword!" -p 1433:1433 ${volumes} ${app}_db
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
siroonian()
|
|
|
|
{
|
|
|
|
if [ -z $1 ]; then
|
|
|
|
echo "usage: siroonian [connect | auth | desktop]"
|
|
|
|
fi
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
connect)
|
|
|
|
sudo openfortivpn;;
|
|
|
|
auth)
|
|
|
|
kinit dstevens;;
|
|
|
|
desktop)
|
|
|
|
rdesktop -u dstevens -d siroonian.local -p - -MKz -x m -r sound:local -r clipboard:PRIMARYCLIPBOARD devworkstation3.siroonian.local;;
|
|
|
|
*)
|
|
|
|
echo "usage: siroonian [connect | auth | desktop]";;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
waitfor()
|
|
|
|
{
|
|
|
|
while pgrep $1; do
|
|
|
|
sleep $2
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
mergeandtest()
|
|
|
|
{
|
|
|
|
git checkout $1
|
|
|
|
git checkout -b $1_$2_test
|
|
|
|
git merge $2
|
|
|
|
}
|
|
|
|
|
2019-11-23 19:46:58 +00:00
|
|
|
9man()
|
|
|
|
{
|
2021-03-02 03:13:12 +00:00
|
|
|
if [ "${TERM}" != "dumb" ]; then
|
|
|
|
man "$@"
|
|
|
|
else
|
|
|
|
man -c "$@" | ul
|
|
|
|
fi
|
2019-11-23 19:46:58 +00:00
|
|
|
}
|
|
|
|
|
2021-03-02 03:13:12 +00:00
|
|
|
microCmd()
|
|
|
|
{
|
|
|
|
if [ "$TERM" == linux ]; then
|
|
|
|
micro -clipboard internal -colorscheme solarwolf_fb "$@"
|
|
|
|
else
|
|
|
|
echo -ne "\033]0;micro\007"
|
|
|
|
micro "$@"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
alias web='silence $BROWSER'
|
2019-11-23 19:46:58 +00:00
|
|
|
alias mail='silence thunderbird'
|
2021-03-02 03:13:12 +00:00
|
|
|
alias fs='silence pcmanfm-qt'
|
2019-11-23 19:46:58 +00:00
|
|
|
alias office='silence libreoffice'
|
|
|
|
alias acme='acmeInit'
|
|
|
|
alias man='9man'
|
2021-03-02 03:13:12 +00:00
|
|
|
alias gpg='gpg2'
|
|
|
|
alias zoom='flatpak --device=all --filesystem=host run us.zoom.Zoom'
|
|
|
|
alias teams='flatpak --device=all --filesystem=host run com.microsoft.Teams'
|
|
|
|
alias micro='microCmd'
|
|
|
|
alias startx='exec startx'
|
|
|
|
alias mpv='mpv --player-operation-mode=pseudo-gui --cover-art-files=/home/nilix/lib/img/ux/sound_only.png'
|
2019-11-23 19:46:58 +00:00
|
|
|
|
|
|
|
alias ls='ls -lh --group-directories-first'
|
|
|
|
|
|
|
|
if [ -d ~/bin ]; then
|
|
|
|
PATH=~/bin:${PATH}
|
|
|
|
for x in ~/bin/*; do
|
|
|
|
if [ -d $x ]; then
|
|
|
|
PATH=${x}:${PATH}
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2021-03-02 03:13:12 +00:00
|
|
|
|