Major update (yes, longtimenocommit message)

This commit is contained in:
Nico Schottelius 2017-03-08 07:37:05 +01:00
commit 256dc98754
24 changed files with 127 additions and 77 deletions

2
.gitignore vendored
View file

@ -2,3 +2,5 @@ schwanz3*sh
.mac-adresses-csv-to-dhcpd.sh.swp .mac-adresses-csv-to-dhcpd.sh.swp
.*.swp .*.swp
sut sut
ctt
consul

View file

@ -1,3 +1,4 @@
#!/bin/sh #!/bin/sh
touch "$0" touch "$0"
date > ~/.last-backup

View file

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
notmuch search --output=files --format=text0 tag:spam or tag:deleted | xargs -0 --no-run-if-empty rm notmuch search --output=files --format=text0 tag:spam or tag:deleted | xargs -0 --no-run-if-empty rm
notmuch new --quiet notmuch new --quiet 2>/dev/null

View file

@ -34,8 +34,8 @@ our $LOCALHOST_ONLY = 1;
# Configure the program that you want to run to handle the requests. # Configure the program that you want to run to handle the requests.
# This editor invocation must NOT return control to this script until # This editor invocation must NOT return control to this script until
# you are done editing. # you are done editing.
our $EDITOR_CMD = '/home/users/nico/bin/vim-term "%s"'; #our $EDITOR_CMD = '/home/users/nico/bin/vim-term "%s"';
#our $EDITOR_CMD = '/usr/bin/emacsclient -c "%s"'; our $EDITOR_CMD = '/usr/bin/emacsclient -c "%s"';
# The settings to configure the temp dir and how soon old files are removed. # The settings to configure the temp dir and how soon old files are removed.
# If TMPTEMPLATE contains the string -URL64-, then up to 64 chars of the munged # If TMPTEMPLATE contains the string -URL64-, then up to 64 chars of the munged

View file

@ -4,10 +4,12 @@
set -e set -e
text=${1:-cdist}
#cd /usr/figle*/share/figlet/ #cd /usr/figle*/share/figlet/
cd /usr/share/figlet cd /usr/share/figlet
cd /usr/share/figlet/fonts/ cd /usr/share/figlet/fonts/
#for a in *.flf; do BLA=${a%.flf}; echo $BLA; echo hallo | figlet -f $BLA; done #for a in *.flf; do BLA=${a%.flf}; echo $BLA; echo hallo | figlet -f $BLA; done
#for a in *.flf; do BLA=${a%.flf}; echo $BLA; echo CM Bofs | figlet -f $BLA; done #for a in *.flf; do BLA=${a%.flf}; echo $BLA; echo CM Bofs | figlet -f $BLA; done
#for a in *.flf; do BLA=${a%.flf}; echo $BLA ; echo $BLA | figlet -f $BLA; done #for a in *.flf; do BLA=${a%.flf}; echo $BLA ; echo $BLA | figlet -f $BLA; done
for a in *.flf; do BLA=${a%.flf}; echo $BLA ; echo cdist | figlet -f $BLA; done for a in *.flf; do BLA=${a%.flf}; echo $BLA ; echo $text | figlet -f $BLA; done

View file

@ -1,16 +1,26 @@
#!/bin/sh #!/bin/sh
SLEEP=$1 securemail
fetchmail
if [ -z "$SLEEP" ]; then # Disabled by Mon Jun 20 10:56:19 CEST 2016 -- using mu now
echo "$0 Zeit zum Schlafen" # notmuch new
exit 1
fi
while true; do # offlineimap
fetchmail >/dev/null # notmuch new
offlineimap
fetchmail >/dev/null exit 0
echo "Mails abgeholt, schlafe nun $SLEEP Sekunde(n)"
sleep $SLEEP; cd ~/Maildir
done git add .
git commit --quiet -m "Update from $(hostname) $(date +%F-%H:%M)"
#git fetch --quiet origin
git fetch origin
git merge -m "Merge from VM" origin/from-vm
git push --quiet origin master:from-notebook
notmuch new --quiet
exit 0

4
lh
View file

@ -6,4 +6,6 @@ datef="$2"
file=$(date +%Y-%m-%d $datef) file=$(date +%Y-%m-%d $datef)
set -x set -x
$EDITOR "${file}${suffix}"
# $EDITOR "${file}${suffix}"
emacs "${file}${suffix}"

View file

@ -1,5 +1,14 @@
#!/bin/sh #!/bin/sh
i3lock -c fe0000 -d # i3lock -c fe0000 -d
#~/b/i3lock/i3lock -t -i /home/users/nico/oeffentlich/bilder/linux-tux-bsd/think_linux_kachel.png #~/b/i3lock/i3lock -t -i /home/users/nico/oeffentlich/bilder/linux-tux-bsd/think_linux_kachel.png
# sleep 2
# xset dpms force off # xset dpms force off
# i3lock -i ~/.background.png --dpms --nofork
# try to start - if it already runs it will just exit
xscreensaver &
xscreensaver-command -lock

View file

@ -2,11 +2,24 @@
# Nico Schottelius, Tue Dec 3 23:16:30 CET 2013 # Nico Schottelius, Tue Dec 3 23:16:30 CET 2013
# Show mailstats # Show mailstats
#notmuch count tag:inbox or tag:unread
( (
for dir in ~/Maildir ~/Maildir/firmen/ungleich \ for dir in ~/Maildir ~/Maildir/firmen/ungleich \
~/Maildir/firmen/ungleich/panter \ ~/Maildir/firmen/ungleich/technik/INBOX/panter \
~/Maildir/firmen/ungleich/entwine; do ~/Maildir/firmen/ungleich/technik/INBOX/teralytics \
~/Maildir/bildung/zhaw \
~/Maildir/firmen/ungleich/technik/INBOX/entwine; do
find $dir/cur $dir/new -type f #find $dir/cur $dir/new -type f
find $dir/new -type f
done done
) | wc -l ) | wc -l
echo --
notmuch count tag:inbox
notmuch count tag:inbox and NOT tag:archive
echo --
notmuch count tag:inbox and tag:unread
notmuch count tag:inbox and tag:new

View file

@ -4,5 +4,6 @@ i3status | while :
do do
read line read line
sut=$(sut) sut=$(sut)
echo "$sut | $line" || exit 1 korea=$(TZ='Asia/Seoul' date "+%F %H:%M %Z")
echo "$korea | $sut | $line" || exit 1
done done

2
mympd
View file

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
cd ~/oeffentlich/audio cd ~/vcs/annex/audio
mpd --no-daemon ./mpd.conf mpd --no-daemon ./mpd.conf

6
nz
View file

@ -1,4 +1,10 @@
#!/bin/sh #!/bin/sh
# exec > /tmp/nz
# exec 2>&1
set -x
ddir="${HOME}/vcs/notes" ddir="${HOME}/vcs/notes"
cd "$ddir" cd "$ddir"

2
ruagdesktop Normal file → Executable file
View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
xrandr --output DP2 --above eDP1 --auto xrandr --output DP2 --above eDP1 --auto
xrandr --output HDMI1 --left-of DP2 --auto --rotate left xrandr --output HDMI1 --right-of DP2 --auto --rotate left
#i3 workspace 5 #i3 workspace 5
#i3 move workspace to output right #i3 move workspace to output right

View file

@ -6,5 +6,4 @@
#============================================================================== #==============================================================================
echo '[ "$TERM" = "rxvt-unicode" ] && export TERM=rxvt' >> "$HOME/.profile" echo '[ "$TERM" = "rxvt-unicode" ] && export TERM=rxvt' >> "$HOME/.profile"
echo '[ "$TERM" = "rxvt-unicode" ] && export TERM=rxvt' >> "$HOME/.bash_profile"
echo 'if ( $TERM == rxvt-unicode ) setenv TERM rxvt' >> "$HOME/.cshrc" echo 'if ( $TERM == rxvt-unicode ) setenv TERM rxvt' >> "$HOME/.cshrc"

View file

@ -5,6 +5,8 @@
# used at conferences / congresses / meetings # used at conferences / congresses / meetings
# #
$HOME/bin/securemail.off
POP3=110 POP3=110
POP3S=995 POP3S=995
IMAP=143 IMAP=143
@ -19,22 +21,33 @@ HOST="213.146.113.242"
HOST="nico@62.65.138.78" HOST="nico@62.65.138.78"
HOST="home.schottelius.org" HOST="home.schottelius.org"
HOST="nico@77.109.138.222" HOST="nico@77.109.138.222"
# HOST="root@backup1.ungleich.ch" #HOST="ssh.schottelius.org"
HOST="root@wein.ungleich.ch"
HOST="root@kaffee.ungleich.ch"
HOST="root@mx.ungleich.ch"
HOST="oneadmin@kaffee.ungleich.ch"
HOST="root@mx-hetzner01.ungleich.ch"
HOST="root@mx.ungleich.ch"
if [ $# -ge 1 ]; then if [ $# -ge 1 ]; then
HOST=$1; shift HOST=$1; shift
fi fi
#-L2323:mx3.schottelius.org:$IMAPS \
#-L4241:mx3.schottelius.org:$SMTP \
#ssh -T -f -C -N \
# -L4241:mx.ungleich.ch:$SMTP \
# -R :4242:localhost:22 \
# -D 3128 "$@" \
# "$HOST" && sendmail -q
#
ssh -T -f -C -N \ ssh -T -f -C -N \
-L2323:77.109.138.221:$IMAPS \ -L2323:mx.ungleich.ch:$IMAPS \
-L4241:77.109.138.221:$SMTP \ -L4241:mx.ungleich.ch:$SMTP \
-L2324:imap.googlemail.com:$IMAPS \ -L2324:imap.googlemail.com:$IMAPS \
-L2325:mail.zhaw.ch:$IMAPS \ -L2325:mail.zhaw.ch:$IMAPS \
-L2326:imap.googlemail.com:$POP3S \
-R :4242:localhost:22 \ -R :4242:localhost:22 \
-D 12345 \ -D 3128 "$@" \
"$HOST" "$@" "$HOST" && sendmail -q
# Fernzugriff # Fernzugriff
# ssh -T -f -C -N -R4242:localhost:22 "$HOST" # ssh -T -f -C -N -R4242:localhost:22 "$HOST"

View file

@ -25,5 +25,5 @@ for arg in "$@"; do
grep_param="${grep_param} -e ^${arg}:" grep_param="${grep_param} -e ^${arg}:"
done done
# set -x set -x
find "$CALDIR" -type f -exec egrep --with-filename -A 2 $grep_param {} \; find "$CALDIR" -type f -exec egrep --with-filename -A 2 $grep_param {} \;

View file

@ -16,10 +16,7 @@ dst=$1; shift
case $from in case $from in
loch) loch)
src=root@loch:/home/services/backup/bento-manuell/ src=root@loch:/home/services/backup/notebook-manuell/home/users/nico/
;;
42)
src=root@42:/home/services/backup/bento/
;; ;;
esac esac
@ -30,6 +27,7 @@ sshconfig=$sshdir/config
d1=$(date) d1=$(date)
set -x set -x
rsync -avS -e "ssh -i $sshkey -F $sshconfig" --delete "$src" "$dst" #rsync -avS -e "ssh -i $sshkey -F $sshconfig" --delete "$src" "$dst"
rsync -avS --delete "$src" "$dst"
echo $d1 echo $d1
date date

32
sync-to
View file

@ -5,14 +5,20 @@ set -x
dsthost="$1"; shift dsthost="$1"; shift
case "$dsthost" in case "$dsthost" in
42) loch|rloch)
dst=42:/home/services/backup/bento dst=root@$dsthost:/home/services/backup/notebook-manuell/home/users/nico/
;; ;;
loch) nico-vm)
dst=root@loch:/home/services/backup/bento-manuell dst=nico-vm.schottelius.org:/data
;; ;;
luchsingen) freiheit)
dst=root@luchsingen.schottelius.org:/home/services/backup/bento-manuell dst=freiheit:
;;
local)
dst=root@192.168.0.20:/home/services/backup/notebook-manuell/home/users/nico/
;;
nico-data)
dst=nico-data.schottelius.org:/home/nico
;; ;;
*) *)
echo "Unknown $1" >&2 echo "Unknown $1" >&2
@ -22,17 +28,11 @@ esac
start=$(date) start=$(date)
rsync -avS --delete --progress \ rsync -avS --delete --progress \
--exclude '/proc/*' \ --exclude-from=/home/users/nico/.ccollect/defaults/exclude \
--exclude '/tmp/*' \ --exclude /.cache \
--exclude '/sys/*' \ --exclude ~/temp/ \
--exclude '/dev/*' \
--exclude '/run/*' \
--exclude '/home/services/usbhd' \
--exclude '/home/users/nico/.cache/chromium/' \
--exclude '/home/users/nico/.bitcoin/blocks/' \
--exclude '/home/users/nico/.bitcoin/chainstate/' \
"$@" \ "$@" \
/ "$dst" ~/ "$dst"
end=$(date) end=$(date)
echo $start echo $start

15
wlan
View file

@ -6,19 +6,16 @@
# #
# Failed due to many reasons. See the working hack/version below. # Failed due to many reasons. See the working hack/version below.
# #
#
#ip link set wlp0s3 down
#iwconfig wlp0s3 essid public
#ip link set wlp0s3 up
#iwconfig wlp0s3 essid public
if [ "$#" -ge 1 ]; then if [ "$#" -ge 1 ]; then
dev=$1; shift dev=$1; shift
else else
dev=wlp2s0
dev=wlp3s0 dev=wlp3s0
dev=wlan0 dev=wlan0
dev=wlp2s0
dev=wlp1s0 dev=wlp1s0
dev=wlp4s0
dev=wlp3s0
fi fi
set -x set -x
@ -37,13 +34,17 @@ set -e
# ( rmmod iwlagn; modprobe iwlagn; sleep 2 ) # ( rmmod iwlagn; modprobe iwlagn; sleep 2 )
# wpa_supplicant -B -Dwext -iwlp0s3 -c /etc/wpa_supplicant/wpa_supplicant.conf # wpa_supplicant -B -Dwext -iwlp0s3 -c /etc/wpa_supplicant/wpa_supplicant.conf
wpa_supplicant -B -Dwext -i$dev -c /etc/wpa_supplicant/wpa_supplicant.conf # wpa_supplicant -B -Dwext -i$dev -c /etc/wpa_supplicant/wpa_supplicant.conf
#wpa_supplicant -B -Dnl80211 -i$dev -c /etc/wpa_supplicant/wpa_supplicant.conf
wpa_supplicant -B -Dnl80211 -i$dev -c /etc/wpa_supplicant/wpa_supplicant-${dev}.conf
# Give wpa some time to connect # Give wpa some time to connect
sleep 5 sleep 5
# Choose an dhcp client # Choose an dhcp client
( udhcpc -nqfi $dev || dhcpcd ) ( udhcpc -nqfi $dev || dhcpcd )
wpa_cli
# vpnc ~nico/ethz/vpn/sg.conf # vpnc ~nico/ethz/vpn/sg.conf
#vpnc ~nico/firmen/ethz/vpn/vpnc.conf #vpnc ~nico/firmen/ethz/vpn/vpnc.conf
# vpnc-disconnect # vpnc-disconnect

7
x-auto
View file

@ -1,12 +1,11 @@
#!/bin/sh #!/bin/sh
if [ "$#" -ne 1 ]; then if [ "$#" -lt 1 ]; then
echo "$0 position" set -- "$@" above
exit 1
fi fi
primary=eDP1 primary=eDP-1
# position: something xrandr understands # position: something xrandr understands
position=$1; shift position=$1; shift

1
x-oben
View file

@ -3,4 +3,5 @@ x-off
xrandr --output HDMI1 --auto --rotate normal --above eDP1 xrandr --output HDMI1 --auto --rotate normal --above eDP1
xrandr --output DP1 --auto --rotate normal --above eDP1 xrandr --output DP1 --auto --rotate normal --above eDP1
xrandr --output DP2 --auto --rotate normal --above eDP1
xrandr --output VGA1 --auto --rotate normal --above eDP1 xrandr --output VGA1 --auto --rotate normal --above eDP1

6
x-off
View file

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
xrandr --output DP1 --off for d in DP1 DP2 HDMI1 HDMI2 VIRTUAL1; do
xrandr --output HDMI1 --off xrandr --output $d --off
xrandr --output VGA1 --off done

View file

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
[ -x /usr/bin/urxvtcd ] && exec /usr/bin/urxvtcd #[ -x /usr/bin/urxvtcd ] && exec /usr/bin/urxvtcd
#exec urxvt "$@"
exec urxvtc "$@" exec urxvtc "$@"

View file

@ -1,8 +0,0 @@
#!/bin/sh
arrival="2014-7-14"
arrival="2014-8-20"
export arrival
python3 -c 'import os; import datetime; day=datetime.datetime.strptime(os.environ["arrival"], "%Y-%m-%d"); delta = day - datetime.datetime.now(); print("Sanghee is %sd away" % (delta.days))'