mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 21:19:09 -07:00
Compare commits
116 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3eb8a8e44 | ||
|
|
3afee0505b | ||
|
|
50b74fc06e | ||
|
|
74bf253950 | ||
|
|
434120cc90 | ||
|
|
97e23b3669 | ||
|
|
f9f3dd05c8 | ||
|
|
6e095d9fbc | ||
|
|
c25540a398 | ||
|
|
fae178e8ac | ||
|
|
15ea12d54b | ||
|
|
291de7b2c1 | ||
|
|
bbba28e166 | ||
|
|
27dc8fb22c | ||
|
|
a5f55034fa | ||
|
|
062da36145 | ||
|
|
9e3b929a4b | ||
|
|
3170a41c4b | ||
|
|
b37f95383c | ||
|
|
e6e66b0d05 | ||
|
|
6e6b63cb28 | ||
|
|
20bb942ac6 | ||
|
|
d256cdf12b | ||
|
|
c20739472f | ||
|
|
66e6833623 | ||
|
|
bc5f9a2741 | ||
|
|
04d4ab4d25 | ||
|
|
ce1d4780b6 | ||
|
|
8e79910857 | ||
|
|
999ef09790 | ||
|
|
2f9841e2ac | ||
|
|
2879f63aff | ||
|
|
79a3e1f46c | ||
|
|
62392e3712 | ||
|
|
9717fef420 | ||
|
|
3c83cb1761 | ||
|
|
2a71557663 | ||
|
|
b6a2b65704 | ||
|
|
398e39b9eb | ||
|
|
f6b5cd90fc | ||
|
|
1d14f294eb | ||
|
|
f3cb3607db | ||
|
|
d117ee6b2e | ||
|
|
7e249843a6 | ||
|
|
465bfd37f1 | ||
|
|
5ad1ad4616 | ||
|
|
e82cad68e1 | ||
|
|
5e372e2b35 | ||
|
|
9e392af7d1 | ||
|
|
68bcf536cb | ||
|
|
698f2defa9 | ||
|
|
a42128f5c9 | ||
|
|
6559acbf90 | ||
|
|
a654a7747c | ||
|
|
d158a0a373 | ||
|
|
229d5353e3 | ||
|
|
20389cba90 | ||
|
|
aaf56b794d | ||
|
|
827665279a | ||
|
|
8467bfce20 | ||
|
|
116ae13896 | ||
|
|
0f08f9710a | ||
|
|
9c147af8c1 | ||
|
|
5e498f9bcd | ||
|
|
1cab41bfd5 | ||
|
|
3e225ae2ab | ||
|
|
cc15b17e28 | ||
|
|
7aa9e57a59 | ||
|
|
530b205b3d | ||
|
|
0bed0a80a3 | ||
|
|
244c5da0e7 | ||
|
|
e885afbff9 | ||
|
|
8a0e4cd774 | ||
|
|
5cf313140c | ||
|
|
f0c3ab8753 | ||
|
|
8cd3682a23 | ||
|
|
ee83a40686 | ||
|
|
7f9a3774ae | ||
|
|
8d7c76b227 | ||
|
|
0a92dd0ed7 | ||
|
|
eae69fe414 | ||
|
|
dcef7445b2 | ||
|
|
11d1086a68 | ||
|
|
a88d120b3c | ||
|
|
15479f3829 | ||
|
|
9178794de5 | ||
|
|
fc120b66fe | ||
|
|
57b181bd74 | ||
|
|
aa6a2e806d | ||
|
|
eec3c9ba7a | ||
|
|
d67b18f2ea | ||
|
|
72b82ff2e3 | ||
|
|
6492beb726 | ||
|
|
08142409f8 | ||
|
|
8225785dcc | ||
|
|
c7c97b84c5 | ||
|
|
f9ce8b3df8 | ||
|
|
69c1184b58 | ||
|
|
7e432287ac | ||
|
|
50cb109c99 | ||
|
|
c915b20450 | ||
|
|
f3ea935dd5 | ||
|
|
a6414425b7 | ||
|
|
ad73f12103 | ||
|
|
7d35ace5bb | ||
|
|
e4f2cc94b5 | ||
|
|
fcbe2e781b | ||
|
|
7a5abd73cb | ||
|
|
07926d6673 | ||
|
|
24690e8399 | ||
|
|
2232dce811 | ||
|
|
f6de62700a | ||
|
|
01272f4474 | ||
|
|
e176b0c136 | ||
|
|
67fad831e5 | ||
|
|
048d7fb1ba |
Binary file not shown.
@@ -26,5 +26,8 @@ function verify_dest {
|
|||||||
|
|
||||||
verify_dest "$DEST"
|
verify_dest "$DEST"
|
||||||
|
|
||||||
exec nice rsync -Hax --delete --exclude-from="$HOME/.rsync_ignore" \
|
time nice rsync -Hax --delete --exclude-from="$HOME/.rsync_ignore" \
|
||||||
--delete-excluded "${HOME}/" "$DEST"
|
--delete-excluded "${HOME}/" "$DEST"
|
||||||
|
echo "Backup completed..."
|
||||||
|
time sync
|
||||||
|
echo "Run finished, safe to unmount."
|
||||||
|
|||||||
@@ -1,3 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
CHROME_BINS="google-chrome-beta google-chrome"
|
||||||
|
for bin in ${CHROME_BINS} ; do
|
||||||
|
if command -v ${bin} >/dev/null 2>&1 ; then
|
||||||
|
CHROME=$(command -v ${bin})
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if test -z "${CHROME}" ; then
|
||||||
|
echo "Chrome not found!" >/dev/stderr
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set alternate HOME to use alternate NSS DB
|
||||||
|
export HOME=${HOME}/.chrome-pentest
|
||||||
|
mkdir -p ${HOME}
|
||||||
|
|
||||||
# Launch chrome for burp
|
# Launch chrome for burp
|
||||||
exec /usr/bin/google-chrome-beta --ignore-certificate-errors --user-data-dir=${HOME}/.config/chrome-pentest --proxy-server=127.0.0.1:8080
|
exec ${CHROME} --user-data-dir=${HOME}/chrome-pentest --proxy-server=127.0.0.1:8080
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
LOCKTIME="${SCREENSAVER_MIN:-5}"
|
||||||
LOCKER="i3lock -c 000000"
|
LOCKER="i3lock -c 000000"
|
||||||
# intentionally want word splitting below
|
# intentionally want word splitting below
|
||||||
/usr/bin/xss-lock -- ${LOCKER} &
|
/usr/bin/xss-lock -- ${LOCKER} &
|
||||||
exec /usr/bin/xautolock \
|
exec /usr/bin/xautolock \
|
||||||
-time 5 \
|
-time "${LOCKTIME}" \
|
||||||
-detectsleep \
|
-detectsleep \
|
||||||
-locker "${LOCKER}" \
|
-locker "${LOCKER}" \
|
||||||
-notify 30 \
|
-notify 30 \
|
||||||
|
|||||||
105
bin/install_tool
105
bin/install_tool
@@ -6,6 +6,7 @@ REINSTALL=0
|
|||||||
PACKAGES=1
|
PACKAGES=1
|
||||||
|
|
||||||
while getopts -- "-:" a ; do
|
while getopts -- "-:" a ; do
|
||||||
|
# shellcheck disable=SC2154
|
||||||
case "${a}" in
|
case "${a}" in
|
||||||
-)
|
-)
|
||||||
case "${OPTARG}" in
|
case "${OPTARG}" in
|
||||||
@@ -20,6 +21,11 @@ while getopts -- "-:" a ; do
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown short option ${OPTARG}" >/dev/stderr
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -68,7 +74,7 @@ function check_sudo {
|
|||||||
function add_bin_symlink {
|
function add_bin_symlink {
|
||||||
local TARGET NAME BINDIR
|
local TARGET NAME BINDIR
|
||||||
TARGET="${1}"
|
TARGET="${1}"
|
||||||
NAME="${2:-$(basename ${1})}"
|
NAME="${2:-$(basename "${1}")}"
|
||||||
BINDIR="${HOME}/bin/tools/"
|
BINDIR="${HOME}/bin/tools/"
|
||||||
mkdir -p -- "${BINDIR}"
|
mkdir -p -- "${BINDIR}"
|
||||||
ln -sf "${DESTDIR}/${TARGET}" "${BINDIR}/${NAME}"
|
ln -sf "${DESTDIR}/${TARGET}" "${BINDIR}/${NAME}"
|
||||||
@@ -138,7 +144,7 @@ case ${TOOL} in
|
|||||||
makedest_or_die
|
makedest_or_die
|
||||||
gbase="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/"
|
gbase="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/"
|
||||||
# TODO: find a way to make this version independent
|
# TODO: find a way to make this version independent
|
||||||
gsdk="google-cloud-sdk-209.0.0-linux-x86_64.tar.gz"
|
gsdk="google-cloud-sdk-277.0.0-linux-x86_64.tar.gz"
|
||||||
download "${gbase}${gsdk}" /tmp/gcloud.tar.gz
|
download "${gbase}${gsdk}" /tmp/gcloud.tar.gz
|
||||||
tar zxf /tmp/gcloud.tar.gz --strip-components=1 -C "${DESTDIR}"
|
tar zxf /tmp/gcloud.tar.gz --strip-components=1 -C "${DESTDIR}"
|
||||||
rm /tmp/gcloud.tar.gz
|
rm /tmp/gcloud.tar.gz
|
||||||
@@ -170,7 +176,7 @@ case ${TOOL} in
|
|||||||
;;
|
;;
|
||||||
mitmproxy)
|
mitmproxy)
|
||||||
makedest_or_die
|
makedest_or_die
|
||||||
ver=$(python -c 'import urllib2; import json; print(json.load(urllib2.urlopen("https://api.github.com/repos/mitmproxy/mitmproxy/releases/latest"))["name"].replace("v",""))')
|
ver=$(python3 -c 'from urllib import request; import json; print(json.load(request.urlopen("https://api.github.com/repos/mitmproxy/mitmproxy/releases/latest"))["tag_name"].replace("v",""))')
|
||||||
download \
|
download \
|
||||||
"https://snapshots.mitmproxy.org/${ver}/mitmproxy-${ver}-linux.tar.gz" \
|
"https://snapshots.mitmproxy.org/${ver}/mitmproxy-${ver}-linux.tar.gz" \
|
||||||
/tmp/mitmproxy.tar.gz
|
/tmp/mitmproxy.tar.gz
|
||||||
@@ -178,6 +184,7 @@ case ${TOOL} in
|
|||||||
rm /tmp/mitmproxy.tar.gz
|
rm /tmp/mitmproxy.tar.gz
|
||||||
add_bin_symlink mitmproxy
|
add_bin_symlink mitmproxy
|
||||||
add_bin_symlink mitmweb
|
add_bin_symlink mitmweb
|
||||||
|
add_bin_symlink mitmdump
|
||||||
;;
|
;;
|
||||||
esp)
|
esp)
|
||||||
makedest_or_die
|
makedest_or_die
|
||||||
@@ -214,7 +221,7 @@ case ${TOOL} in
|
|||||||
;;
|
;;
|
||||||
cyberchef)
|
cyberchef)
|
||||||
makedest
|
makedest
|
||||||
src=$(python -c 'import urllib2; import json; print(filter(lambda x: x["name"]=="cyberchef.htm", json.load(urllib2.urlopen("https://api.github.com/repos/gchq/CyberChef/releases/latest"))["assets"])[0]["browser_download_url"])')
|
src=$(python3 -c 'from urllib import request; import json; print(filter(lambda x: x["name"]=="cyberchef.htm", json.load(request.urlopen("https://api.github.com/repos/gchq/CyberChef/releases/latest"))["assets"])[0]["browser_download_url"])')
|
||||||
download "${src}" "${DESTDIR}/cyberchef.html"
|
download "${src}" "${DESTDIR}/cyberchef.html"
|
||||||
;;
|
;;
|
||||||
apktool)
|
apktool)
|
||||||
@@ -259,6 +266,96 @@ case ${TOOL} in
|
|||||||
https://github.com/hugsy/gef/raw/master/gef.py \
|
https://github.com/hugsy/gef/raw/master/gef.py \
|
||||||
"${DESTDIR}/gef.py"
|
"${DESTDIR}/gef.py"
|
||||||
;;
|
;;
|
||||||
|
aflplusplus)
|
||||||
|
install_pkgs libtool-bin libglib2.0-dev libpixman-1-dev clang clang-tools \
|
||||||
|
llvm
|
||||||
|
git clone "https://github.com/vanhauser-thc/AFLplusplus" "${DESTDIR}"
|
||||||
|
make -C "${DESTDIR}" distrib
|
||||||
|
;;
|
||||||
|
exploitdb)
|
||||||
|
if test -d "${DESTDIR}" ; then
|
||||||
|
echo "Already installed, updating instead..." >/dev/stderr
|
||||||
|
"${DESTDIR}/searchsplit" -u
|
||||||
|
else
|
||||||
|
git clone --depth 1 \
|
||||||
|
https://github.com/offensive-security/exploitdb.git \
|
||||||
|
"${DESTDIR}"
|
||||||
|
add_bin_symlink searchsploit
|
||||||
|
cp "${DESTDIR}/.searchsploit_rc" "${HOME}/.searchsploit_rc"
|
||||||
|
sed -i "s|/opt/exploitdb|${DESTDIR}|" "${HOME}/.searchsploit_rc"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
cura)
|
||||||
|
makedest
|
||||||
|
ver=$(python3 -c 'from urllib import request; import json; print(json.load(request.urlopen("https://api.github.com/repos/Ultimaker/Cura/releases/latest"))["name"].replace("v",""))')
|
||||||
|
echo "Latest Cura is ${ver}"
|
||||||
|
download \
|
||||||
|
"https://github.com/Ultimaker/Cura/releases/download/${ver}/Cura-${ver}.AppImage" \
|
||||||
|
"${DESTDIR}/Cura.AppImage"
|
||||||
|
chmod +x "${DESTDIR}/Cura.AppImage"
|
||||||
|
add_bin_symlink "Cura.AppImage" cura
|
||||||
|
;;
|
||||||
|
rr)
|
||||||
|
ver=$(python3 -c 'from urllib import request; import json; print(json.load(request.urlopen("https://api.github.com/repos/mozilla/rr/releases/latest"))["name"])')
|
||||||
|
echo "Latest rr is ${ver}"
|
||||||
|
download \
|
||||||
|
"https://github.com/mozilla/rr/releases/download/${ver}/rr-${ver}-Linux-$(uname -m).deb" \
|
||||||
|
"/tmp/rr.deb"
|
||||||
|
sudo dpkg -i /tmp/rr.deb
|
||||||
|
;;
|
||||||
|
nmap-parse-output)
|
||||||
|
git clone --depth 1 \
|
||||||
|
https://github.com/ernw/nmap-parse-output.git \
|
||||||
|
"${DESTDIR}"
|
||||||
|
add_bin_symlink nmap-parse-output
|
||||||
|
cat <<EOF >"${HOME}/.zshrc.d/99-nmap-parse-output.zsh"
|
||||||
|
if test -d ${DESTDIR} ; then
|
||||||
|
autoload bashcompinit
|
||||||
|
bashcompinit
|
||||||
|
source ${DESTDIR}/_nmap-parse-output
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
logiops)
|
||||||
|
install_pkgs cmake libevdev-dev libudev-dev libconfig++-dev checkinstall
|
||||||
|
git clone "https://github.com/PixlOne/logiops.git" "${DESTDIR}"
|
||||||
|
mkdir -p "${DESTDIR}/build"
|
||||||
|
cd "${DESTDIR}/build"
|
||||||
|
cmake ..
|
||||||
|
make
|
||||||
|
sudo checkinstall --pkgname logiops --maintainer "${USER}" -y
|
||||||
|
;;
|
||||||
|
aws)
|
||||||
|
DN=$(mktemp -d)
|
||||||
|
cd "${DN}"
|
||||||
|
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "${DN}/awscliv2.zip"
|
||||||
|
unzip "${DN}/awscliv2.zip"
|
||||||
|
mv "${DN}/aws/dist" "${DESTDIR}"
|
||||||
|
add_bin_symlink aws
|
||||||
|
rm -rf ${DN}
|
||||||
|
;;
|
||||||
|
tmpmail)
|
||||||
|
install_pkgs curl w3m jq
|
||||||
|
mkdir -p ${DESTDIR}
|
||||||
|
curl -L "https://git.io/tmpmail" > ${DESTDIR}/tmpmail
|
||||||
|
chmod +x ${DESTDIR}/tmpmail
|
||||||
|
add_bin_symlink tmpmail
|
||||||
|
;;
|
||||||
|
gf)
|
||||||
|
install_pkgs golang-go silversearcher-ag
|
||||||
|
go get -u github.com/tomnomnom/gf
|
||||||
|
mkdir -p ${HOME}/.config
|
||||||
|
git clone https://github.com/Matir/gf-patterns.git ${HOME}/.config/gf
|
||||||
|
;;
|
||||||
|
ffuf)
|
||||||
|
go get -u github.com/ffuf/ffuf
|
||||||
|
;;
|
||||||
|
gobuster)
|
||||||
|
go get -u github.com/OJ/gobuster
|
||||||
|
;;
|
||||||
|
amass)
|
||||||
|
go get -u github.com/OWASP/Amass/cmd/amass
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown tool: ${TOOL}" >/dev/stderr
|
echo "Unknown tool: ${TOOL}" >/dev/stderr
|
||||||
echo "Options:" >/dev/stderr
|
echo "Options:" >/dev/stderr
|
||||||
|
|||||||
22
bin/nvidia_hold.sh
Executable file
22
bin/nvidia_hold.sh
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function list_nvidia_installed {
|
||||||
|
dpkg-query -l '*nvidia*' | grep '^[hi]i' | awk '{print $2}'
|
||||||
|
}
|
||||||
|
|
||||||
|
function hold_or_unhold {
|
||||||
|
apt-mark "${1:-hold}" $(list_nvidia_installed)
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
hold|h)
|
||||||
|
hold_or_unhold hold
|
||||||
|
;;
|
||||||
|
unhold|u)
|
||||||
|
hold_or_unhold unhold
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "$0 <hold|unhold>" >/dev/stderr
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
46
bin/pactl_helper
Executable file
46
bin/pactl_helper
Executable file
@@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function get_active_sink {
|
||||||
|
pactl list short sinks | grep RUNNING | awk '{print $2}'
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_active_source {
|
||||||
|
pactl list short sources | grep RUNNING | awk '{print $2}'
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_default_sink {
|
||||||
|
pactl info | grep '^Default Sink:' | awk '{print $NF}'
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_default_source {
|
||||||
|
pactl info | grep '^Default Source:' | awk '{print $NF}'
|
||||||
|
}
|
||||||
|
|
||||||
|
function micmute {
|
||||||
|
MODE=${1:-toggle}
|
||||||
|
pactl set-source-mute $(get_default_source) ${MODE}
|
||||||
|
}
|
||||||
|
|
||||||
|
function mute {
|
||||||
|
MODE=${1:-toggle}
|
||||||
|
pactl set-sink-mute $(get_default_sink) ${MODE}
|
||||||
|
}
|
||||||
|
|
||||||
|
function volume {
|
||||||
|
VOL="${1}"
|
||||||
|
if test -z "${VOL}" ; then
|
||||||
|
echo "Need volume spec!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
pactl set-sink-volume $(get_default_sink) "${VOL}"
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
mute|micmute|volume)
|
||||||
|
$*
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown command!"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
48
bin/qdisc_span.sh
Executable file
48
bin/qdisc_span.sh
Executable file
@@ -0,0 +1,48 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -ue
|
||||||
|
|
||||||
|
ACTION="add"
|
||||||
|
|
||||||
|
if [ "${1}" == "-d" ] ; then
|
||||||
|
ACTION="del"
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
BRIDGE="${1}"
|
||||||
|
DEST="${2}"
|
||||||
|
|
||||||
|
function setup_span {
|
||||||
|
if tc qdisc show dev "${1}" | grep -q 'qdisc ingress ffff' ; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
tc qdisc add dev "${1}" ingress
|
||||||
|
tc filter add dev "${1}" parent ffff: protocol all u32 match u8 0 0 action mirred egress mirror dev "${DEST}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function del_span {
|
||||||
|
tc qdisc del dev "${1}" ingress
|
||||||
|
}
|
||||||
|
|
||||||
|
function handle_iface {
|
||||||
|
case "${ACTION}" in
|
||||||
|
add)
|
||||||
|
setup_span "${1}"
|
||||||
|
;;
|
||||||
|
del)
|
||||||
|
del_span "${1}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown action!"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_bridge_ifaces {
|
||||||
|
bridge link | grep "master ${1}" | cut -d: -f2 | cut -d@ -f1
|
||||||
|
}
|
||||||
|
|
||||||
|
for iface in $(get_bridge_ifaces "${BRIDGE}") ; do
|
||||||
|
handle_iface "$iface"
|
||||||
|
done
|
||||||
62
bin/screenshot.sh
Executable file
62
bin/screenshot.sh
Executable file
@@ -0,0 +1,62 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Screenshot tool to try a few different tools
|
||||||
|
|
||||||
|
set -ue
|
||||||
|
|
||||||
|
TOOLS="flameshot scrot"
|
||||||
|
SCREENDIR=${SCREENDIR:-${HOME}/Pictures/Screenshots}
|
||||||
|
SCROT_FORMAT="%F-%T.png"
|
||||||
|
|
||||||
|
function default_screenshot_command {
|
||||||
|
for tool in ${TOOLS} ; do
|
||||||
|
if which "${tool}" >/dev/null 2>&1 ; then
|
||||||
|
echo "${tool}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
TOOL=${SHOT:-$(default_screenshot_command)}
|
||||||
|
CMD=${1:-region}
|
||||||
|
|
||||||
|
function flameshot_gui_capture {
|
||||||
|
flameshot gui -p "${SCREENDIR}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function flameshot_region_capture {
|
||||||
|
flameshot_gui_capture
|
||||||
|
}
|
||||||
|
|
||||||
|
function flameshot_window_capture {
|
||||||
|
flameshot_gui_capture
|
||||||
|
}
|
||||||
|
|
||||||
|
function flameshot_full_capture {
|
||||||
|
flameshot full -p "${SCREENDIR}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function scrot_region_capture {
|
||||||
|
scrot -s "${SCREENDIR}/${SCROT_FORMAT}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function scrot_window_capture {
|
||||||
|
scrot -u "${SCREENDIR}/${SCROT_FORMAT}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function scrot_full_capture {
|
||||||
|
scrot "${SCREENDIR}/${SCROT_FORMAT}"
|
||||||
|
}
|
||||||
|
|
||||||
|
case "${CMD}" in
|
||||||
|
region|window|full)
|
||||||
|
mkdir -p "${SCREENDIR}"
|
||||||
|
${TOOL}_${CMD}_capture
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 [region|window|full]" >/dev/stderr
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
16
clone.sh
16
clone.sh
@@ -4,15 +4,21 @@ set -ue
|
|||||||
|
|
||||||
# Script to clone and install
|
# Script to clone and install
|
||||||
|
|
||||||
if ! command -v git >/dev/null 2>&1 ; then
|
# Wrapped in a function to prevent incomplete execution if download is
|
||||||
|
# interrupted
|
||||||
|
function installer_main {
|
||||||
|
if ! command -v git >/dev/null 2>&1 ; then
|
||||||
( if [ "$EUID" != 0 ] ; then
|
( if [ "$EUID" != 0 ] ; then
|
||||||
sudo apt install -y git
|
sudo apt install -y git
|
||||||
else
|
else
|
||||||
apt install -y git
|
apt install -y git
|
||||||
fi ) || ( echo 'Failed to install git!' >/dev/stderr; false)
|
fi ) || ( echo 'Failed to install git!' >/dev/stderr; false)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git clone https://github.com/Matir/skel.git ${HOME}/.skel
|
git clone https://github.com/Matir/skel.git ${HOME}/.skel
|
||||||
|
|
||||||
${HOME}/.skel/install.sh
|
${HOME}/.skel/install.sh
|
||||||
${HOME}/.skel/install.sh packages minimal
|
${HOME}/.skel/install.sh packages minimal
|
||||||
|
}
|
||||||
|
|
||||||
|
installer_main
|
||||||
|
|||||||
10
conf/logid.cfg
Normal file
10
conf/logid.cfg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
devices: ({
|
||||||
|
name: "Wireless Mouse MX Master 3";
|
||||||
|
|
||||||
|
smartshift: {
|
||||||
|
on: true;
|
||||||
|
threshold: 30;
|
||||||
|
};
|
||||||
|
|
||||||
|
dpi: 1500;
|
||||||
|
});
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||||
|
|
||||||
# Cryptsetup alias
|
# Cryptsetup alias
|
||||||
alias luksFormat='cryptsetup luksFormat -s 512 -c aes-xts-plain64 -h sha256 -i 15000'
|
alias luksFormat='cryptsetup luksFormat --type=luks2 --pbkdf-memory=2560000 --pbkdf=argon2id -i 15000 -s 512 -h sha256 -c aes-xts-plain64'
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
if ls --version >/dev/null 2>&1 ; then
|
if ls --version >/dev/null 2>&1 ; then
|
||||||
@@ -37,4 +37,19 @@ alias dircount="for d in * ; do find \$d -type d | wc -l | tr -d '\n' ; echo ' '
|
|||||||
alias drop_caches="echo 3 | sudo /usr/bin/tee /proc/sys/vm/drop_caches"
|
alias drop_caches="echo 3 | sudo /usr/bin/tee /proc/sys/vm/drop_caches"
|
||||||
|
|
||||||
# dump acpi temperature
|
# dump acpi temperature
|
||||||
alias temp='printf "%02.2f\n" "$(cat /sys/class/thermal/thermal_zone0/temp)e-3"'
|
alias gettemp='printf "%02.2f\n" "$(cat /sys/class/thermal/thermal_zone0/temp)e-3"'
|
||||||
|
|
||||||
|
# get git working directory
|
||||||
|
alias gitroot="git rev-parse --show-toplevel"
|
||||||
|
|
||||||
|
# SSH without host key checking
|
||||||
|
alias sshanon="ssh -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no"
|
||||||
|
|
||||||
|
# Straight to ipython
|
||||||
|
alias ipy="ipython3"
|
||||||
|
|
||||||
|
# Skip the header on bc
|
||||||
|
alias bc="command bc -q"
|
||||||
|
|
||||||
|
# Get a decently readable df
|
||||||
|
alias dfh="df -h -x tmpfs -x devtmpfs"
|
||||||
|
|||||||
39
dotfiles/config/htop/htoprc
Normal file
39
dotfiles/config/htop/htoprc
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# Beware! This file is rewritten by htop when settings are changed in the interface.
|
||||||
|
# The parser is also very primitive, and not human-friendly.
|
||||||
|
fields=0 48 17 18 38 39 40 2 46 47 49 1
|
||||||
|
sort_key=46
|
||||||
|
sort_direction=-1
|
||||||
|
tree_sort_key=0
|
||||||
|
tree_sort_direction=1
|
||||||
|
hide_kernel_threads=1
|
||||||
|
hide_userland_threads=1
|
||||||
|
shadow_other_users=0
|
||||||
|
show_thread_names=0
|
||||||
|
show_program_path=1
|
||||||
|
highlight_base_name=0
|
||||||
|
highlight_megabytes=1
|
||||||
|
highlight_threads=1
|
||||||
|
highlight_changes=0
|
||||||
|
highlight_changes_delay_secs=5
|
||||||
|
find_comm_in_cmdline=1
|
||||||
|
strip_exe_from_cmdline=1
|
||||||
|
show_merged_command=0
|
||||||
|
tree_view=0
|
||||||
|
tree_view_always_by_pid=0
|
||||||
|
header_margin=1
|
||||||
|
detailed_cpu_time=0
|
||||||
|
cpu_count_from_one=1
|
||||||
|
show_cpu_usage=1
|
||||||
|
show_cpu_frequency=0
|
||||||
|
show_cpu_temperature=0
|
||||||
|
degree_fahrenheit=0
|
||||||
|
update_process_names=0
|
||||||
|
account_guest_in_cpu_meter=0
|
||||||
|
color_scheme=6
|
||||||
|
enable_mouse=1
|
||||||
|
delay=15
|
||||||
|
left_meters=AllCPUs Memory Swap
|
||||||
|
left_meter_modes=1 1 1
|
||||||
|
right_meters=Tasks LoadAverage Uptime
|
||||||
|
right_meter_modes=2 2 2
|
||||||
|
hide_function_bar=0
|
||||||
@@ -135,6 +135,8 @@ bindsym $mod+l exec \
|
|||||||
bash -c "i3lock -c 000000 && (sleep 2 && xset dpms force off) &"
|
bash -c "i3lock -c 000000 && (sleep 2 && xset dpms force off) &"
|
||||||
bindsym $alt+Control+l exec \
|
bindsym $alt+Control+l exec \
|
||||||
bash -c "i3lock -c 000000 && (sleep 2 && xset dpms force off) &"
|
bash -c "i3lock -c 000000 && (sleep 2 && xset dpms force off) &"
|
||||||
|
# suspend under systemd
|
||||||
|
bindsym $mod+Control+s exec --no-startup-id systemctl suspend
|
||||||
|
|
||||||
# things to start quickly
|
# things to start quickly
|
||||||
bindsym $mod+g exec /usr/bin/google-chrome-beta --password-store=gnome
|
bindsym $mod+g exec /usr/bin/google-chrome-beta --password-store=gnome
|
||||||
@@ -146,39 +148,33 @@ bindsym --whole-window $mod+button3 floating toggle
|
|||||||
|
|
||||||
# media keys
|
# media keys
|
||||||
# Pulse Audio controls
|
# Pulse Audio controls
|
||||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5%
|
bindsym XF86AudioRaiseVolume exec --no-startup-id ~/bin/pactl_helper volume +5%
|
||||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5%
|
bindsym XF86AudioLowerVolume exec --no-startup-id ~/bin/pactl_helper volume -5%
|
||||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle
|
bindsym XF86AudioMute exec --no-startup-id ~/bin/pactl_helper mute toggle
|
||||||
|
bindsym XF86AudioMicMute exec --no-startup-id ~/bin/pactl_helper micmute toggle
|
||||||
|
bindsym F13 exec --no-startup-id ~/bin/pactl_helper micmute toggle
|
||||||
# Screen brightness controls
|
# Screen brightness controls
|
||||||
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 10
|
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 10
|
||||||
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 10
|
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 10
|
||||||
|
|
||||||
# screenshots
|
# screenshots
|
||||||
set $scrotformat %F-%T.png
|
# region/selection
|
||||||
set $screendir ~/Pictures/Screenshots
|
|
||||||
# whole screen
|
|
||||||
bindsym --release Print exec --no-startup-id \
|
bindsym --release Print exec --no-startup-id \
|
||||||
mkdir -p $screendir && \
|
~/bin/screenshot.sh region
|
||||||
/usr/bin/scrot $screendir/$scrotformat
|
# full screen
|
||||||
# current window
|
|
||||||
bindsym --release Shift+Print exec --no-startup-id \
|
bindsym --release Shift+Print exec --no-startup-id \
|
||||||
mkdir -p $screendir && \
|
~/bin/screenshot.sh full
|
||||||
/usr/bin/scrot -u $screendir/$scrotformat
|
# single window
|
||||||
# selection
|
|
||||||
bindsym --release $alt+Sys_Req exec --no-startup-id \
|
bindsym --release $alt+Sys_Req exec --no-startup-id \
|
||||||
mkdir -p $screendir && \
|
~/bin/screenshot.sh window
|
||||||
/usr/bin/scrot -s $screendir/$scrotformat
|
|
||||||
|
|
||||||
# useful utilities
|
# useful utilities
|
||||||
#exec --no-startup-id \
|
|
||||||
# (which xss-lock >/dev/null || /usr/bin/cinnamon-settings-daemon) &
|
|
||||||
exec --no-startup-id gnome-keyring-daemon --start --components=pkcs11,secrets
|
exec --no-startup-id gnome-keyring-daemon --start --components=pkcs11,secrets
|
||||||
# Make GTK fonts look great again
|
|
||||||
#exec --no-startup-id gnome-settings-daemon
|
|
||||||
#exec --no-startup-id (sleep 2; nm-applet) &
|
|
||||||
exec --no-startup-id xset r rate 200 20
|
exec --no-startup-id xset r rate 200 20
|
||||||
#exec --no-startup-id ~/bin/autostart.py
|
#exec --no-startup-id ~/bin/autostart.py
|
||||||
exec --no-startup-id dex --autostart --environment x-cinnamon
|
exec --no-startup-id dex --autostart --environment x-cinnamon
|
||||||
|
# Solaar for mouse
|
||||||
|
exec --no-startup-id sh -c 'command solaar -w hide || true'
|
||||||
|
|
||||||
# customize windows
|
# customize windows
|
||||||
for_window [window_role="pop-up"] floating enable
|
for_window [window_role="pop-up"] floating enable
|
||||||
|
|||||||
15
dotfiles/config/user-dirs.dirs
Normal file
15
dotfiles/config/user-dirs.dirs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# This file is written by xdg-user-dirs-update
|
||||||
|
# If you want to change or add directories, just edit the line you're
|
||||||
|
# interested in. All local changes will be retained on the next run
|
||||||
|
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
|
||||||
|
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
|
||||||
|
# absolute path. No other format is supported.
|
||||||
|
#
|
||||||
|
XDG_DESKTOP_DIR="$HOME/Desktop"
|
||||||
|
XDG_DOWNLOAD_DIR="$HOME/Downloads"
|
||||||
|
XDG_TEMPLATES_DIR="$HOME/"
|
||||||
|
XDG_PUBLICSHARE_DIR="$HOME/Shared"
|
||||||
|
XDG_DOCUMENTS_DIR="$HOME/Documents"
|
||||||
|
XDG_MUSIC_DIR="$HOME/Music"
|
||||||
|
XDG_PICTURES_DIR="$HOME/Pictures"
|
||||||
|
XDG_VIDEOS_DIR="$HOME/Videos"
|
||||||
@@ -6,7 +6,7 @@ umask 027
|
|||||||
# Paths and preferences
|
# Paths and preferences
|
||||||
export PYTHONPATH="$HOME/.python:$PYTHONPATH"
|
export PYTHONPATH="$HOME/.python:$PYTHONPATH"
|
||||||
export GOPATH="$HOME/Projects/Go:/usr/share/gocode"
|
export GOPATH="$HOME/Projects/Go:/usr/share/gocode"
|
||||||
export PATH="$HOME/bin:/sbin:/usr/sbin:$PATH:$GOPATH/bin"
|
export PATH="$HOME/bin:$HOME/bin/tools:/sbin:/usr/sbin:$PATH:$HOME/Projects/Go/bin"
|
||||||
export VISUAL=vim
|
export VISUAL=vim
|
||||||
export EDITOR=vim
|
export EDITOR=vim
|
||||||
export DEBEMAIL="david@systemoverlord.com"
|
export DEBEMAIL="david@systemoverlord.com"
|
||||||
@@ -40,14 +40,13 @@ fi
|
|||||||
|
|
||||||
# For virtualenvwrapper
|
# For virtualenvwrapper
|
||||||
export WORKON_HOME=$HOME/.virtualenvs
|
export WORKON_HOME=$HOME/.virtualenvs
|
||||||
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
|
|
||||||
|
|
||||||
# GPG full key id
|
# GPG full key id
|
||||||
export GPG_ID=7FD58D9A196DCEEEAD671F94F4D7A7915DEA789B
|
export GPG_ID=7FD58D9A196DCEEEAD671F94F4D7A7915DEA789B
|
||||||
|
|
||||||
# Setup locale
|
# Setup locale
|
||||||
if test -x /usr/bin/locale ; then
|
if test -x /usr/bin/locale ; then
|
||||||
for l in en_US.utf8 C.UTF-8 C ; do
|
for l in en_US.utf8 en_US.UTF-8 C.UTF-8 C ; do
|
||||||
if /usr/bin/locale -a | grep -q "${l}" ; then
|
if /usr/bin/locale -a | grep -q "${l}" ; then
|
||||||
export LC_CTYPE=${l}
|
export LC_CTYPE=${l}
|
||||||
export LC_NUMERIC=${l}
|
export LC_NUMERIC=${l}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
[user]
|
[user]
|
||||||
name = David Tomaschik
|
name = David Tomaschik
|
||||||
email = david@systemoverlord.com
|
|
||||||
signingKey = 0x5DEA789B
|
signingKey = 0x5DEA789B
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
@@ -66,3 +65,9 @@
|
|||||||
conflictstyle = diff3
|
conflictstyle = diff3
|
||||||
[mergetool]
|
[mergetool]
|
||||||
prompt = false
|
prompt = false
|
||||||
|
[include]
|
||||||
|
path = ~/.gitconfig.local
|
||||||
|
[pull]
|
||||||
|
rebase = false
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
|
|||||||
@@ -1,13 +1,27 @@
|
|||||||
tmp
|
.AndroidStudio*
|
||||||
Downloads
|
.Genymobile
|
||||||
|
.Ticket to Ride*
|
||||||
|
.android*
|
||||||
|
.arduino*
|
||||||
|
.bundle
|
||||||
.cache
|
.cache
|
||||||
.local/share/Trash
|
.dropbox-dist
|
||||||
.wine
|
.gradle
|
||||||
.thumbnails
|
|
||||||
.histfile
|
.histfile
|
||||||
|
.local/share/Steam
|
||||||
|
.local/share/Trash
|
||||||
|
.local/lib
|
||||||
|
.rvm*
|
||||||
|
.sliver
|
||||||
|
.sqlite_history
|
||||||
|
.thumbnails
|
||||||
|
.wine
|
||||||
.zcompdump
|
.zcompdump
|
||||||
.zcompdump*
|
.zcompdump*
|
||||||
.sqlite_history
|
|
||||||
VirtualBox VMs
|
|
||||||
Audits
|
Audits
|
||||||
|
Downloads
|
||||||
SpiderOak Hive
|
SpiderOak Hive
|
||||||
|
VirtualBox VMs
|
||||||
|
tmp
|
||||||
|
tools
|
||||||
|
.minikube
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ CanonicalizeMaxDots 0
|
|||||||
Host *.*
|
Host *.*
|
||||||
CheckHostIP yes
|
CheckHostIP yes
|
||||||
|
|
||||||
|
Host *.cloudshell.dev
|
||||||
|
# Cloudshell hostnames are too long for unix sockets
|
||||||
|
ControlMaster no
|
||||||
|
|
||||||
Match canonical all
|
Match canonical all
|
||||||
CheckHostIP no
|
CheckHostIP no
|
||||||
ControlMaster auto
|
ControlMaster auto
|
||||||
|
|||||||
@@ -1,7 +1,27 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
REMOTE_LINK="${HOME}/.ssh/remote_agent.sock"
|
# Roughly based on this article:
|
||||||
|
# https://werat.github.io/2017/02/04/tmux-ssh-agent-forwarding.html
|
||||||
|
|
||||||
if test \! -L "${REMOTE_LINK}" -a -n "${SSH_AUTH_SOCK}" ; then
|
REMOTE_LINK="${HOME}/.ssh/ssh_auth_sock"
|
||||||
|
|
||||||
|
if [ "${1:-}" = "force" ] && [ -S "${SSH_AUTH_SOCK}" ] ; then
|
||||||
|
ln -sf "${SSH_AUTH_SOCK}" "${REMOTE_LINK}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test \! -S "${REMOTE_LINK}" -a -S "${SSH_AUTH_SOCK}" ; then
|
||||||
ln -sf "${SSH_AUTH_SOCK}" "${REMOTE_LINK}"
|
ln -sf "${SSH_AUTH_SOCK}" "${REMOTE_LINK}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Handle X forwarding, per sshd(8)
|
||||||
|
if read proto cookie && [ -n "$DISPLAY" ]; then
|
||||||
|
if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then
|
||||||
|
# X11UseLocalhost=yes
|
||||||
|
echo add unix:`echo $DISPLAY |
|
||||||
|
cut -c11-` $proto $cookie
|
||||||
|
else
|
||||||
|
# X11UseLocalhost=no
|
||||||
|
echo add $DISPLAY $proto $cookie
|
||||||
|
fi | xauth -q -
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Update environment on reconnect
|
# Update environment on reconnect
|
||||||
set -g update-environment "DISPLAY WINDOWID SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION"
|
set -g update-environment "DISPLAY WINDOWID SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION"
|
||||||
|
|
||||||
|
# Use symlink socket
|
||||||
|
set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
|
||||||
|
|
||||||
# Custom binds
|
# Custom binds
|
||||||
bind K confirm kill-server
|
bind K confirm kill-server
|
||||||
bind X confirm kill-window
|
bind X confirm kill-window
|
||||||
|
|||||||
Submodule dotfiles/tmux/tmux-logging updated: b085ad423b...4717cbd4c8
Submodule dotfiles/vim/pack/matir/opt/solarized8 updated: 9afbe12f68...7b6399093c
Submodule dotfiles/vim/pack/matir/start/ctrlp updated: 2e773fd8c7...3866ae170a
Submodule dotfiles/vim/pack/matir/start/editorconfig updated: c718cefc51...8f6eba5fd6
Submodule dotfiles/vim/pack/matir/start/fugitive updated: 35f1095f9b...89e6b5e4e1
Submodule dotfiles/vim/pack/matir/start/surround updated: fab8621670...f51a26d371
Submodule dotfiles/vim/pack/matir/start/syntastic updated: 0336c35c0b...dd22667306
Submodule dotfiles/vim/pack/matir/start/vim-go updated: 13128e5f30...b919c60a6d
@@ -23,12 +23,31 @@ set expandtab
|
|||||||
set shiftround
|
set shiftround
|
||||||
set backspace=indent,eol,start
|
set backspace=indent,eol,start
|
||||||
" Shift-tab to go backwards in insert mode
|
" Shift-tab to go backwards in insert mode
|
||||||
imap <S-Tab> <Esc><<A
|
" Does not work with YCM
|
||||||
|
inoremap <S-Tab> <C-d>
|
||||||
|
|
||||||
" Line numbering, ruler
|
" Line numbering, ruler
|
||||||
set number
|
set number
|
||||||
set ruler
|
set ruler
|
||||||
|
|
||||||
|
" Setup viminfo for recording positions, etc.
|
||||||
|
set viminfo='10,\"100,:20,%,n~/.viminfo
|
||||||
|
" Jump back when editing a file
|
||||||
|
function! ResCur()
|
||||||
|
" Don't jump in git commits since they're generated.
|
||||||
|
if &ft == 'gitcommit'
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
if line("'\"") <= line("$")
|
||||||
|
normal! g`"
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
augroup resCur
|
||||||
|
autocmd!
|
||||||
|
autocmd BufWinEnter * call ResCur()
|
||||||
|
augroup END
|
||||||
|
|
||||||
" File options
|
" File options
|
||||||
set encoding=utf-8
|
set encoding=utf-8
|
||||||
" Syntax highlighting, look and feel
|
" Syntax highlighting, look and feel
|
||||||
@@ -116,6 +135,9 @@ let g:syntastic_enable_signs = 1
|
|||||||
let g:syntastic_auto_loc_list = 2
|
let g:syntastic_auto_loc_list = 2
|
||||||
let g:syntastic_go_checkers = ['govet', 'errcheck', 'go']
|
let g:syntastic_go_checkers = ['govet', 'errcheck', 'go']
|
||||||
let g:syntastic_python_checkers=['flake8']
|
let g:syntastic_python_checkers=['flake8']
|
||||||
|
" Because XXE
|
||||||
|
let g:syntastic_xml_checkers=['']
|
||||||
|
let g:syntastic_xslt_checkers=['']
|
||||||
|
|
||||||
" Have F5 run the tests and display errors
|
" Have F5 run the tests and display errors
|
||||||
nnoremap <silent> <F5> :SyntasticCheck<CR> :Errors<CR>
|
nnoremap <silent> <F5> :SyntasticCheck<CR> :Errors<CR>
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ content_disposition = on
|
|||||||
# Recursive download options
|
# Recursive download options
|
||||||
no_parent = on
|
no_parent = on
|
||||||
follow_ftp = on
|
follow_ftp = on
|
||||||
adjust_extension = on
|
# Good for HTML, not for other things
|
||||||
|
adjust_extension = off
|
||||||
robots = off
|
robots = off
|
||||||
|
|
||||||
# Show responses
|
# Show responses
|
||||||
|
|||||||
@@ -83,29 +83,30 @@ bindkey '^h' backward-delete-char
|
|||||||
# ok, a few emacs convenience bindings
|
# ok, a few emacs convenience bindings
|
||||||
bindkey '^w' backward-kill-word
|
bindkey '^w' backward-kill-word
|
||||||
bindkey '^r' history-incremental-search-backward
|
bindkey '^r' history-incremental-search-backward
|
||||||
|
# delete really deletes
|
||||||
|
bindkey "^[[3~" delete-char
|
||||||
|
|
||||||
# Source extras and aliases if interactive
|
# Source extras and aliases if interactive
|
||||||
if [[ $- == *i* ]] ; then
|
if [[ $- == *i* ]] ; then
|
||||||
if [[ -e $HOME/.aliases ]] ; then source $HOME/.aliases ; fi
|
if [[ -e $HOME/.aliases ]] ; then source $HOME/.aliases ; fi
|
||||||
|
if [[ -e $HOME/.aliases.local ]] ; then source $HOME/.aliases.local ; fi
|
||||||
# zsh-only-ism to avoid error if glob doesn't expand
|
# zsh-only-ism to avoid error if glob doesn't expand
|
||||||
for file in $HOME/.zshrc.d/[a-zA-Z0-9]*.zsh(N) ; do
|
for file in $HOME/.zshrc.d/[a-zA-Z0-9]*.zsh(N) ; do
|
||||||
source "$file"
|
source "$file"
|
||||||
done
|
done
|
||||||
# extra completions, prompt
|
# extra completions, prompt
|
||||||
fpath=(~/.zshrc.completions ~/.zshrc.d/matir_prompt $fpath)
|
fpath=(~/.zshrc.completions ~/.zshrc.d/matir_prompt ~/.zshrc.d/agnoster_prompt $fpath)
|
||||||
# Completion
|
# Completion
|
||||||
zstyle ':compinstall' filename "${HOME}/.zshrc"
|
zstyle ':compinstall' filename "${HOME}/.zshrc"
|
||||||
zstyle ':completion:*' users root ${USER}
|
zstyle ':completion:*' users root ${USER}
|
||||||
# Modules after fpath
|
# Modules after fpath
|
||||||
autoload -Uz compinit && compinit -i
|
autoload -Uz compinit && compinit -i
|
||||||
autoload -Uz promptinit && promptinit
|
autoload -Uz promptinit && promptinit
|
||||||
# Prompt
|
|
||||||
prompt matir
|
|
||||||
# Virtualenvwrapper
|
# Virtualenvwrapper
|
||||||
if test -f /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh ; then
|
if test -f /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh ; then
|
||||||
source /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh
|
source /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh
|
||||||
fi
|
fi
|
||||||
if command ls --version 2>&1 >/dev/null ; then
|
if command ls --version >/dev/null 2>&1 ; then
|
||||||
alias ls="$(whence -p ls) --color -C"
|
alias ls="$(whence -p ls) --color -C"
|
||||||
fi
|
fi
|
||||||
# Syntax highlighting and substring search
|
# Syntax highlighting and substring search
|
||||||
@@ -119,6 +120,14 @@ if [[ $- == *i* ]] ; then
|
|||||||
bindkey -M vicmd 'k' history-substring-search-up
|
bindkey -M vicmd 'k' history-substring-search-up
|
||||||
bindkey -M vicmd 'j' history-substring-search-down
|
bindkey -M vicmd 'j' history-substring-search-down
|
||||||
fi
|
fi
|
||||||
|
# Suggestions
|
||||||
|
if test -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ; then
|
||||||
|
# Works well for solarized
|
||||||
|
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=10"
|
||||||
|
# Strategy -- note that 'completion' is slow AF
|
||||||
|
ZSH_AUTOSUGGEST_STRATEGY=(history)
|
||||||
|
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||||
|
fi
|
||||||
fi # End interactive-only block
|
fi # End interactive-only block
|
||||||
|
|
||||||
# In case ack is named ack-grep
|
# In case ack is named ack-grep
|
||||||
@@ -126,8 +135,10 @@ if [ -x /usr/bin/ack-grep ] ; then
|
|||||||
alias ack='/usr/bin/ack-grep'
|
alias ack='/usr/bin/ack-grep'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Setup PATH for tools
|
# Got rust?
|
||||||
PATH=${PATH}:${HOME}/bin/tools
|
if test -d ${HOME}/.cargo/bin ; then
|
||||||
|
PATH=${PATH}:${HOME}/.cargo/bin
|
||||||
|
fi
|
||||||
|
|
||||||
# Most is nice, if we have it
|
# Most is nice, if we have it
|
||||||
if command -v most >/dev/null 2>&1; then
|
if command -v most >/dev/null 2>&1; then
|
||||||
@@ -136,3 +147,6 @@ fi
|
|||||||
|
|
||||||
# Load any local settings
|
# Load any local settings
|
||||||
if [ -e $HOME/.zshrc.local ] ; then source $HOME/.zshrc.local ; fi
|
if [ -e $HOME/.zshrc.local ] ; then source $HOME/.zshrc.local ; fi
|
||||||
|
|
||||||
|
# Set prompt based on local settings
|
||||||
|
prompt "${THEME:-matir}"
|
||||||
|
|||||||
5
dotfiles/zshrc.completions/_gf
Normal file
5
dotfiles/zshrc.completions/_gf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#compdef gf
|
||||||
|
|
||||||
|
function _gf {
|
||||||
|
_arguments "1: :($(gf -list))"
|
||||||
|
}
|
||||||
173
dotfiles/zshrc.d/agnoster_prompt/prompt_agnoster_setup
Normal file
173
dotfiles/zshrc.d/agnoster_prompt/prompt_agnoster_setup
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
# vim:ft=zsh ts=2 sw=2 sts=2
|
||||||
|
#
|
||||||
|
# agnoster's Theme - https://gist.github.com/3712874
|
||||||
|
# A Powerline-inspired theme for ZSH
|
||||||
|
#
|
||||||
|
# # README
|
||||||
|
#
|
||||||
|
# In order for this theme to render correctly, you will need a
|
||||||
|
# [Powerline-patched font](https://gist.github.com/1595572).
|
||||||
|
#
|
||||||
|
# In addition, I recommend the
|
||||||
|
# [Solarized theme](https://github.com/altercation/solarized/) and, if you're
|
||||||
|
# using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over Terminal.app -
|
||||||
|
# it has significantly better color fidelity.
|
||||||
|
#
|
||||||
|
# # Goals
|
||||||
|
#
|
||||||
|
# The aim of this theme is to only show you *relevant* information. Like most
|
||||||
|
# prompts, it will only show git information when in a git working directory.
|
||||||
|
# However, it goes a step further: everything from the current user and
|
||||||
|
# hostname to whether the last call exited with an error to whether background
|
||||||
|
# jobs are running in this shell will all be displayed automatically when
|
||||||
|
# appropriate.
|
||||||
|
|
||||||
|
### Segments of the prompt, default order declaration
|
||||||
|
|
||||||
|
typeset -aHg AGNOSTER_PROMPT_SEGMENTS=(
|
||||||
|
prompt_status
|
||||||
|
prompt_context
|
||||||
|
prompt_virtualenv
|
||||||
|
prompt_dir
|
||||||
|
prompt_git
|
||||||
|
prompt_end
|
||||||
|
)
|
||||||
|
|
||||||
|
### Segment drawing
|
||||||
|
# A few utility functions to make it easy and re-usable to draw segmented prompts
|
||||||
|
|
||||||
|
CURRENT_BG='NONE'
|
||||||
|
if [[ -z "$PRIMARY_FG" ]]; then
|
||||||
|
PRIMARY_FG=black
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Characters
|
||||||
|
SEGMENT_SEPARATOR="\ue0b0"
|
||||||
|
PLUSMINUS="\u00b1"
|
||||||
|
BRANCH="\ue0a0"
|
||||||
|
DETACHED="\u27a6"
|
||||||
|
CROSS="\u2718"
|
||||||
|
LIGHTNING="\u26a1"
|
||||||
|
GEAR="\u2699"
|
||||||
|
|
||||||
|
# Begin a segment
|
||||||
|
# Takes two arguments, background and foreground. Both can be omitted,
|
||||||
|
# rendering default background/foreground.
|
||||||
|
prompt_segment() {
|
||||||
|
local bg fg
|
||||||
|
[[ -n $1 ]] && bg="%K{$1}" || bg="%k"
|
||||||
|
[[ -n $2 ]] && fg="%F{$2}" || fg="%f"
|
||||||
|
if [[ $CURRENT_BG != 'NONE' && $1 != $CURRENT_BG ]]; then
|
||||||
|
print -n "%{$bg%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR%{$fg%}"
|
||||||
|
else
|
||||||
|
print -n "%{$bg%}%{$fg%}"
|
||||||
|
fi
|
||||||
|
CURRENT_BG=$1
|
||||||
|
[[ -n $3 ]] && print -n $3
|
||||||
|
}
|
||||||
|
|
||||||
|
# End the prompt, closing any open segments
|
||||||
|
prompt_end() {
|
||||||
|
if [[ -n $CURRENT_BG ]]; then
|
||||||
|
print -n "%{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR"
|
||||||
|
else
|
||||||
|
print -n "%{%k%}"
|
||||||
|
fi
|
||||||
|
print -n "%{%f%}"
|
||||||
|
CURRENT_BG=''
|
||||||
|
}
|
||||||
|
|
||||||
|
### Prompt components
|
||||||
|
# Each component will draw itself, and hide itself if no information needs to be shown
|
||||||
|
|
||||||
|
# Context: user@hostname (who am I and where am I)
|
||||||
|
prompt_context() {
|
||||||
|
local user=`whoami`
|
||||||
|
|
||||||
|
if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CONNECTION" ]]; then
|
||||||
|
prompt_segment $PRIMARY_FG default " %(!.%{%F{yellow}%}.)$user@%m "
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Git: branch/detached head, dirty status
|
||||||
|
prompt_git() {
|
||||||
|
local color ref
|
||||||
|
is_dirty() {
|
||||||
|
test -n "$(git status --porcelain --ignore-submodules)"
|
||||||
|
}
|
||||||
|
ref="$vcs_info_msg_0_"
|
||||||
|
if [[ -n "$ref" ]]; then
|
||||||
|
if is_dirty; then
|
||||||
|
color=yellow
|
||||||
|
ref="${ref} $PLUSMINUS"
|
||||||
|
else
|
||||||
|
color=green
|
||||||
|
ref="${ref} "
|
||||||
|
fi
|
||||||
|
if [[ "${ref/.../}" == "$ref" ]]; then
|
||||||
|
ref="$BRANCH $ref"
|
||||||
|
else
|
||||||
|
ref="$DETACHED ${ref/.../}"
|
||||||
|
fi
|
||||||
|
prompt_segment $color $PRIMARY_FG
|
||||||
|
print -n " $ref"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Dir: current working directory
|
||||||
|
prompt_dir() {
|
||||||
|
prompt_segment blue $PRIMARY_FG ' %~ '
|
||||||
|
}
|
||||||
|
|
||||||
|
# Status:
|
||||||
|
# - was there an error
|
||||||
|
# - am I root
|
||||||
|
# - are there background jobs?
|
||||||
|
prompt_status() {
|
||||||
|
local symbols
|
||||||
|
symbols=()
|
||||||
|
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}$CROSS"
|
||||||
|
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}$LIGHTNING"
|
||||||
|
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}$GEAR"
|
||||||
|
|
||||||
|
[[ -n "$symbols" ]] && prompt_segment $PRIMARY_FG default " $symbols "
|
||||||
|
}
|
||||||
|
|
||||||
|
# Display current virtual environment
|
||||||
|
prompt_virtualenv() {
|
||||||
|
if [[ -n $VIRTUAL_ENV ]]; then
|
||||||
|
color=cyan
|
||||||
|
prompt_segment $color $PRIMARY_FG
|
||||||
|
print -Pn " $(basename $VIRTUAL_ENV) "
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
## Main prompt
|
||||||
|
prompt_agnoster_main() {
|
||||||
|
RETVAL=$?
|
||||||
|
CURRENT_BG='NONE'
|
||||||
|
for prompt_segment in "${AGNOSTER_PROMPT_SEGMENTS[@]}"; do
|
||||||
|
[[ -n $prompt_segment ]] && $prompt_segment
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
prompt_agnoster_precmd() {
|
||||||
|
vcs_info
|
||||||
|
PROMPT='%{%f%b%k%}$(prompt_agnoster_main) '
|
||||||
|
}
|
||||||
|
|
||||||
|
prompt_agnoster_setup() {
|
||||||
|
autoload -Uz add-zsh-hook
|
||||||
|
autoload -Uz vcs_info
|
||||||
|
|
||||||
|
prompt_opts=(cr subst percent)
|
||||||
|
|
||||||
|
add-zsh-hook precmd prompt_agnoster_precmd
|
||||||
|
|
||||||
|
zstyle ':vcs_info:*' enable git
|
||||||
|
zstyle ':vcs_info:*' check-for-changes false
|
||||||
|
zstyle ':vcs_info:git*' formats '%b'
|
||||||
|
zstyle ':vcs_info:git*' actionformats '%b (%a)'
|
||||||
|
}
|
||||||
|
|
||||||
|
prompt_agnoster_setup "$@"
|
||||||
4
dotfiles/zshrc.d/cnf.zsh
Normal file
4
dotfiles/zshrc.d/cnf.zsh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# TODO: this is horribly unportable. Fix it.
|
||||||
|
if test -r /etc/zsh_command_not_found && test -r /var/lib/command-not-found/commands.db ; then
|
||||||
|
source /etc/zsh_command_not_found
|
||||||
|
fi
|
||||||
9
dotfiles/zshrc.d/dmesg.zsh
Normal file
9
dotfiles/zshrc.d/dmesg.zsh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
function dmesg {
|
||||||
|
if [ $(id -u) -eq 0 ] ; then
|
||||||
|
command dmesg "$@"
|
||||||
|
elif id | grep -q '(sudo)' ; then
|
||||||
|
sudo dmesg "$@"
|
||||||
|
else
|
||||||
|
command dmesg "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
@@ -2,16 +2,23 @@
|
|||||||
|
|
||||||
GCL=${HOME}/tools/gcloud
|
GCL=${HOME}/tools/gcloud
|
||||||
|
|
||||||
if [ ! -d ${GCL} ] ; then
|
if [ -d "${GCL}" ] ; then
|
||||||
return
|
# Add bin to path
|
||||||
|
export PATH="${PATH}:${GCL}/bin"
|
||||||
|
|
||||||
|
# Load completion
|
||||||
|
source "${GCL}/completion.zsh.inc"
|
||||||
|
elif [ -f /usr/share/google-cloud-sdk/completion.zsh.inc ] ; then
|
||||||
|
source /usr/share/google-cloud-sdk/completion.zsh.inc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add bin to path
|
|
||||||
export PATH="${PATH}:${GCL}/bin"
|
|
||||||
|
|
||||||
# Load completion
|
|
||||||
source ${GCL}/completion.zsh.inc
|
|
||||||
|
|
||||||
which kubectl 2>/dev/null >&2 && \
|
which kubectl 2>/dev/null >&2 && \
|
||||||
source <(kubectl completion zsh) || \
|
function kubectl() {
|
||||||
|
if ! type __start_kubectl >/dev/null 2>&1; then
|
||||||
|
source <(command kubectl completion zsh)
|
||||||
|
fi
|
||||||
|
|
||||||
|
command kubectl "$@"
|
||||||
|
} || \
|
||||||
true
|
true
|
||||||
|
|||||||
@@ -20,13 +20,19 @@ fi
|
|||||||
# Inform gpg-agent of the current TTY for user prompts.
|
# Inform gpg-agent of the current TTY for user prompts.
|
||||||
export GPG_TTY="$(tty)"
|
export GPG_TTY="$(tty)"
|
||||||
|
|
||||||
# Integrate with the SSH module.
|
# Setup SSH agent support
|
||||||
if grep '^enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then
|
if grep '^enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then
|
||||||
# Load required functions.
|
# Load required functions.
|
||||||
autoload -Uz add-zsh-hook
|
autoload -Uz add-zsh-hook
|
||||||
|
|
||||||
# Override the ssh-agent environment file default path.
|
if test -z "$SSH_AUTH_SOCK" ; then
|
||||||
_ssh_agent_env="$_gpg_agent_env"
|
SSH_AUTH_SOCK="/run/user/$(id -u)/gnupg/S.gpg-agent.ssh"
|
||||||
|
if test -S "$SSH_AUTH_SOCK" ; then
|
||||||
|
export SSH_AUTH_SOCK
|
||||||
|
else
|
||||||
|
unset SSH_AUTH_SOCK
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Updates the GPG-Agent TTY before every command since SSH does not set it.
|
# Updates the GPG-Agent TTY before every command since SSH does not set it.
|
||||||
function _gpg-agent-update-tty {
|
function _gpg-agent-update-tty {
|
||||||
|
|||||||
@@ -24,3 +24,11 @@ histmode() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
histsearch() {
|
||||||
|
fc -l -m "${1}" 1
|
||||||
|
}
|
||||||
|
|
||||||
|
histbrowse() {
|
||||||
|
fc -l 1
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
if which ipython >/dev/null 2>/dev/null ; then
|
if command -v ipython >/dev/null || command -v ipython3 >/dev/null ; then
|
||||||
export PYTHONSTARTUP="${HOME}/.ipython.py"
|
export PYTHONSTARTUP="${HOME}/.ipython.py"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -142,10 +142,10 @@ function jekyll {
|
|||||||
${EDITOR} "${FILENAME}"
|
${EDITOR} "${FILENAME}"
|
||||||
;;
|
;;
|
||||||
dev)
|
dev)
|
||||||
command jekyll serve -D -I "$@"
|
command bundle exec jekyll serve -D -I "$@"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
command jekyll "$@"
|
command bundle exec jekyll "$@"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|||||||
8
dotfiles/zshrc.d/lesshighlight.zsh
Normal file
8
dotfiles/zshrc.d/lesshighlight.zsh
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
test -f /usr/share/source-highlight/src-hilite-lesspipe.sh && \
|
||||||
|
function srcless {
|
||||||
|
if [ $# -ne 1 ] ; then
|
||||||
|
echo "$0 <what>" > /dev/stderr
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
/usr/share/source-highlight/src-hilite-lesspipe.sh $1 | less -R
|
||||||
|
}
|
||||||
39
dotfiles/zshrc.d/logging.zsh
Normal file
39
dotfiles/zshrc.d/logging.zsh
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
LOGGER_ENV=""
|
||||||
|
LOGGER_DIR="${LOGGER_DIR:-${HOME}/.zlogs}"
|
||||||
|
|
||||||
|
function _logger_now {
|
||||||
|
print -P "%D{%Y%m%d-%H%M%S}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function logenv {
|
||||||
|
LOGGER_ENV="${1:-}"
|
||||||
|
if test -z "${LOGGER_ENV}" ; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
mkdir -p "${LOGGER_DIR}/${LOGGER_ENV}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Executed on prompt
|
||||||
|
function _logger_precmd {
|
||||||
|
_RV="$?"
|
||||||
|
if test -z "${LOGGER_ENV}" ; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
_LOGGER_STOP="$(_logger_now)"
|
||||||
|
_LOGGER_DATE="$(print -P '%D{%Y%m%d}')"
|
||||||
|
echo "$_LOGGER_START $_LOGGER_STOP $$ $_RV $_LOGGER_CMD" >>| \
|
||||||
|
"${LOGGER_DIR}/${LOGGER_ENV}/${_LOGGER_DATE}.log"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Executed on command entry
|
||||||
|
function _logger_preexec {
|
||||||
|
_LOGGER_CMD="${2}"
|
||||||
|
_LOGGER_START="$(_logger_now)"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
typeset -a precmd_functions
|
||||||
|
precmd_functions+=_logger_precmd
|
||||||
|
typeset -a preexec_functions
|
||||||
|
preexec_functions+=_logger_preexec
|
||||||
@@ -34,6 +34,9 @@ function prompt_matir_setup {
|
|||||||
RPROMPT+='%? '
|
RPROMPT+='%? '
|
||||||
RPROMPT+='%{$reset_color%})'
|
RPROMPT+='%{$reset_color%})'
|
||||||
RPROMPT+='${PROMPT_VIMODE}'
|
RPROMPT+='${PROMPT_VIMODE}'
|
||||||
|
|
||||||
|
# Disable virtualenv's own python info
|
||||||
|
VIRTUAL_ENV_DISABLE_PROMPT="yes"
|
||||||
}
|
}
|
||||||
|
|
||||||
function zle-keymap-select {
|
function zle-keymap-select {
|
||||||
@@ -46,7 +49,7 @@ zle -N zle-keymap-select
|
|||||||
zle -N zle-line-init zle-keymap-select
|
zle -N zle-line-init zle-keymap-select
|
||||||
|
|
||||||
function prompt_matir_precmd {
|
function prompt_matir_precmd {
|
||||||
vcs_info
|
vcs_info 2>/dev/null
|
||||||
if [ $VIRTUAL_ENV ] ; then
|
if [ $VIRTUAL_ENV ] ; then
|
||||||
VIRTUAL_ENV_SHORT=" (py:$(basename $VIRTUAL_ENV))"
|
VIRTUAL_ENV_SHORT=" (py:$(basename $VIRTUAL_ENV))"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ prune-broken-symlinks() {
|
|||||||
ASK=1
|
ASK=1
|
||||||
fi
|
fi
|
||||||
DIR=${1:-.}
|
DIR=${1:-.}
|
||||||
FINDCMD=(find ${DIR} -type l -xtype l)
|
FINDCMD=(find -L ${DIR} -type l)
|
||||||
if (($ASK)) ; then
|
if (($ASK)) ; then
|
||||||
local FILES
|
local FILES
|
||||||
FILES=`${FINDCMD} -print`
|
FILES=`${FINDCMD} -print`
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ zstyle ':completion:*:(ssh|scp):*:hosts-domain' ignored-patterns '<->.<->.<->.<-
|
|||||||
zstyle ':completion:*:(ssh|scp):*:hosts-ipaddr' ignored-patterns '^<->.<->.<->.<->' '127.0.0.<->'
|
zstyle ':completion:*:(ssh|scp):*:hosts-ipaddr' ignored-patterns '^<->.<->.<->.<->' '127.0.0.<->'
|
||||||
zstyle ':completion:*:(ssh|scp):*:users' ignored-patterns adm bin daemon halt lp named shutdown sync
|
zstyle ':completion:*:(ssh|scp):*:users' ignored-patterns adm bin daemon halt lp named shutdown sync
|
||||||
zstyle -e ':completion:*:(ssh|scp):*' hosts 'reply=(
|
zstyle -e ':completion:*:(ssh|scp):*' hosts 'reply=(
|
||||||
${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \
|
${=${${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \
|
||||||
/dev/null)"}%%[# ]*}//,/ }
|
/dev/null)"}%%[# ]*}##\|*}//,/ }
|
||||||
${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
|
${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
|
||||||
${=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}}
|
${=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}}
|
||||||
)'
|
)'
|
||||||
|
|||||||
3
dotfiles/zshrc.d/usage.zsh
Normal file
3
dotfiles/zshrc.d/usage.zsh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
function duf {
|
||||||
|
du -sk "$@" | sort -n | while read size fname; do for unit in K M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e "${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done
|
||||||
|
}
|
||||||
7
dotfiles/zshrc.d/vmstat.zsh
Normal file
7
dotfiles/zshrc.d/vmstat.zsh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
function vmstat {
|
||||||
|
local _extra_args
|
||||||
|
if [ "$(tput cols)" -gt 80 ] ; then
|
||||||
|
_extra_args="-w"
|
||||||
|
fi
|
||||||
|
command vmstat ${_extra_args} "$@"
|
||||||
|
}
|
||||||
32
install.sh
32
install.sh
@@ -66,7 +66,7 @@ install_dotfile_dir() {
|
|||||||
mkdir -p $(dirname "${TARGET}")
|
mkdir -p $(dirname "${TARGET}")
|
||||||
ln -s -f "${dotfile}" "${TARGET}"
|
ln -s -f "${dotfile}" "${TARGET}"
|
||||||
done
|
done
|
||||||
git submodule status -- "${SRCDIR}" 2>/dev/null | \
|
git -C "${BASEDIR}" submodule status -- "${SRCDIR}" 2>/dev/null | \
|
||||||
awk '{print $2}' | \
|
awk '{print $2}' | \
|
||||||
while read submodule ; do
|
while read submodule ; do
|
||||||
local FULLNAME="${BASEDIR}/${submodule}"
|
local FULLNAME="${BASEDIR}/${submodule}"
|
||||||
@@ -181,7 +181,7 @@ install_gpg_keys() {
|
|||||||
return 0
|
return 0
|
||||||
local key
|
local key
|
||||||
for key in ${BASEDIR}/keys/gpg/* ; do
|
for key in ${BASEDIR}/keys/gpg/* ; do
|
||||||
gpg --import < ${key} >/dev/null
|
gpg --import < ${key} >/dev/null 2>&1
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,6 +275,25 @@ install_chrome() {
|
|||||||
rm -rf ${TMPD}
|
rm -rf ${TMPD}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setup_git_email() {
|
||||||
|
local gc_local="${HOME}/.gitconfig.local"
|
||||||
|
if test -f "${gc_local}" ; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
if [ "${USER:0:5}" != "david" ] ; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
local domain="$(hostname -f | egrep -o '[a-z0-9-]+\.[a-z0-9-]+$')"
|
||||||
|
case $(echo ${domain} | md5sum | awk '{print $1}') in
|
||||||
|
b21a24d528346ef7d3932306ed96ede5|a5ed434a3f5089b489576cceab824f25)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo -e "[user]\n email=${USER}@${domain}" > "${gc_local}"
|
||||||
|
}
|
||||||
|
|
||||||
read_saved_prefs() {
|
read_saved_prefs() {
|
||||||
# Can't use basedir here as we don't have it yet
|
# Can't use basedir here as we don't have it yet
|
||||||
local old_pref_file=$(dirname $0)/installed-prefs
|
local old_pref_file=$(dirname $0)/installed-prefs
|
||||||
@@ -337,9 +356,9 @@ install_dotfiles() {
|
|||||||
|
|
||||||
install_main() {
|
install_main() {
|
||||||
test -d ${BASEDIR}/.git && command -v git >/dev/null 2>&1 && \
|
test -d ${BASEDIR}/.git && command -v git >/dev/null 2>&1 && \
|
||||||
git -C ${BASEDIR} pull
|
git -C ${BASEDIR} pull --ff-only
|
||||||
test $MINIMAL = 1 || command -v git >/dev/null 2>&1 && \
|
test $MINIMAL = 1 || ( command -v git >/dev/null 2>&1 && \
|
||||||
git -C ${BASEDIR} submodule update --init --recursive
|
git -C ${BASEDIR} submodule update --init --recursive )
|
||||||
test $MINIMAL = 1 || prerequisites
|
test $MINIMAL = 1 || prerequisites
|
||||||
test $INSTALL_PKGS = 1 && is_deb_system && install_apt_pkgs
|
test $INSTALL_PKGS = 1 && is_deb_system && install_apt_pkgs
|
||||||
install_dotfiles
|
install_dotfiles
|
||||||
@@ -347,6 +366,7 @@ install_main() {
|
|||||||
test $MINIMAL = 1 || postinstall
|
test $MINIMAL = 1 || postinstall
|
||||||
test $INSTALL_KEYS = 1 && install_keys
|
test $INSTALL_KEYS = 1 && install_keys
|
||||||
save_prefs
|
save_prefs
|
||||||
|
setup_git_email
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,3 +433,5 @@ case $OPERATION in
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
echo "OK"
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClvMvarQvGaFYhUazA+GN0C2XaU4vHmsvD3G99PJqmd9SGrzSvWw2ZuJwYWQCag4Ft5Zy/A3NZ0/a4ohPbWFF4iX9LnAqSKgMDPv3R3VokW04bFm5uDhXF0lJDOWb8aJuFl56SP2lnbWyP8P8d+3MaFCcuw3F23CS/0ZO5w7CsPsHkvWkmykCB6z/Ju/kqvXK5qYKjAVkZ80LMDNppjN5zZhFZs721zuuMmpFevcfG5c43KujcR/yDfB+t3yfWmaWi21KDapdHXk5lQoxsg6OZe6Wuj7jQq+Zol+ElxD+gn7z2LWXq8a3wyyvGSoKyBfHBjrwzEuUEFbvn5iatPJVX davidtomaschik@davidtomaschik-glaptop2
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXvqt73qAqS8C597u1wjz0Cvfo1IpiQFE4OKxTBR0mUhhi9UsGXkjZd/EYnqfWQRLcKaQSqN9QcXW7zHrfXtdmcjr3dDZrwXGgCiJnvLTeLecLqYwgaIMMNTmgaTQ3OFB74VCeD496pMbnhmlsN2+WaxNjIxoX+Qadsq/iHtBBt+tSOm5E1x0/ynEGmvO1W0L+8FyV/xnZWQIbBHTrJ931Gt8RDKtt7Y24XYMm5REye40adbxeS4kBwexvp2nTKwkr8sC26dmOz/RgJG3Km1194r0RXsH7iCYYlUBT23f4KOcmVxUlxkSu5d0u2viEID++cN6LT/4rHPdgqMZaVhaB root@uber
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ5FLvZsfIfNV8NcUK6+wJ8pDapgu8QAZMX5zuz+fYxsf3KeHlDS0nPojmDLCXaAdd4TUO7KlRyo8BhpsWP8yUwpxUeRgvtYjjWfDgSxXCsGpQzbmTABu8eIaSya00Fao/WeIV1k+2p6S80knmllrBVideGW9ws4zrVQnhOcgKVXskuFBEs3IOQczNPMfI+OnO+qca0rjUh1Z6k3tD6tN6pxh//5CZBgqYf4G1DLnCLIep7tDkTuYjgqH237r6v4WHH87sLRy21yFRzfMWUGPesJvuc8X4Ol822BuQWTCDYy+QYZ9qGDWPcLOLCg7MLP9IVKzIJOrAdOYyp6p2brzj davidtomaschik@uber.g
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3CLK0KLup0y8nb1l5X9LTVsvJG1scc7qbLJZIdGC0TlFeAbzUwXmxxJUY/dl/2JKGj9Ai3h393WzxH//tMY4jYLhMLqV487YvteVF+2yVS+q0YtO4RgM6TVOvdp1b4Fgj4EB5hTaO0hB51PxTqnVAK0ZMAuUxQRygpARnB+xwhLU2l0K07RHgpMirWODzzlgD3Y9I+3WIpmAwzubaoS1/R0Frf81ZWQmgvwac6PKsPwvGLygS1ounOwD2PJScP+sE/t2MEYjtqmmAytqsp5kLVkb82fJSkdj1DuHblgZr4aX9r04bVV1ju19CN57VyhbZtf+fBqQQW1lnjMYm9Kjn matir_pvj
|
|
||||||
@@ -1,10 +1,14 @@
|
|||||||
audacity
|
audacity
|
||||||
cinnamon
|
cinnamon
|
||||||
codequery
|
codequery
|
||||||
|
flameshot
|
||||||
fonts-inconsolata
|
fonts-inconsolata
|
||||||
|
fonts-powerline
|
||||||
gimp
|
gimp
|
||||||
keepassx
|
keepassx
|
||||||
|
meld
|
||||||
network-manager-openvpn-gnome
|
network-manager-openvpn-gnome
|
||||||
|
solaar
|
||||||
vim-gtk
|
vim-gtk
|
||||||
wireshark
|
wireshark
|
||||||
wkhtmltopdf
|
wkhtmltopdf
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ cryptsetup
|
|||||||
dsniff
|
dsniff
|
||||||
ecryptfs-utils
|
ecryptfs-utils
|
||||||
exuberant-ctags
|
exuberant-ctags
|
||||||
|
httpie
|
||||||
iftop
|
iftop
|
||||||
iptraf
|
iptraf
|
||||||
ipython
|
ipython
|
||||||
@@ -34,9 +35,12 @@ python3-scapy
|
|||||||
python3-pip
|
python3-pip
|
||||||
python3-virtualenv
|
python3-virtualenv
|
||||||
radare2
|
radare2
|
||||||
|
ripgrep
|
||||||
scapy
|
scapy
|
||||||
scdaemon
|
scdaemon
|
||||||
socat
|
socat
|
||||||
|
source-highlight
|
||||||
sqlite3
|
sqlite3
|
||||||
ufw
|
ugrep
|
||||||
|
vim-youcompleteme
|
||||||
zsh-syntax-highlighting
|
zsh-syntax-highlighting
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ fonts-anonymous-pro
|
|||||||
fonts-dejavu
|
fonts-dejavu
|
||||||
fonts-dseg
|
fonts-dseg
|
||||||
fonts-elusive-icons
|
fonts-elusive-icons
|
||||||
|
fonts-firacode
|
||||||
fonts-font-awesome
|
fonts-font-awesome
|
||||||
fonts-freefont-otf
|
fonts-freefont-otf
|
||||||
fonts-hack
|
fonts-hack
|
||||||
@@ -14,6 +15,7 @@ fonts-ocr-a
|
|||||||
fonts-ocr-b
|
fonts-ocr-b
|
||||||
fonts-open-sans
|
fonts-open-sans
|
||||||
fonts-oxygen
|
fonts-oxygen
|
||||||
|
fonts-powerline
|
||||||
fonts-roboto
|
fonts-roboto
|
||||||
fonts-stix
|
fonts-stix
|
||||||
fonts-ubuntu
|
fonts-ubuntu
|
||||||
|
|||||||
BIN
private_dotfiles/config/gcloud/configurations/config_bsidessf
Normal file
BIN
private_dotfiles/config/gcloud/configurations/config_bsidessf
Normal file
Binary file not shown.
BIN
private_dotfiles/config/gcloud/configurations/config_default
Executable file
BIN
private_dotfiles/config/gcloud/configurations/config_default
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
sysctl/userns.conf
Normal file
1
sysctl/userns.conf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
kernel.unprivileged_userns_clone=1
|
||||||
1
udev/99-usb-trim.rules
Normal file
1
udev/99-usb-trim.rules
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ACTION=="add|change", ATTRS{idVendor}=="2109", ATTRS{idProduct}=="0715", SUBSYSTEM=="scsi_disk", ATTR{provisioning_mode}="unmap"
|
||||||
Reference in New Issue
Block a user