Compare commits

..

3 Commits
master ... town

Author SHA1 Message Date
Ben Harris c6eff15c8e something 2019-05-14 15:30:17 -04:00
Ben Harris 9bfc06016a add chin function 2019-05-14 15:29:11 -04:00
Ben Harris 87283165b5 town doesn't use Maildir format 2019-05-14 15:29:11 -04:00
283 changed files with 25052 additions and 8592 deletions

28
.gitmodules vendored
View File

@ -1,27 +1,25 @@
[submodule "fish/.config/fish/nvm-wrapper"]
path = fish/.config/fish/nvm-wrapper
url = https://github.com/passcod/nvm-fish-wrapper
[submodule "vim/.vim/bundle/quick-scope"]
path = vim/.vim/pack/plugins/start/quick-scope
path = vim/.vim/bundle/quick-scope
url = https://github.com/unblevable/quick-scope
[submodule "vim/.vim/bundle/vim-fugitive"]
path = vim/.vim/pack/plugins/start/vim-fugitive
path = vim/.vim/bundle/vim-fugitive
url = https://github.com/tpope/vim-fugitive
[submodule "vim/.vim/bundle/vim-commentary"]
path = vim/.vim/pack/plugins/start/vim-commentary
path = vim/.vim/bundle/vim-commentary
url = https://github.com/tpope/vim-commentary
[submodule "vim/.vim/bundle/vim-surround"]
path = vim/.vim/pack/plugins/start/vim-surround
path = vim/.vim/bundle/vim-surround
url = https://github.com/tpope/vim-surround
[submodule "vim/.vim/bundle/vim-gitgutter"]
path = vim/.vim/pack/plugins/start/vim-gitgutter
path = vim/.vim/bundle/vim-gitgutter
url = https://github.com/airblade/vim-gitgutter
[submodule "fzf/.fzf"]
path = fzf/.fzf
url = https://github.com/junegunn/fzf
[submodule "vim/.vim/bundle/vim-lastplace"]
path = vim/.vim/pack/plugins/start/vim-lastplace
path = vim/.vim/bundle/vim-lastplace
url = https://github.com/farmergreg/vim-lastplace
[submodule "vim/.vim/bundle/vim-fish"]
path = vim/.vim/pack/plugins/start/vim-fish
url = https://github.com/dag/vim-fish
[submodule "vim/.vim/bundle/vim-airline"]
path = vim/.vim/pack/plugins/start/vim-airline
url = https://github.com/vim-airline/vim-airline
[submodule "pb"]
path = pb
url = https://tildegit.org/tomasino/pb

View File

@ -16,7 +16,7 @@ endif
install:
@make $(UNAME)
Linux: bash bin byobu fish git gnupg mutt nvim pb vim weechat
Linux: bash fzf fish git mutt byobu weechat vim nvim gnupg bin vscode sublime
Windows: bash git vim
Other: bash git vim
@ -30,9 +30,10 @@ clean:
stow -t "$$HOME" -D gnupg
stow -t "$$HOME" -D mutt
stow -t "$$HOME" -D nvim
stow -t "$$HOME" -D sublime
stow -t "$$HOME" -D vim
stow -t "$$HOME" -D vscode
stow -t "$$HOME" -D weechat
$(MAKE) -C pb PREFIX=~/.local uninstall
bash:
@printf "$(YELLOW)--- bash -----------------------------------------------\n$(RESET)"
@ -51,6 +52,12 @@ fish:
@printf "$(YELLOW)--- fish -----------------------------------------------\n$(RESET)"
stow -t "$$HOME" fish
fzf: fish
@printf "$(YELLOW)--- fzf ------------------------------------------------\n$(RESET)"
git submodule update --init -- fzf/.fzf
stow -t "$$HOME" fzf
~/.fzf/install --no-bash --no-zsh --no-completion --no-update-rc --key-bindings --64
git:
@printf "$(YELLOW)--- git ------------------------------------------------\n$(RESET)"
stow -t "$$HOME" git
@ -69,18 +76,20 @@ nvim:
@printf "$(YELLOW)--- nvim -----------------------------------------------\n$(RESET)"
stow -t "$$HOME" nvim
pb:
@printf "$(YELLOW)--- pb -------------------------------------------------\n$(RESET)"
git submodule update --remote --init -- pb
$(MAKE) -C pb PREFIX=~/.local install
sublime:
@printf "$(YELLOW)--- sublime --------------------------------------------\n$(RESET)"
stow -t "$$HOME" sublime
vim:
@printf "$(YELLOW)--- vim ------------------------------------------------\n$(RESET)"
mkdir -p ~/.vim/{undodir,swap,backup}
chmod 700 ~/.vim/{undodir,swap,backup}
git submodule update --remote --init -- vim/.vim/pack/plugins
mkdir -p ~/.vim/undodir
git submodule update --init -- vim/.vim/bundle
stow -t "$$HOME" vim
vscode:
@printf "$(YELLOW)--- vscode ---------------------------------------------\n$(RESET)"
stow -t "$$HOME" vscode
weechat:
@printf "$(YELLOW)--- weechat --------------------------------------------\n$(RESET)"
stow -t "$$HOME" weechat
@ -89,4 +98,4 @@ nuke:
@printf "$(RED)--- nuking existing files ------------------------------\n$(RESET)"
rm -rf ~/.byobu ~/.config/fish ~/.fzf ~/.bash*
.PHONY: bash fish git pb vim nvim mutt byobu weechat gnupg bin clean install nuke Windows Linux Other
.PHONY: bash fzf fish git vim nvim mutt byobu weechat gnupg bin vscode sublime clean install nuke Windows Linux Other

View File

@ -6,6 +6,6 @@ it includes configs for my most frequently used tools.
### steps to install on debian and derivatives
1. `apt install make stow fish git byobu vim ripgrep fzf`
1. `apt install make stow fish git byobu vim`
1. `make nuke install` - note that nuke removes existing files in your $HOME

0
bash/.bash_aliases Normal file → Executable file
View File

0
bash/.bash_logout Normal file → Executable file
View File

0
bash/.bash_profile Normal file → Executable file
View File

0
bash/.bashrc Normal file → Executable file
View File

1
bin/.gitignore vendored
View File

@ -1 +0,0 @@
bin/lf

View File

@ -1,84 +0,0 @@
#!/bin/sh
set -eu
temp=$(mktemp -d)
trap 'rm -r "$temp"' EXIT
exec 3>>"${temp}/run.c"
cat >&3 <<EOF
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <fcntl.h>
#include <strings.h>
#include <unistd.h>
EOF
while getopts 'e:i:' opt; do
case "$opt" in
(e) expr=$OPTARG;;
(i) echo "#include <${OPTARG}>" >&3;;
(?) exit 1;;
esac
done
shift $((OPTIND - 1))
cat >&3 <<EOF
int main(int argc, char *argv[]) {
(void)argc;
(void)argv;
$*;
EOF
if [ -n "${expr:-}" ]; then
cat >&3 <<EOF
printf(
_Generic(
${expr},
char: "%c\n",
char *: "%s\n",
wchar_t *: "%ls\n",
signed char: "%hhd\n",
short: "%hd\n",
int: "%d\n",
long: "%ld\n",
long long: "%lld\n",
unsigned char: "%hhu\n",
unsigned short: "%hu\n",
unsigned int: "%u\n",
unsigned long: "%lu\n",
unsigned long long: "%llu\n",
double: "%g\n",
default: "%p\n"
),
${expr}
);
EOF
fi
if [ $# -eq 0 -a -z "${expr:-}" ]; then
cat >&3
fi
echo '}' >&3
cat >"${temp}/Makefile" <<EOF
CFLAGS += -Wall -Wextra -Wpedantic
EOF
make -s -C "${temp}" run
"${temp}/run"

View File

@ -1,4 +0,0 @@
#!/bin/sh
exec openssl s_client -connect "$1" </dev/null 2>/dev/null \
| openssl x509 -noout -dates

View File

@ -1,18 +0,0 @@
#!/usr/bin/env perl
# https://blog.plover.com/prog/runN.html
my $field = shift or usage();
$field -= 1 if $field > 0;
$|=1;
while (<>) {
chomp;
my @f = split;
print $f[$field], "\n";
}
sub usage {
print STDERR "$0 fieldnumber\n";
exit 1;
}

View File

@ -1,11 +0,0 @@
#!/bin/sh
repos=$(find ~/workspace -type d -name .git)
for repo in $repos; do
dir=$(dirname "$repo")
printf "%s\n" "$(basename "$dir")"
git -C "$dir" "$@"
printf "\n"
done

View File

@ -1,14 +0,0 @@
#!/usr/bin/env python3
from http import HTTPStatus
from sys import argv, exit, stderr
if len(argv) == 2:
try:
status = HTTPStatus(int(argv[1]))
print(status.phrase)
print(status.description)
except ValueError:
print("Invalid HTTP status code", file=stderr)
exit(1)
else:
print(f"{argv[0]} [code] to print the name of the HTTP status code")

View File

@ -1,6 +0,0 @@
#!/bin/sh
zcat -f /var/log/nginx/other_vhosts_access.log* |\
grep -viE '(bing|googlebot|baidu|semrush|yandex|ahrefsbot|linkcheck|yisou|mail\.ru|dotbot|seznambot|mj12bot|applebot|coccoc|webeaver|commoncrawl|exabot|7ooo\.ru|changedetection|brandwatch|360spider|gowikibot|ryte\.com|semanticscholar|crawler|alignab|daum\.net|Apache-HttpClient|wp-cron\.php|xmlrpc\.php|wp-login\.php|uptimerobot|/wp-admin/|python-requests|robots\.txt|feedparser|siteimprove|zoominfobot)' |\
grep -i "$1"

View File

@ -1,12 +0,0 @@
#!/bin/sh
pbm() {
curl -s https://pinballmap.com/api/v1/locations/$1/machine_details.json\?machines_only=1 \
| jq -r '.machines | .[]' \
> ~/public_html/pin/$2.txt
}
pbm 9699 coinslot
pbm 13280 rightbrain

View File

@ -1,3 +0,0 @@
#!/bin/sh
# https://anarc.at/blog/2019-07-07-rsync-oneliner/
exec rsync -PaSHAXx --numeric-ids --info=progress2 "$@"

View File

@ -4,5 +4,6 @@ rename 's/ /-/g' ~/Pictures/*.png
latest=$(ls -Art ~/Pictures | tail -n 1)
pb "~/Pictures/$latest"
pb "~/Pictures/$latest" | xclip -selection clipboard
notify-send "on yr clipbrd"

29
bootstrap.sh Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
DISTRO="$1"
RELEASE="$2"
PKGLIST="${DISTRO}.pkglist"
[ -z $DISTRO -o -z $RELEASE ] && \
echo "usage: sudo $0 <distro> <release>" && exit 1
[[ $(id -u) != 0 ]] && \
echo "re-run this as root" && exit 1
# make sure we have sources
echo "deb https://apt.syncthing.net/ syncthing stable" > /etc/apt/sources.list.d/syncthing.list
echo "deb https://weechat.org/${DISTRO} ${RELEASE} main" > /etc/apt/sources.list.d/weechat.list
apt update
apt upgrade -y
apt full-upgrade -y
apt install -y $(xargs < ${PKGLIST})
echo -n "install makefiles? [y/n]"
read answer
[[ "$answer" = "y" ]] && \
make nuke install

0
byobu/.byobu/.screenrc Normal file → Executable file
View File

2
byobu/.byobu/.tmux.conf Normal file → Executable file
View File

@ -1 +1,3 @@
set -g default-shell /usr/bin/fish
set -g default-command /usr/bin/fish
set -g default-terminal "screen-256color"

0
byobu/.byobu/.welcome-displayed Normal file → Executable file
View File

0
byobu/.byobu/backend Normal file → Executable file
View File

0
byobu/.byobu/color Normal file → Executable file
View File

2
byobu/.byobu/datetime.tmux Normal file → Executable file
View File

@ -1,2 +1,2 @@
BYOBU_TIME="%-l:%M:%S%P"
BYOBU_TIME="%H:%M:%S"
BYOBU_DATE=

0
byobu/.byobu/keybindings Normal file → Executable file
View File

0
byobu/.byobu/keybindings.tmux Normal file → Executable file
View File

0
byobu/.byobu/profile Normal file → Executable file
View File

0
byobu/.byobu/profile.tmux Normal file → Executable file
View File

0
byobu/.byobu/prompt Normal file → Executable file
View File

2
byobu/.byobu/status Normal file → Executable file
View File

@ -31,7 +31,7 @@ screen_lower_right="color network #disk_io custom #entropy raid reboot_required
# Tmux has one status line, with 2 halves for status
tmux_left=" #logo #distro #release #arch #session"
# You can have as many tmux right lines below here, and cycle through them using Shift-F5
tmux_right=" #network #disk_io #custom #entropy #raid reboot_required updates_available #apport #services #mail users uptime #fan_speed cpu_temp #battery #wifi_quality processes load_average cpu_count cpu_freq memory #swap disk #whoami hostname #ip_address time_utc #date time"
tmux_right=" #network #disk_io #custom #entropy #raid reboot_required updates_available #apport #services #mail #users uptime #ec2_cost #rcs_cost #fan_speed cpu_temp #battery #wifi_quality processes load_average cpu_count cpu_freq memory #swap disk #whoami hostname #ip_address time_utc #date time"
#tmux_right="network #disk_io #custom entropy raid reboot_required updates_available #apport #services #mail users uptime #ec2_cost #rcs_cost fan_speed cpu_temp battery wifi_quality #processes load_average cpu_count cpu_freq memory #swap #disk whoami hostname ip_address #time_utc date time"
#tmux_right="network #disk_io custom #entropy raid reboot_required updates_available #apport #services #mail users uptime #ec2_cost #rcs_cost #fan_speed #cpu_temp battery wifi_quality #processes load_average cpu_count cpu_freq memory #swap #disk #whoami #hostname ip_address #time_utc date time"
#tmux_right="#network disk_io #custom entropy #raid #reboot_required #updates_available #apport #services #mail #users #uptime #ec2_cost #rcs_cost fan_speed cpu_temp #battery #wifi_quality #processes #load_average #cpu_count #cpu_freq #memory #swap whoami hostname ip_address #time_utc disk date time"

0
byobu/.byobu/statusrc Normal file → Executable file
View File

0
byobu/.byobu/windows Normal file → Executable file
View File

0
byobu/.byobu/windows.tmux Normal file → Executable file
View File

265
debian.pkglist Normal file
View File

@ -0,0 +1,265 @@
adduser
ansible
apt
apt-listchanges
apt-utils
avahi-daemon
base-files
base-passwd
bash
bash-completion
bsdgames
bsdmainutils
bsdutils
build-essential
busybox
byobu
bzip2
cloc
console-setup
coreutils
cpio
cron
curl
dash
dbus
debconf
debconf-i18n
debian-archive-keyring
debian-faq
debianutils
desktop-base
diffutils
discover
dmidecode
dmsetup
dnsutils
doc-debian
dpkg
e2fslibs
e2fsprogs
erlang
file
file-roller
findutils
firmware-iwlwifi
fish
gcc-6-base
gedit-plugins
gettext-base
gimp
git
gnupgv2
gnupg-agent
gpgv
grep
groff-base
gzip
hdparm
hostname
ifupdown
init
initramfs-tools
init-system-helpers
inkscape
installation-report
iproute2
iptables
iputils-ping
isc-dhcp-client
isc-dhcp-common
keepassxc
keyboard-configuration
kmod
krb5-locales
laptop-detect
less
libacl1
libapparmor1
libapt-inst2.0
libapt-pkg5.0
libassuan0
libattr1
libaudit1
libaudit-common
libblkid1
libbsd0
libbz2-1.0
libc6
libcap2
libcap-ng0
libc-bin
libclass-isa-perl
libcomerr2
libcryptsetup4
libdb5.3
libdebconfclient0
libdevmapper1.02.1
libdns-export162
libelf1
libestr0
libfastjson4
libfdisk1
libffi6
libgcc1
libgcrypt20
libgdbm3
libgmp10
libgnutls30
libgpg-error0
libgsf-bin
libgtk2-perl
libhogweed4
libidn11
libidn2-0
libip4tc0
libip6tc0
libiptc0
libisc-export160
libkmod2
libksba8
liblocale-gettext-perl
liblockfile-bin
liblogging-stdlog0
liblognorm5
liblz4-1
liblzma5
libmnl0
libmount1
libncurses5
libncursesw5
libnetfilter-conntrack3
libnettle6
libnewt0.52
libnfnetlink0
libnpth0
libp11-kit0
libpam0g
libpam-modules
libpam-modules-bin
libpam-runtime
libpam-systemd
libpcre3
libpipeline1
libpopt0
libprocps6
libproxy1-plugin-networkmanager
libpsl5
libreadline7
libseccomp2
libselinux1
libsemanage1
libsemanage-common
libsepol1
libslang2
libsmartcols1
libsqlite3-0
libss2
libssl1.0.2
libssl1.1
libstdc++6
libswitch-perl
libsystemd0
libtasn1-6
libtext-charwidth-perl
libtext-iconv-perl
libtext-wrapi18n-perl
libtinfo5
libudev1
libunistring0
libustr-1.0-1
libuuid1
libxapian30
libxtables12
linux-image-amd64
locales
login
logrotate
lsb-base
lsof
make
man-db
manpages
mawk
mime-support
minetest
mosh
mount
mtr
mumble
mutt
nano
ncurses-base
ncurses-bin
ncurses-term
neofetch
neovim
netbase
netcat-traditional
network-manager-gnome
nodejs
npm
nvidia-driver
openssh-client
orca
passwd
pciutils
perl
perl-base
perl-modules-5.24
pinentry-curses
procps
python
python2.7
python3-pip
python3-reportbug
python3-uno
python-minimal
python-pip
readline-common
reportbug
rhythmbox
rhythmbox-plugin-cdrecorder
rhythmbox-plugins
rsyslog
rustc
scdaemon
seahorse
sed
sensible-utils
shotwell
simple-scan
snapd
stow
syncthing
systemd
systemd-sysv
sysvinit-utils
tar
task-desktop
task-english
tasksel
tasksel-data
telnet
thunderbird
totem-plugins
traceroute
transmission-gtk
tzdata
ucf
udev
usbutils
util-linux
vim
vim-common
vim-tiny
vinagre
vino
wamerican
wget
whiptail
xdg-user-dirs-gtk
xxd
xz-utils
yubikey-personalization
zlib1g

View File

@ -1,11 +0,0 @@
complete -c lf -o command -r -d 'command to execute on client initialization'
complete -c lf -o cpuprofile -r -d 'path to the file to write the CPU profile'
complete -c lf -o doc -d 'show documentation'
complete -c lf -o last-dir-path -r -d 'path to the file to write the last dir on exit (to use for cd)'
complete -c lf -o memprofile -r -d 'path to the file to write the memory profile'
complete -c lf -o remote -x -d 'send remote command to server'
complete -c lf -o selection-path -r -d 'path to the file to write selected files on open (to use as open file dialog)'
complete -c lf -o server -d 'start server (automatic)'
complete -c lf -o version -d 'show version'
complete -c lf -o help -d 'show help'

52
fish/.config/fish/config.fish Normal file → Executable file
View File

@ -1,50 +1,42 @@
set -xg EDITOR vim
status --is-login; and status --is-interactive; and exec byobu-launcher
if type -q nvim > /dev/null
set -xg EDITOR nvim
else
set -xg EDITOR vim
end
set -xg TZ 'America/Detroit'
if test -d ~/Maildir
set -x MAIL ~/Maildir
end
for i in ~/bin ~/.local/bin ~/.rbenv/bin ~/.rbenv/shims ~/.cargo/bin ~/.yarn/bin ~/go/bin ~/.dotnet/tools
fish_add_path --path $i
if test -d /usr/local/go
set -x GOPATH (/usr/local/go/bin/go env GOPATH)
end
# add rbenv paths
if status --is-interactive && type -q rbenv
set -gx RBENV_SHELL fish
source '/usr/lib/rbenv/completions/rbenv.fish'
command rbenv rehash 2>/dev/null
function rbenv
set command $argv[1]
set -e argv[1]
switch "$command"
case rehash shell
source (rbenv "sh-$command" $argv|psub)
case '*'
command rbenv "$command" $argv
end
set my_paths ~/bin /usr/local/go/bin ~/.yarn/bin $GOPATH/bin ~/.local/bin ~/.cargo/bin /snap/bin ~/.fzf/bin
for path in $my_paths
if test -d $path; and not echo $fish_user_paths | grep -q "$path"; and not echo $PATH | grep -q "$path"
set -x fish_user_paths $fish_user_paths $path
end
end
#set -x SSH_AGENT_PID ""
if test -f ~/.asdf/asdf.fish
source ~/.asdf/asdf.fish
end
set -x SSH_AGENT_PID ""
if test -S $HOME/.gnupg/S.gpg-agent
set -x SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent
set -x GPG_SOCK $HOME/.gnupg/S.gpg-agent
else
type -q gpgconf && set -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
set -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
end
set -x BBJ_USER $USER
set -x DEBEMAIL ben@tilde.team
set -x DEBFULLNAME "Ben Harris"
# add dotnet completions if needed
if status --is-interactive && type -q dotnet
complete -f -c dotnet -a "(dotnet complete)"
end
status --is-login && status --is-interactive && exec byobu-launcher
# load postexec_insult
postexec_insult

View File

@ -1,24 +1,19 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR --export DEBEMAIL:ben\x40tilde\x2eteam
SETUVAR DOTNET_CLI_TELEMETRY_OPTOUT:1
SETUVAR EMAIL:ben\x40tilde\x2eteam
SETUVAR __fish_init_2_39_8:\x1d
SETUVAR __fish_init_2_3_0:\x1d
SETUVAR __fish_init_3_x:\x1d
SETUVAR __fish_initialized:3400
SETUVAR fish_color_autosuggestion:555\x1ebrblack
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:\x2d\x2dbold
SETUVAR fish_color_command:005fd7
SETUVAR fish_color_comment:990000
SETUVAR fish_color_cwd:green
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_cwd_root:990000
SETUVAR fish_color_end:009900
SETUVAR fish_color_error:ff0000
SETUVAR fish_color_escape:00a6b2
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:normal
SETUVAR fish_color_host_remote:yellow
SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
SETUVAR fish_color_normal:normal
SETUVAR fish_color_operator:00a6b2
@ -36,5 +31,4 @@ SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr
SETUVAR fisher_dependency_count:bass\x1edone\x1egetopts\x1egitignore\x1ehumanize_duration\x1envm\x1espin

View File

@ -1,3 +1,4 @@
# Defined in /tmp/fish.5ZM6aQ/anonradio.fish @ line 1
function anonradio
nvlc http://anonradio.net:8000/anonradio
end

View File

@ -1,4 +0,0 @@
function backupstatus
ssh rsync quota
ssh rsync du -sh "*.borg"
end

View File

@ -0,0 +1,8 @@
function cat
if type -q bat >/dev/null
bat $argv
else
command cat $argv
end
end

View File

@ -0,0 +1,3 @@
function chin
socat - UNIX-CONNECT:/tmp/chinchirorin
end

View File

@ -0,0 +1,8 @@
# Defined in /tmp/fish.hXQA9y/cp_tilde_index.fish @ line 1
function cp_tilde_index
sudo cp /etc/skel/public_html/index.php /home/$argv[1]/public_html/.
sudo chown $argv[1]:$argv[1] /home/$argv[1]/public_html/index.php
if test -e /home/$argv[1]/public_html/index.html
sudo rm /home/$argv[1]/public_html/index.html
end
end

View File

@ -1,3 +0,0 @@
function cwhois
whois -h bgp.tools " -v $argv"
end

View File

@ -0,0 +1,4 @@
function e
exa -al --git --group-directories-first $argv
end

View File

@ -0,0 +1,19 @@
function fish_right_prompt
if is_git
if is_git_dirty
set_color --underline
end
set_color yellow
if is_git_ahead
echo -n '^'
else
echo -n '='
end
echo -n (git_branch)
set_color normal
end
end

View File

@ -1,4 +1,3 @@
function fish_user_key_bindings
fzf_key_bindings
bind \co 'lfcd; commandline -f repaint'
fzf_key_bindings
end

View File

@ -1,161 +0,0 @@
# ____ ____
# / __/___ / __/
# / /_/_ / / /_
# / __/ / /_/ __/
# /_/ /___/_/ key-bindings.fish
#
# - $FZF_TMUX_OPTS
# - $FZF_CTRL_T_COMMAND
# - $FZF_CTRL_T_OPTS
# - $FZF_CTRL_R_OPTS
# - $FZF_ALT_C_COMMAND
# - $FZF_ALT_C_OPTS
# Key bindings
# ------------
function fzf_key_bindings
# Store current token in $dir as root for the 'find' command
function fzf-file-widget -d "List files and folders"
set -l commandline (__fzf_parse_commandline)
set -l dir $commandline[1]
set -l fzf_query $commandline[2]
# "-path \$dir'*/\\.*'" matches hidden files/folders inside $dir but not
# $dir itself, even if hidden.
test -n "$FZF_CTRL_T_COMMAND"; or set -l FZF_CTRL_T_COMMAND "
command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
-o -type f -print \
-o -type d -print \
-o -type l -print 2> /dev/null | sed 's@^\./@@'"
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
begin
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS"
eval "$FZF_CTRL_T_COMMAND | "(__fzfcmd)' -m --query "'$fzf_query'"' | while read -l r; set result $result $r; end
end
if [ -z "$result" ]
commandline -f repaint
return
else
# Remove last token from commandline.
commandline -t ""
end
for i in $result
commandline -it -- (string escape $i)
commandline -it -- ' '
end
commandline -f repaint
end
function fzf-history-widget -d "Show command history"
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
begin
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT $FZF_DEFAULT_OPTS --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS +m"
set -l FISH_MAJOR (echo $version | cut -f1 -d.)
set -l FISH_MINOR (echo $version | cut -f2 -d.)
# history's -z flag is needed for multi-line support.
# history's -z flag was added in fish 2.4.0, so don't use it for versions
# before 2.4.0.
if [ "$FISH_MAJOR" -gt 2 -o \( "$FISH_MAJOR" -eq 2 -a "$FISH_MINOR" -ge 4 \) ];
history -z | eval (__fzfcmd) --read0 --print0 -q '(commandline)' | read -lz result
and commandline -- $result
else
history | eval (__fzfcmd) -q '(commandline)' | read -l result
and commandline -- $result
end
end
commandline -f repaint
end
function fzf-cd-widget -d "Change directory"
set -l commandline (__fzf_parse_commandline)
set -l dir $commandline[1]
set -l fzf_query $commandline[2]
test -n "$FZF_ALT_C_COMMAND"; or set -l FZF_ALT_C_COMMAND "
command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
-o -type d -print 2> /dev/null | sed 's@^\./@@'"
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
begin
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS"
eval "$FZF_ALT_C_COMMAND | "(__fzfcmd)' +m --query "'$fzf_query'"' | read -l result
if [ -n "$result" ]
cd $result
# Remove last token from commandline.
commandline -t ""
end
end
commandline -f repaint
end
function __fzfcmd
test -n "$FZF_TMUX"; or set FZF_TMUX 0
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
if [ -n "$FZF_TMUX_OPTS" ]
echo "fzf-tmux $FZF_TMUX_OPTS -- "
else if [ $FZF_TMUX -eq 1 ]
echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- "
else
echo "fzf"
end
end
bind \ct fzf-file-widget
bind \cr fzf-history-widget
bind \ec fzf-cd-widget
if bind -M insert > /dev/null 2>&1
bind -M insert \ct fzf-file-widget
bind -M insert \cr fzf-history-widget
bind -M insert \ec fzf-cd-widget
end
function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath and rest of token'
# eval is used to do shell expansion on paths
set -l commandline (eval "printf '%s' "(commandline -t))
if [ -z $commandline ]
# Default to current directory with no --query
set dir '.'
set fzf_query ''
else
set dir (__fzf_get_dir $commandline)
if [ "$dir" = "." -a (string sub -l 1 -- $commandline) != '.' ]
# if $dir is "." but commandline is not a relative path, this means no file path found
set fzf_query $commandline
else
# Also remove trailing slash after dir, to "split" input properly
set fzf_query (string replace -r "^$dir/?" -- '' "$commandline")
end
end
echo $dir
echo $fzf_query
end
function __fzf_get_dir -d 'Find the longest existing filepath from input string'
set dir $argv
# Strip all trailing slashes. Ignore if $dir is root dir (/)
if [ (string length -- $dir) -gt 1 ]
set dir (string replace -r '/*$' -- '' $dir)
end
# Iteratively check if dir exists and strip tail end of path
while [ ! -d "$dir" ]
# If path is absolute, this can keep going until ends up at /
# If path is relative, this can keep going until entire input is consumed, dirname returns "."
set dir (dirname -- "$dir")
end
echo $dir
end
end

View File

@ -0,0 +1 @@
/home/benharri/.fzf/shell/key-bindings.fish

View File

@ -1,4 +1,5 @@
function is_git
git rev-parse --verify HEAD >/dev/null 2>&1
git rev-parse --verify HEAD >/dev/null ^&1
# keeping ^ for now for v2 backwards compatibility
end

View File

@ -0,0 +1,8 @@
function lg
if type -q lazygit > /dev/null
lazygit $argv
else
git status
end
end

View File

@ -1,3 +0,0 @@
function lynx
command lynx -vikeys -display_charset=UTF-8 $argv
end

View File

@ -1,3 +0,0 @@
function md
pandoc -s -f markdown -t html $argv[1] | lynx -stdin
end

View File

@ -1,9 +0,0 @@
function mdfmt
for md in $argv
pandoc \
-f markdown+yaml_metadata_block \
-t markdown+yaml_metadata_block \
--atx-headers \
-o $md $md
end
end

View File

@ -0,0 +1,12 @@
# Defined in /tmp/fish.QnvktC/postexec_insult.fish @ line 2
function postexec_insult --on-event fish_postexec
if test $status -ne 0
set_color red
echo -n =====
set_color magenta
echo -n (shuf -n1 ~/insults.txt)
set_color red
echo =====
set_color normal
end
end

View File

@ -1,5 +0,0 @@
# Defined in /tmp/fish.Fo1L3P/pubtr.fish @ line 1
function pubtr
mtr -wrc4 $argv[1] > ~/pub/mtr/"$argv[1]".txt
echo https://bhh.sh/pub/mtr/$argv[1].txt
end

View File

@ -0,0 +1,3 @@
function renew_ifd_cert
sudo certbot certonly --agree-tos --renew-by-default --manual --preferred-challenges=dns -d ironfishdistillery.com $argv
end

View File

@ -1,3 +0,0 @@
function rm
command rm -I $argv
end

View File

@ -1,3 +0,0 @@
function ssys
sudo systemctl $args
end

View File

@ -1,3 +0,0 @@
function stripcolors
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g"
end

View File

@ -1,3 +0,0 @@
function sys
systemctl $argv
end

View File

@ -1,11 +1,10 @@
function wildcard-cert
sudo certbot certonly \
--dns-rfc2136 \
--dns-rfc2136-credentials /root/.secrets/rfc2136.ini \
--server https://acme-v02.api.letsencrypt.org/directory \
--preferred-challenge dns-01 \
--cert-name $argv[1] \
-d $argv[1] \
sudo certbot certonly \
--dns-cloudflare \
--dns-cloudflare-credentials /root/.secrets/cloudflare.ini \
--server https://acme-v02.api.letsencrypt.org/directory \
--preferred-challenge dns-01 \
--cert-name $argv[1] \
-d $argv[1] \
-d \*.$argv[1]
end

View File

@ -1,3 +0,0 @@
function zombies
ps -A -ostat,ppid | awk '/[zZ]/ && !a[$2]++ {print $2}'
end

48
fish/insults.txt Normal file
View File

@ -0,0 +1,48 @@
Just what do you think you're doing Dave?
It can only be attributed to human error.
That's something I cannot allow to happen.
My mind is going. I can feel it.
Sorry about this, I know it's a bit silly.
Take a stress pill and think things over.
This mission is too important for me to allow you to jeopardize it.
We'll all be murdered in our beds!
You can't come in. Our tiger has got flu
What, what, what, what, what, what, what, what, what, what?
You can't get the wood, you know.
... and it used to be so popular...
Pauses for audience applause, not a sausage
Hold it up to the light --- not a brain in sight!
There's a lot of it about, you know.
You do that again and see what happens...
Harm can come to a young lad like that!
And with that remarks folks, the case of the Crown vs yourself was proven.
Speak English you fool --- there are no subtitles in this scene.
It's only your word against mine.
I think ... err ... I think ... I think I'll go home
My pet ferret can type better than you!
Your mind just hasn't been the same since the electro-shock, has it?
Maybe if you used more than just two fingers...
BOB says: You seem to have forgotten your passwd, enter another!
I can't hear you -- I'm using the scrambler.
The more you drive -- the dumber you get.
Listen, burrito brains, I don't have time to listen to this trash.
I've seen penguins that can type better than that.
Have you considered trying to match wits with a rutabaga?
You speak an infinite deal of nothing
I feel much better now.
You silly, twisted boy you.
He has fallen in the water!
I don't wish to know that.
You'll starve!
Have a gorilla...
There must be cure for it!
Ying Tong Iddle I Po
You gotta go owwwww!
I have been called worse.
Wrong! You cheating scum!
No soap, honkie-lips.
Where did you learn to type?
Are you on drugs?
You type like I drive.
Do you think like you type?
ur cute

1
fzf/.fzf Submodule

@ -0,0 +1 @@
Subproject commit 315e568de006e80138f79c77d5508c7e4853e6b2

79
git/.gitconfig Normal file → Executable file
View File

@ -1,76 +1,27 @@
[user]
email = ben@tilde.team
name = Ben Harris
signingkey = FC2255B7BBC7EABD4EFAFA1068907D8BCCD85A5A
email = ben@tilde.team
name = Ben Harris
signingkey = FC2255B7BBC7EABD4EFAFA1068907D8BCCD85A5A
[push]
default = simple
[commit]
gpgsign = false
verbose = true
default = simple
[pull]
ff = only
[pager]
diff = diff-highlight | less
log = diff-highlight | less
reflog = diff-highlight | less
show = diff-highlight | less
[diff]
colorMoved = default
ff = only
[diff "gpg"]
textconv = gpg --no-tty --decrypt
cachetextconv = false
textconv = gpg --no-tty --decrypt
cachetextconv = false
[diff "ansible-vault"]
textconv = ansible-vault view
cachetextconv = false
textconv = ansible-vault view
cachetextconv = false
[sendemail]
smtpencryption = tls
smtpserver = mail.tilde.team
smtpserverport = 587
smtpuser = ben
annotate = yes
smtpencryption = tls
smtpserver = mail.tilde.team
smtpserverport = 587
annotate = yes
smtpuser = ben
[alias]
lol = log --oneline --graph --decorate --all
joke = !curl -s https://raw.githubusercontent.com/EugeneKay/git-jokes/lulz/Jokes.txt | shuf -n1
dad = !curl https://icanhazdadjoke.com
staged = diff --staged
ap = add --patch
cv = commit --verbose
local = log --oneline --no-merges ${1-$(git branch -lvv | perl -ne '/^\\\\*.*\\\\[(.*?)\\\\]/ and print \"$1\\n\"')}..HEAD
upstream = log --oneline --no-merges HEAD..${1-$(git branch -lvv | perl -ne '/^\\\\*.*\\\\[(.*?)\\\\]/ and print \"$1\\n\"')}
[rerere]
enabled = true
[merge]
tool = vimdiff
conflictstyle = diff3
[mergetool]
prompt = false
[core]
pager = diff-highlight | less
excludesfile = /home/ben/.gitignore
[url "git@salsa.debian.org:"]
pushInsteadOf = https://salsa.debian.org/
insteadOf = salsa:
[url "git@bhh.sh:repos/"]
pushInsteadOf = https://git.bhh.sh/
[init]
defaultBranch = main
[column]
ui = auto
[branch]
sort = -committerdate
[tag]
sort = version:refname
[safe]
directory = *
lol = log --oneline --graph --decorate --all

1
git/.gitignore vendored
View File

@ -1 +0,0 @@
.pc/

View File

@ -2,23 +2,3 @@ set editor=vim
set sort = reverse-threads
set sort_aux = last-date-received
set mbox_type=Maildir
set folder="~/Maildir"
set mbox="~/Maildir"
set spoolfile="~/Maildir"
set timeout=30
set record="+.Sent"
set postponed="+.Drafts"
mailboxes `echo -n "+ "; find ~/Maildir -maxdepth 1 -type d -name ".*" -printf "+%f' "`
macro index c "<change-folder>?<toggle-mailboxes>" "open a different folder"
macro pager c "<change-folder>?<toggle-mailboxes>" "open a different folder"
macro index C "<copy-message>?<toggle-mailboxes>" "copy a message to a mailbox"
macro index M "<save-message>?<toggle-mailboxes>" "move a message to a mailbox"
macro compose A "<attach-message>?<toggle-mailboxes>" "attach message(s) to this message"

1
pb

@ -1 +0,0 @@
Subproject commit a6cea6f11a60e7f1c7963c9ecad79d07f64ce4b2

View File

@ -0,0 +1,23 @@
{
// If you want exceptions reraised so you can see them in the console, change this to true.
"reraise_exceptions": false,
// If you want to have a syntax applied when new files are created, set new_file_syntax to the name of the syntax
// to use. The format is exactly the same as "syntax" in the rules below. For example, if you want to have a new
// file use JavaScript syntax, set new_file_syntax to 'JavaScript'.
"new_file_syntax": false,
// Auto add extensions to language settings file in User folder.
// Do not manually remove "apply_syntax_extensions" from the settings file.
// "extenstions" are ignored by "match": "all" setting.
"add_exts_to_lang_settings": true,
// Control level of logging in the console.
// (true|false|"verbose")
"debug": true,
// Put your custom syntax rules here:
"syntaxes": [
]
}

View File

@ -0,0 +1,59 @@
{
"HTML (Rails)":
[
"html.erb"
],
"JSON":
[
".bowerrc",
".csslintrc",
".eslintrc",
".jscsrc",
".jshintrc",
"geojson"
],
"PHP":
[
"inc",
"php3",
"php4",
"php5",
"phtml"
],
"Python":
[
"py3",
"pyw"
],
"Ruby":
[
"jbuilder",
"podspec",
"rabl",
"rake",
"rb",
"simplecov",
"thor"
],
"Ruby Haml":
[
"haml"
],
"Shell-Unix-Generic":
[
"bash",
"sh",
"zsh"
],
"XML":
[
"xml.dist"
],
"YAML":
[
".gemrc",
"YAML-tmLanguage",
"yml",
"yml.dist"
]
}

View File

@ -0,0 +1,23 @@
{
// If you want exceptions reraised so you can see them in the console, change this to true.
"reraise_exceptions": false,
// If you want to have a syntax applied when new files are created, set new_file_syntax to the name of the syntax
// to use. The format is exactly the same as "syntax" in the rules below. For example, if you want to have a new
// file use JavaScript syntax, set new_file_syntax to 'JavaScript'.
"new_file_syntax": false,
// Auto add extensions to language settings file in User folder.
// Do not manually remove "apply_syntax_extensions" from the settings file.
// "extenstions" are ignored by "match": "all" setting.
"add_exts_to_lang_settings": true,
// Control level of logging in the console.
// (true|false|"verbose")
"debug": true,
// Put your custom syntax rules here:
"syntaxes": [
]
}

View File

@ -0,0 +1,59 @@
{
"HTML (Rails)":
[
"html.erb"
],
"JSON":
[
".bowerrc",
".csslintrc",
".eslintrc",
".jscsrc",
".jshintrc",
"geojson"
],
"PHP":
[
"inc",
"php3",
"php4",
"php5",
"phtml"
],
"Python":
[
"py3",
"pyw"
],
"Ruby":
[
"jbuilder",
"podspec",
"rabl",
"rake",
"rb",
"simplecov",
"thor"
],
"Ruby Haml":
[
"haml"
],
"Shell-Unix-Generic":
[
"bash",
"sh",
"zsh"
],
"XML":
[
"xml.dist"
],
"YAML":
[
".gemrc",
"YAML-tmLanguage",
"yml",
"yml.dist"
]
}

View File

@ -0,0 +1,5 @@
{
"auto_complete": true,
"auto_complete_selector": "source - comment",
"auto_complete_triggers": [ {"selector": "source.cs", "characters": ".<"} ],
}

View File

@ -0,0 +1,3 @@
{
"ensure_newline_at_eof_on_save":true
}

View File

@ -0,0 +1,21 @@
<snippet>
<content><![CDATA[
// Ben Harris CS228-02 Network Programming
// $1
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main(int argc, char **argv){
$0
return 0;
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>CS228</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.c++</scope>
</snippet>

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Some files were not shown because too many files have changed in this diff Show More