From 52441d488db4b9fd08a1a2141abc34892e162d32 Mon Sep 17 00:00:00 2001 From: Frieder Schlesier Date: Mon, 12 Sep 2016 11:00:50 +0200 Subject: [PATCH] updates --- .dockerfunc | 19 ++++------- .i3/status.conf | 12 +++++-- install.sh | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 16 deletions(-) diff --git a/.dockerfunc b/.dockerfunc index 33ddcfa..2cf555e 100755 --- a/.dockerfunc +++ b/.dockerfunc @@ -345,22 +345,15 @@ transmission() { fschl/transmission } -vlc() { - del_stopped vlc - - local args=$@ +wireshark() { + del_stopped wireshark docker run -it \ - -v "$args":/home/vlc \ -v /etc/localtime:/etc/localtime:ro \ -v /tmp/.X11-unix:/tmp/.X11-unix \ - -v /run/user/1000/pulse:/run/user/vlc/pulse \ - -v /var/lib/dbus:/var/lib/dbus \ - -v ~/.pulse:/root/.pulse \ + -v $(pwd):/home/wireshark \ -e DISPLAY=unix$DISPLAY \ - -e GDK_SCALE \ - -e GDK_DPI_SCALE \ - --device /dev/snd \ - --name vlc \ - fschl/vlc + --name wireshark \ + jess/wireshark + } diff --git a/.i3/status.conf b/.i3/status.conf index 509e0a1..8038132 100755 --- a/.i3/status.conf +++ b/.i3/status.conf @@ -14,8 +14,8 @@ general { order += "disk /" order += "disk /var" order += "disk /home" -order += "run_watch Docker" -order += "run_watch DHCP" +#order += "run_watch Docker" +#order += "run_watch DHCP" order += "path_exists VPN" #order += "ipv6" #order += "wireless wlan0" @@ -26,6 +26,7 @@ order += "battery 0" #order += "cpu_temperature 0" order += "load" order += "tztime local" +#order += "tztime KG" wireless wlan0 { format_up = "W: (%quality at %essid) %ip" @@ -65,7 +66,12 @@ path_exists VPN { } tztime local { - format = "%Y-%m-%d %a %H:%M:%S" + format = "DE %Y-%m-%d %a %H:%M:%S" +} + +tztime KG { + format = "KG %a %H:%M" + timezone = "Asia/Bishkek" } load { diff --git a/install.sh b/install.sh index d453aba..d1d47b5 100755 --- a/install.sh +++ b/install.sh @@ -78,6 +78,8 @@ no_suspend() { # https://wiki.debian.org/SystemdSuspendSedation sudo sed -i "s/HandleLidSwitch=.*/HandleLidSwitch=ignore/" /etc/systemd/logind.conf sudo sed -i "s/HandleLidSwitchDocked=.*/HandleLidSwitchDocked=ignore/" /etc/systemd/logind.conf + sudo sed -i "s/IdleActionSec=.*/IdleActionSec=90min/" /etc/systemd/logind.conf + sudo systemctl restart systemd-logind.service } @@ -141,6 +143,91 @@ get_dotfiles() { ) } +# install/update golang from source +install_golang() { + export GO_VERSION=1.6.2 + export GO_SRC=/usr/local/go + + # if we are passing the version + if [[ ! -z "$1" ]]; then + export GO_VERSION=$1 + fi + + # subshell because we `cd` + ( + curl -sSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | sudo tar -v -C /usr/local -xz + ) + + # get commandline tools + ( + set -x + set +e + go get github.com/golang/lint/golint + go get golang.org/x/tools/cmd/cover + go get golang.org/x/review/git-codereview + go get golang.org/x/tools/cmd/goimports + go get golang.org/x/tools/cmd/gorename + + go get github.com/FiloSottile/vendorcheck + go get github.com/nsf/gocode + #done + ) +} + +get_public_go_projects() { + + ( + aliases=( Masterminds/glide onsi/ginkgo onsi/gomega Compufreak345/alice Compufreak345/manners Compufreak345/go-i18n Compufreak345/excess-router Compufreak345/leaflet-map Compufreak345/jsencrypt gogits/gogs fschl/sql-migrate fschl/CompileDaemon ) + + for project in "${aliases[@]}"; do + owner=$(dirname "$project") + repo=$(basename "$project") + if [[ -d "${HOME}/${repo}" ]]; then + rm -rf "${HOME}/${repo}" + fi + + mkdir -p "${GOPATH}/src/github.com/${owner}" + + if [[ ! -d "${GOPATH}/src/github.com/${project}" ]]; then + ( + # clone the repo + cd "${GOPATH}/src/github.com/${owner}" + git clone "https://github.com/${project}.git" + # fix the remote path, since our gitconfig will make it git@ + cd "${GOPATH}/src/github.com/${project}" + git remote set-url origin "https://github.com/${project}.git" + ) + else + echo "found ${project} already in gopath" + fi + + # make sure we create the right git remotes + # if [[ "$owner" != "fschl" ]]; then + # ( + # cd "${GOPATH}/src/github.com/${project}" + # git remote set-url --push origin no_push + # git remote add jfrazelle "https://github.com/fschl/${repo}.git" + # ) + # fi + + # create the alias + # ln -snvf "${GOPATH}/src/github.com/${project}" "${HOME}/${repo}" + done + + # create symlinks from personal projects to + # the ${HOME} directory + projectsdir=$GOPATH/src/github.com/fschl + base=$(basename "$projectsdir") + find "$projectsdir" -maxdepth 1 -not -name "$base" -type d -print0 | while read -d '' -r dir; do + base=$(basename "$dir") + ln -snvf "$dir" "${HOME}/${base}" + + done + ) +} + +source get_private_stuff.sh + main() { local cmd=$1