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

View File

@@ -65,6 +65,15 @@ function check_sudo {
sudo -l >/dev/null 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}" DESTDIR="${HOME}/tools/${TOOL}"
if [ -d ${DESTDIR} ] ; then if [ -d ${DESTDIR} ] ; then
@@ -113,10 +122,11 @@ case ${TOOL} in
gtemp=`mktemp -d` gtemp=`mktemp -d`
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-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 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
add_bin_symlink bin/gcloud
;; ;;
android-sdk) android-sdk)
# TODO: find a way to make this version independent # TODO: find a way to make this version independent
@@ -144,11 +154,13 @@ case ${TOOL} in
fi fi
;; ;;
mitmproxy) 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"])') 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 ${src} /tmp/mitmproxy.tar.gz download https://snapshots.mitmproxy.org/${ver}/mitmproxy-${ver}-linux.tar.gz /tmp/mitmproxy.tar.gz
mkdir -p ${DESTDIR} mkdir -p ${DESTDIR}
tar zx -C ${DESTDIR} -f /tmp/mitmproxy.tar.gz tar zx -C ${DESTDIR} -f /tmp/mitmproxy.tar.gz
rm /tmp/mitmproxy.tar.gz rm /tmp/mitmproxy.tar.gz
add_bin_symlink mitmproxy
add_bin_symlink mitmweb
;; ;;
esp) esp)
src="https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-61-gab8375a-5.2.0.tar.gz" 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"])') 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 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 echo "Unknown tool: ${TOOL}" >/dev/stderr
exit 1 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 # Try to avoid accidentally checking in private keys
id_rsa id_rsa
id_ecdsa id_ecdsa
# Kicad backup files
*.kicad_pcb-bak

View File

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

View File

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

View File

@@ -177,8 +177,7 @@ zstyle ':prezto:module:syntax-highlighting' highlighters \
'main' \ 'main' \
'brackets' \ 'brackets' \
'pattern' \ 'pattern' \
'line' \ 'line'
'root'
# Set syntax highlighting styles. # Set syntax highlighting styles.
# zstyle ':prezto:module: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' alias ack='/usr/bin/ack-grep'
fi fi
# Setup PATH for tools
PATH=${PATH}:${HOME}/bin/tools
# 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
export PAGER="most" export PAGER="most"

View File

@@ -232,7 +232,10 @@ run_as_root() {
install_pkg_set() { install_pkg_set() {
local pkg_file=${BASEDIR}/${1} local pkg_file=${BASEDIR}/${1}
local pkg_list="" 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 while read line ; do
if is_comment "${line}" ; then if is_comment "${line}" ; then
continue continue
@@ -348,6 +351,13 @@ install_main() {
cleanup 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 # Setup variables
read_saved_prefs read_saved_prefs
@@ -388,11 +398,8 @@ case $OPERATION in
install_dotfiles install_dotfiles
;; ;;
package*) package*)
if [ ${2:-default} != default ] ; then PKG_SET=${2:-minimal}
install_pkg_set packages.${2} install_pkg_set packages.${PKG_SET}
else
install_pkg_set packages
fi
;; ;;
pwndbg) pwndbg)
install_pwndbg install_pwndbg
@@ -401,6 +408,10 @@ case $OPERATION in
# Do nothing, just sourcing # Do nothing, just sourcing
set +o errexit set +o errexit
;; ;;
dconf)
# Load dconf
install_dconf
;;
*) *)
echo "Unknown operation $OPERATION." >/dev/stderr echo "Unknown operation $OPERATION." >/dev/stderr
exit 1 exit 1

View File

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