From 590a1a2fa0cd66294396447109b824eba3aef165 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Mon, 23 Apr 2018 22:12:05 -0700 Subject: [PATCH] Script to setup APT proxy. --- bin/_install_apt_proxy.sh | 34 ++++++++++++++++++++++++++++++++++ dotfiles/Xresources | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100755 bin/_install_apt_proxy.sh diff --git a/bin/_install_apt_proxy.sh b/bin/_install_apt_proxy.sh new file mode 100755 index 0000000..afa3f13 --- /dev/null +++ b/bin/_install_apt_proxy.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +set -o errexit +set -o nounset + +if test -f /etc/apt/apt.conf.d/90-proxy ; then + echo "Looks already setup." +fi + +cat >/etc/apt/proxy-detect <<'EOF' +#!/bin/bash + +PROXY=192.168.60.10:3142 + +if ! test -x /bin/nc ; then + echo DIRECT + exit 0 +fi + +if nc -w 2 -z ${PROXY/:/ } ; then + echo ${PROXY} + exit 0 +fi + +echo DIRECT +EOF + +chmod +x /etc/apt/proxy-detect + +cat >/etc/apt/apt.conf.d/90-proxy <<'EOF' +Acquire::http::Proxy-Auto-Detect "/etc/apt/proxy-detect"; +EOF + +echo "Setup APT Proxying." diff --git a/dotfiles/Xresources b/dotfiles/Xresources index 04c1e8b..a324518 100644 --- a/dotfiles/Xresources +++ b/dotfiles/Xresources @@ -3,7 +3,7 @@ Xcursor.size: 16 !!! ! Xft for fonts !!! -Xft.dpi: 96 +!Xft.dpi: 144 Xft.antialias: false Xft.lcdfilter: lcddefault Xft.rgba: rgb