This commit is contained in:
David Tomaschik
2018-09-10 16:04:17 -07:00
10 changed files with 78 additions and 14 deletions

View File

@@ -5,6 +5,7 @@ set -o nounset
if test -f /etc/apt/apt.conf.d/90-proxy ; then
echo "Looks already setup."
exit 0
fi
cat >/etc/apt/proxy-detect <<'EOF'
@@ -25,7 +26,7 @@ fi
echo DIRECT
EOF
chmod +x /etc/apt/proxy-detect
chmod 755 /etc/apt/proxy-detect
cat >/etc/apt/apt.conf.d/90-proxy <<'EOF'
Acquire::http::Proxy-Auto-Detect "/etc/apt/proxy-detect";

View File

@@ -65,6 +65,15 @@ function check_sudo {
sudo -l >/dev/null
}
function add_bin_symlink {
local TARGET NAME BINDIR
TARGET=${1}
NAME=${2:-$(basename ${1})}
BINDIR=${HOME}/bin/tools/
mkdir -p -- ${BINDIR}
ln -sf ${DESTDIR}/${TARGET} ${BINDIR}/${NAME}
}
DESTDIR="${HOME}/tools/${TOOL}"
if [ -d ${DESTDIR} ] ; then
@@ -113,10 +122,11 @@ case ${TOOL} in
gtemp=`mktemp -d`
gbase="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/"
# TODO: find a way to make this version independent
gsdk="google-cloud-sdk-142.0.0-linux-x86_64.tar.gz"
gsdk="google-cloud-sdk-209.0.0-linux-x86_64.tar.gz"
download "${gbase}${gsdk}" /tmp/gcloud.tar.gz
tar zxf /tmp/gcloud.tar.gz --strip-components=1 -C ${DESTDIR}
rm /tmp/gcloud.tar.gz
add_bin_symlink bin/gcloud
;;
android-sdk)
# TODO: find a way to make this version independent
@@ -144,11 +154,13 @@ case ${TOOL} in
fi
;;
mitmproxy)
src=$(python -c 'import urllib2; import json; print(filter(lambda x: x["name"].endswith("-linux.tar.gz"), json.load(urllib2.urlopen("https://api.github.com/repos/mitmproxy/mitmproxy/releases/latest"))["assets"])[0]["browser_download_url"])')
download ${src} /tmp/mitmproxy.tar.gz
ver=$(python -c 'import urllib2; import json; print(json.load(urllib2.urlopen("https://api.github.com/repos/mitmproxy/mitmproxy/releases/latest"))["name"].replace("v",""))')
download https://snapshots.mitmproxy.org/${ver}/mitmproxy-${ver}-linux.tar.gz /tmp/mitmproxy.tar.gz
mkdir -p ${DESTDIR}
tar zx -C ${DESTDIR} -f /tmp/mitmproxy.tar.gz
rm /tmp/mitmproxy.tar.gz
add_bin_symlink mitmproxy
add_bin_symlink mitmweb
;;
esp)
src="https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-61-gab8375a-5.2.0.tar.gz"
@@ -187,6 +199,17 @@ case ${TOOL} in
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"])')
download ${src} ${DESTDIR}/cyberchef.html
;;
apktool)
mkdir -p ${DESTDIR}
download \
https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool \
${DESTDIR}/apktool
download \
https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.3.3.jar \
${DESTDIR}/apktool.jar
chmod +x ${DESTDIR}/apktool
add_bin_symlink apktool
;;
*)
echo "Unknown tool: ${TOOL}" >/dev/stderr
exit 1

View File

@@ -0,0 +1,24 @@
[media-keys]
screensaver=['<Primary><Alt>l', 'XF86ScreenSaver']
[wm]
move-to-workspace-1=['<Shift><Super>exclam']
move-to-workspace-2=['<Shift><Super>at']
move-to-workspace-3=['<Shift><Super>numbersign']
move-to-workspace-4=['<Shift><Super>dollar']
move-to-workspace-5=['<Shift><Super>percent']
move-to-workspace-6=['<Shift><Super>asciicircum']
move-to-workspace-7=['<Shift><Super>ampersand']
move-to-workspace-8=['<Shift><Super>asterisk']
move-to-workspace-9=['<Shift><Super>parenleft']
switch-to-workspace-4=['<Super>4']
switch-to-workspace-1=['<Super>1']
switch-to-workspace-10=['<Super>0']
switch-to-workspace-3=['<Super>3']
switch-to-workspace-8=['<Super>8']
switch-to-workspace-5=['<Super>5']
move-to-workspace-10=['<Shift><Super>parenright']
switch-to-workspace-2=['<Super>2']
switch-to-workspace-9=['<Super>9']
switch-to-workspace-6=['<Super>6']
switch-to-workspace-7=['<Super>7']

View File

@@ -17,3 +17,6 @@ Thumbs.db
# Try to avoid accidentally checking in private keys
id_rsa
id_ecdsa
# Kicad backup files
*.kicad_pcb-bak

View File

@@ -7,3 +7,4 @@ personal-digest-preferences SHA256
cert-digest-algo SHA256
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
cipher-algo AES256
default-key 7FD58D9A196DCEEEAD671F94F4D7A7915DEA789B

View File

@@ -51,7 +51,6 @@ imap <S-Tab> <Esc><<A
" Line numbering, ruler
set number
set ruler
set cursorline
" File options
set encoding=utf-8

View File

@@ -177,8 +177,7 @@ zstyle ':prezto:module:syntax-highlighting' highlighters \
'main' \
'brackets' \
'pattern' \
'line' \
'root'
'line'
# Set syntax highlighting styles.
# zstyle ':prezto:module:syntax-highlighting' styles \

View File

@@ -71,6 +71,9 @@ if [ -x /usr/bin/ack-grep ] ; then
alias ack='/usr/bin/ack-grep'
fi
# Setup PATH for tools
PATH=${PATH}:${HOME}/bin/tools
# Most is nice, if we have it
if command -v most >/dev/null 2>&1; then
export PAGER="most"

View File

@@ -232,7 +232,10 @@ run_as_root() {
install_pkg_set() {
local pkg_file=${BASEDIR}/${1}
local pkg_list=""
if [ ! -f "${pkg_file}" ] ; then return 0 ; fi
if [ ! -f "${pkg_file}" ] ; then
echo "Package set $(basename ${pkg_file}) does not exist." 1>&2
return 1
fi
while read line ; do
if is_comment "${line}" ; then
continue
@@ -348,6 +351,13 @@ install_main() {
cleanup
}
install_dconf() {
which dconf >/dev/null 2>&1 || return 1
find "${BASEDIR}/dconf" -type f -printf '/%P\n' | while read dcpath ; do
dconf load ${dcpath}/ < "${BASEDIR}/dconf/${dcpath}"
done
}
# Setup variables
read_saved_prefs
@@ -388,11 +398,8 @@ case $OPERATION in
install_dotfiles
;;
package*)
if [ ${2:-default} != default ] ; then
install_pkg_set packages.${2}
else
install_pkg_set packages
fi
PKG_SET=${2:-minimal}
install_pkg_set packages.${PKG_SET}
;;
pwndbg)
install_pwndbg
@@ -401,6 +408,10 @@ case $OPERATION in
# Do nothing, just sourcing
set +o errexit
;;
dconf)
# Load dconf
install_dconf
;;
*)
echo "Unknown operation $OPERATION." >/dev/stderr
exit 1

View File

@@ -16,6 +16,7 @@ nasm
opensc
openvpn
p7zip-full
psmisc
python3
python3-pip
python3-virtualenv
@@ -23,7 +24,6 @@ python-crypto
python-dev
python-hachoir-urwid
python-html5lib
python-imaging
python-nwdiag
python-pip
python-scapy