From da545f0de70f7166a44f8ea6d1117d6fedf5cb95 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sun, 8 Jul 2018 13:56:37 -0700 Subject: [PATCH 01/10] Support restoring dconf. --- dconf/org/cinnamon/desktop/keybindings | 24 ++++++++++++++++++++++++ install.sh | 11 +++++++++++ 2 files changed, 35 insertions(+) create mode 100644 dconf/org/cinnamon/desktop/keybindings diff --git a/dconf/org/cinnamon/desktop/keybindings b/dconf/org/cinnamon/desktop/keybindings new file mode 100644 index 0000000..e8ae607 --- /dev/null +++ b/dconf/org/cinnamon/desktop/keybindings @@ -0,0 +1,24 @@ +[media-keys] +screensaver=['l', 'XF86ScreenSaver'] + +[wm] +move-to-workspace-1=['exclam'] +move-to-workspace-2=['at'] +move-to-workspace-3=['numbersign'] +move-to-workspace-4=['dollar'] +move-to-workspace-5=['percent'] +move-to-workspace-6=['asciicircum'] +move-to-workspace-7=['ampersand'] +move-to-workspace-8=['asterisk'] +move-to-workspace-9=['parenleft'] +switch-to-workspace-4=['4'] +switch-to-workspace-1=['1'] +switch-to-workspace-10=['0'] +switch-to-workspace-3=['3'] +switch-to-workspace-8=['8'] +switch-to-workspace-5=['5'] +move-to-workspace-10=['parenright'] +switch-to-workspace-2=['2'] +switch-to-workspace-9=['9'] +switch-to-workspace-6=['6'] +switch-to-workspace-7=['7'] diff --git a/install.sh b/install.sh index d1ef817..1ab5eb2 100755 --- a/install.sh +++ b/install.sh @@ -348,6 +348,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 @@ -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 From 6d23e72bd70110a6766dd2ee233614086bb17473 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sun, 29 Jul 2018 19:49:10 -0700 Subject: [PATCH 02/10] Set default key for GnuPG. --- dotfiles/gnupg/gpg.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/dotfiles/gnupg/gpg.conf b/dotfiles/gnupg/gpg.conf index 00d5fb9..653d61c 100644 --- a/dotfiles/gnupg/gpg.conf +++ b/dotfiles/gnupg/gpg.conf @@ -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 From 52ed3913c8a3b8cea8b4756fa7da172f51915f1a Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Mon, 30 Jul 2018 20:20:56 -0700 Subject: [PATCH 03/10] Symlinks in tools. --- bin/install_tool | 18 +++++++++++++++--- dotfiles/zshrc | 3 +++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/bin/install_tool b/bin/install_tool index a7ea69a..d5969aa 100755 --- a/bin/install_tool +++ b/bin/install_tool @@ -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" diff --git a/dotfiles/zshrc b/dotfiles/zshrc index 20432f7..37b71bc 100755 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -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" From 7b0713675c29f402d9e61af693e340bc2773c34b Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Wed, 1 Aug 2018 20:32:53 -0700 Subject: [PATCH 04/10] Add psmisc to packages.cli. --- packages.cli | 1 + 1 file changed, 1 insertion(+) diff --git a/packages.cli b/packages.cli index ab75a1e..e988d9d 100644 --- a/packages.cli +++ b/packages.cli @@ -16,6 +16,7 @@ nasm opensc openvpn p7zip-full +psmisc python3 python3-pip python3-virtualenv From 653fa39cf7e1a3597466d0f4b1a8f68694ce84f8 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Thu, 2 Aug 2018 16:51:17 -0700 Subject: [PATCH 05/10] Remove cursorline from vimrc. It makes things very slow when enabled on complex files. See this github issue for context: https://github.com/vim/vim/issues/2584 --- dotfiles/vimrc | 1 - 1 file changed, 1 deletion(-) diff --git a/dotfiles/vimrc b/dotfiles/vimrc index 2063ea7..f20669b 100644 --- a/dotfiles/vimrc +++ b/dotfiles/vimrc @@ -51,7 +51,6 @@ imap < Date: Fri, 3 Aug 2018 22:37:06 -0700 Subject: [PATCH 06/10] Improve package installation. --- install.sh | 12 ++++++------ packages.cli | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 1ab5eb2..bd413ba 100755 --- a/install.sh +++ b/install.sh @@ -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 @@ -395,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 diff --git a/packages.cli b/packages.cli index e988d9d..7ee3de0 100644 --- a/packages.cli +++ b/packages.cli @@ -24,7 +24,6 @@ python-crypto python-dev python-hachoir-urwid python-html5lib -python-imaging python-nwdiag python-pip python-scapy From 19068da3f889e3898c9e1a711a6fe1fef9520bd6 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sat, 18 Aug 2018 16:15:00 -0700 Subject: [PATCH 07/10] Fix _install_apt_proxy.sh --- bin/_install_apt_proxy.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/_install_apt_proxy.sh b/bin/_install_apt_proxy.sh index afa3f13..9dad6b4 100755 --- a/bin/_install_apt_proxy.sh +++ b/bin/_install_apt_proxy.sh @@ -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"; From 2f6c9c8c0a2ca35a8b744d46670f7ff6aeec08e7 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sat, 1 Sep 2018 12:49:18 -0700 Subject: [PATCH 08/10] No special highlighting for root. --- dotfiles/zpreztorc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dotfiles/zpreztorc b/dotfiles/zpreztorc index 264885c..03a80c1 100644 --- a/dotfiles/zpreztorc +++ b/dotfiles/zpreztorc @@ -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 \ From 33e91886128c69d631fd02318a388703e0e6ed0c Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sat, 1 Sep 2018 12:49:36 -0700 Subject: [PATCH 09/10] Add apktool to install_tool. --- bin/install_tool | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/install_tool b/bin/install_tool index d5969aa..18d783c 100755 --- a/bin/install_tool +++ b/bin/install_tool @@ -199,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 From 47b4248de23e1e6f1c8f3a0a80412e328d1f7ed7 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sat, 1 Sep 2018 12:49:52 -0700 Subject: [PATCH 10/10] Git ignore kicad-bak files. --- dotfiles/gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dotfiles/gitignore b/dotfiles/gitignore index f1d43b8..effe636 100644 --- a/dotfiles/gitignore +++ b/dotfiles/gitignore @@ -17,3 +17,6 @@ Thumbs.db # Try to avoid accidentally checking in private keys id_rsa id_ecdsa + +# Kicad backup files +*.kicad_pcb-bak