dot

packages and services management
Log | Files | Refs | README

commit 9d83b8754f20970a569d2b4ed6690989429260cf
parent d87fd0086b65d05c356288242ae863256b39c5b0
Author: Josuah Demangeon <mail@josuah.net>
Date:   Mon,  5 Feb 2018 16:21:03 +0100

various changes from FOSDEM

Diffstat:
Magenda/main | 66+++++++++++++++++++++++++++++++++++++++++++++---------------------
Mbin/agenda | 6+++++-
Abin/edit | 3+++
Mbin/io-fs | 2+-
Mbin/monit | 33++++++++++++++++-----------------
Mbin/tty-theme | 1+
Abin/wifi | 5+++++
Mbin/xdg-open | 4+++-
Mdaemon/tor | 4++--
Mdot/profile | 2+-
Apack/collectd/build | 6++++++
Apack/collectd/tar | 1+
Mskel/torrc | 19+++++++++++++++++++
13 files changed, 108 insertions(+), 44 deletions(-)

diff --git a/agenda/main b/agenda/main @@ -1,32 +1,56 @@ -B:1514735700 -E:1514742600 -S:Paris Massy TGV -C:train -L:Rennes -D:not yet purchased 13€ -: -B:1517180400 -E:1517180400 -S:BSD Meetup -C:conference -L:Rennes -D:09:58 < Niamkik> josuah olivier_ petrus_lt: prochain meetup 29 janvier 2018 -D:- http://meetup.bsd-rennes.fr -: B:1533942000 E:1534028400 S:BitreichCon C:conference L:France -D: -D:The phantom bitreichcon committee has decided on the date for bitreich- -D:con 2018. Bitreichcon 2018 will happen on 11th to 12th of August 2018. +D:The phantom bitreichcon committee has decided on the date for bitreich-con +D:2018. Bitreichcon 2018 will happen on 11th to 12th of August 2018. D:The location will be announced separately. : -B:1517612400 -E:1517698800 +B:1517646600 +E:1517763600 S:FOSDEM C:conference L:ULB Solbosch Campus in Brussels, Belgium -D: +D:https://fosdem.org/2018/ +: +B:1517625000 +E:1517643300 +S:FLIXBUS N769 to Bruxelles (Gare du Nord) +C:transport +L:Paris (Bercy Seine), 210 quai de Bercy, 75012 Paris +D:#8058355000 +: +B:1517795400 +E:1517809500 +S:FLIXBUS N79 to Paris (Bercy Seine) +C:transport +L:Bruxelles (Gare du Midi), Rue de France, 1060 Saint-Gilles +D:#8058355888 +: +B:1517819400 +E:1517834400 +S:FLIXBUS 702 to Rennes (Gare routiere) +C:transport +L:Paris (Bercy Seine) +D:#8058355888 +: +B:1517596800 +E:1517611800 +S:OUIBUS SNCF C6 to Paris Bercy, Boulevard de Bercy 48, 75012 Paris +C:transport +L:Rennes Gare routiere, Boulevard Solferino, 35000 Rennes +D:Numero de billet: BGKZEG-00001 +D:Numero de siege: 8E +D:Booking number: BGKZEG +D:DIS: EYHCAF +: +B:1517684400 +E:1517727600 +S:Escale Hotel +C:bed +L:Rue de France 103, Brussels 1070 +D:No de voyage: 7327231398974 +D:Dortoir Partage, hommes uniquement +D:1 lit superpose (1 place) Chambre non-fumeur : diff --git a/bin/agenda b/bin/agenda @@ -193,7 +193,11 @@ case "${1}" in (view) [ "${#}" -lt 2 ] || [ "${#}" -gt 3 ] && exec "${0}" - awk -v SORT="${3:-BECLS}" "${awk_sort}" "${AGENDA}/${2}" | + shift 1 + [ "${1}" = 'all' ] && set -- "${AGENDA}"/* || set -- "${AGENDA}/${1}" + + cat "${@}" | + awk -v SORT="${3:-BECLS}" "${awk_sort}" | awk -v OFF="$(date +%z | cut -c 1-3)" "${awk_view}" | less ;; diff --git a/bin/edit b/bin/edit @@ -0,0 +1,3 @@ +#!/bin/sh -e + +exec vi "$@" diff --git a/bin/io-fs b/bin/io-fs @@ -8,4 +8,4 @@ mount } | column -ts ' ' -} | iomenu -# -p mounts +} | iomenu -# diff --git a/bin/monit b/bin/monit @@ -1,5 +1,5 @@ #!/bin/sh -# ressources monitoring script for plotting with plot(1) +# ressources monitoring script for plotting with ploot(1) # It will produce one line with the following values, separated with a space: # @@ -8,24 +8,13 @@ # 3. free memory 7. total free storage # 4. cpu usage -DATA="${VAR}/monit" +MONIT="${VAR}/monit" awk_record=' #mem #bi #bo -BEGIN { - "date +%s" | getline time; - "hostname" | getline host; - "uptime" | getline load; - sub(/.* /, "", load); - while ("df" | getline) { - if ($1 ~ "^/dev/" || $1 == "zroot") - stor += $4; - } -} - NR == 2 { split($0, keys); for (key in keys) @@ -34,6 +23,16 @@ NR == 2 { } NR >= 4 { + while ("df" | getline) { + if ($1 ~ "^/dev/" || $1 == "zroot") + stor += $4; + } + + "date +%s" | getline time; close("date +%s"); + "hostname" | getline host; close("hostname"); + "uptime" | getline load; close("uptime"); + + sub(/.* /, "", load); for (i = 1 + split($0, values); i > 0; i--) table[keys[i]] = values[i]; mem = table[mem]; @@ -96,18 +95,18 @@ case "${1}" in [ "${#}" -ne 2 ] && exec "${0}" vmstat "${2}" | awk -v mem="${mem}" -v bi="${bi}" -v bo="${bo}" "${awk_record}" \ - >> "${DATA}" + >> "${MONIT}" ;; (step) [ "${#}" -ne 2 ] && exec "${0}" vmstat "${2}" 2 | - awk -v mem="${mem}" -v bi="${bi}" -v bo="${bo}" "${awk_record}" >> "${DATA}" + awk -v mem="${mem}" -v bi="${bi}" -v bo="${bo}" "${awk_record}" >> "${MONIT}" ;; (plot) [ "${#}" -ne 2 ] && [ "${#}" -ne 3 ] && exec "${0}" - tail -n 80 "$DATA" | + tail -n 80 "${MONIT}" | awk -v STEP="${2:?argument missing} step}" "${awk_plot}" | - plot -h "${3:-10}" + ploot -h "${3:-10}" ;; (*) echo 'usage: monit step | record | plot delay' diff --git a/bin/tty-theme b/bin/tty-theme @@ -1,5 +1,6 @@ #!/bin/sh # set the theme for the tty from a simple file format +# `vtfontcvt -h 8 -w 4 miniwi-8.bdf miniwi-8.fnt`, then it's just a `vidcontrol -f miniwi-8.fnt` away # normal bold # 0 8 black diff --git a/bin/wifi b/bin/wifi @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "${#}" -ne 2 ] && exec printf 'usage: wifi <nwid> <wpa_passphrase>\n' + +doas ifconfig iwm0 nwid "${1}" wpa wpakey "0x${2}" diff --git a/bin/xdg-open b/bin/xdg-open @@ -182,9 +182,11 @@ esac exec transmission-cli "${1}" ;; (*.img|*.iso) - exec qemu-system-x86_64 -m 500M \ + exec nohup qemu-system-x86_64 \ + -m 500M \ -device e1000,netdev=net0 \ -netdev user,id=net0,hostfwd=tcp::5555-:22 \ + -display none \ "${1}" ;; #--- media --------------------------------------------------------------------- diff --git a/daemon/tor b/daemon/tor @@ -1,5 +1,5 @@ #!/bin/sh -e exec tor \ - 1> "${LOG}/geomyidae" \ - 2> "${LOG}/geomyidae" & + 1> "${LOG}/tor" \ + 2> "${LOG}/tor" & diff --git a/dot/profile b/dot/profile @@ -4,7 +4,7 @@ export NICK='josuah' export EMAIL='mail@josuah.net' export MAILTO="${EMAIL}" -export EDITOR='vi' VISUAL='vi' +export EDITOR='edit' VISUAL='edit' export PAGER='less' MANPAGER='less' export LANG='en_US.UTF-8' diff --git a/pack/collectd/build b/pack/collectd/build @@ -0,0 +1,6 @@ +#!/bin/sh -e + +./configure \ + --prefix="${OPT}" \ + +make install diff --git a/pack/collectd/tar b/pack/collectd/tar @@ -0,0 +1 @@ +https://storage.googleapis.com/collectd-tarballs/collectd-5.8.0.tar.bz2 diff --git a/skel/torrc b/skel/torrc @@ -11,3 +11,22 @@ DataDirectory @LOCALSTATEDIR@/var/tor ## address y:z. HiddenServicePort 80 127.0.0.1:6697 + +SOCKSPort 0 +User tor +PIDFile /var/run/tor/tor.pid +Log notice syslog +DataDirectory /var/lib/tor/data + +HiddenServiceDir /tor/ssh +HiddenServicePort 22 127.0.0.1:22 + +HiddenServiceDir /tor/gopher +HiddenServicePort 70 127.0.0.1:71 + +HiddenServiceDir /tor/http +HiddenServicePort 80 127.0.0.1:80 + +HiddenServiceDir /tor/icecast +HiddenServicePort 3232 127.0.0.1:3232 +