dot

packages and services management
Log | Files | Refs | README

commit 725e2f5b2830a3f9b6ef652973c9aeb42747d89c
parent 24b2c7e43d2b89ddcfa1d318696a12e72dbfb00f
Author: Josuah Demangeon <mail@josuah.net>
Date:   Tue, 20 Feb 2018 03:06:47 +0100

always even moar flatter structure

Diffstat:
M.profile | 46+++++++++++++++++++++++-----------------------
Mbin/agenda | 14+++++++-------
Mbin/edit | 2+-
Mbin/lt | 2+-
Mbin/pack | 14+++++++-------
Mbin/qemu | 16++++++++--------
Mbin/run | 2+-
Mman/configure.7 | 15+++++++++++++--
Mrun/collectd | 4++--
Mrun/crond | 4++--
Mrun/geomyidae | 4++--
Mrun/git | 4++--
Mrun/ii | 4++--
Mrun/inetd | 4++--
Mrun/ngircd | 4++--
Mrun/opentracker | 4++--
Mrun/quark | 4++--
Mrun/ratox | 4++--
Mrun/ssh-agent | 4++--
Mrun/tincd | 2+-
Mrun/tor | 4++--
21 files changed, 86 insertions(+), 75 deletions(-)

diff --git a/.profile b/.profile @@ -1,19 +1,19 @@ -export NAME='Josuah Demangeon' -export TZ='Europe/Paris' -export NICK='josuah' -export EMAIL='mail@josuah.net' +export NAME="Josuah Demangeon" +export TZ="Europe/Paris" +export NICK="josuah" +export EMAIL="mail@josuah.net" export MAILTO="$EMAIL" -export EDITOR='edit' VISUAL='edit' -export PAGER='less' MANPAGER='less' +export EDITOR="edit" VISUAL="edit" +export PAGER="less" MANPAGER="less" -export LANG='en_US.UTF-8' -export LC_LC_COLLATE='C' -export LC_CTYPE='en_US.UTF-8' -export LC_MONETARY='en_US.UTF-8' -export LC_MESSAGES='en_US.UTF-8' -export LC_NUMERIC='en_US.UTF-8' -export LC_TIME='en_US.UTF-8' +export LANG="en_US.UTF-8" +export LC_LC_COLLATE="C" +export LC_CTYPE="en_US.UTF-8" +export LC_MONETARY="en_US.UTF-8" +export LC_MESSAGES="en_US.UTF-8" +export LC_NUMERIC="en_US.UTF-8" +export LC_TIME="en_US.UTF-8" export SYSROOT="$HOME/.local" export PLAN9="$SYSROOT/src/plan9" @@ -24,17 +24,17 @@ export C_INCLUDE_PATH="$SYSROOT/include" export LIBRARY_PATH="$SYSROOT/lib:/usr/local/lib/inotify" export LD_LIBRARY_PATH="$SYSROOT/lib:/usr/local/lib/inotify" -export ABDUCO_CMD='dvtm-status' -export ABDUCO_SOCKET_DIR="$HOME/var/run" -export BLIH='josuah.demangeon@epitech.eu' -export CVSROOT='anoncvs@anoncvs.fr.openbsd.org:/cvs' -export EXINIT='set ruler' -export LESS='-R~X' -export LESSHISTFILE='-' +export ABDUCO_CMD="dvtm-status" +export ABDUCO_SOCKET_DIR="$HOME/run" +export BLIH="josuah.demangeon@epitech.eu" +export CVSROOT="anoncvs@anoncvs.fr.openbsd.org:/cvs" +export EXINIT="set ruler" +export LESS="-R~X" +export LESSHISTFILE="-" export MBLAZE="$HOME/.config/mblaze" -export PKG_PATH='https://ftp.fr.openbsd.org/pub/OpenBSD/' -export SSH_AUTH_SOCK="$HOME/var/run/ssh-agent" +export PKG_PATH="https://ftp.fr.openbsd.org/pub/OpenBSD/" +export SSH_AUTH_SOCK="$HOME/run/ssh-agent" export PS1='$([ "$?" -gt 0 ] && printf "\033[31;1mx\033[m\n\r")' export PS1="$PS1$(printf '\033]0;%s\a' '$PWD') -$(uname -n)$([ "$(whoami)" = 'root' ] && printf '#' || printf '$') " +$(uname -n)$([ "$(whoami)" = "root" ] && printf '#' || printf '$') " diff --git a/bin/agenda b/bin/agenda @@ -188,7 +188,7 @@ case "$1" in [ "$#" -lt 2 ] || [ "$#" -gt 3 ] && exec "$0" shift 1 - [ "$1" = 'all' ] && set -- "$AGENDA"/* || set -- "$AGENDA/$1" + [ "$1" = "all" ] && set -- "$AGENDA"/* || set -- "$AGENDA/$1" cat "$@" | awk -v SORT="${3:-BECLS}" "$sort" | @@ -216,12 +216,12 @@ case "$1" in find "$AGENDA" -type f ! -name '*.txt' -exec awk "$gopher" {} \; | sort ;; (*) - echo 'usage: agenda add <name> <YYYY-MM-DD-HH-MM> <YYYY-MM-DD-HH-MM>' - echo ' agenda edit <name>' - echo ' agenda import <file.ics> <name> [+-]<HH>' - echo ' agenda view <name> [BESCL]' - echo ' agenda gopher' - echo '' + echo "usage: agenda add <name> <YYYY-MM-DD-HH-MM> <YYYY-MM-DD-HH-MM>" + echo " agenda edit <name>" + echo " agenda import <file.ics> <name> [+-]<HH>" + echo " agenda view <name> [BESCL]" + echo " agenda gopher" + echo "" ls -C "$AGENDA" ;; esac diff --git a/bin/edit b/bin/edit @@ -6,4 +6,4 @@ # emacs(1)-style input key bindings for everything REPL. This also permit to # change the $EDITOR without reloading the environment variables. -exec vi "$@" +VISUAL=vi exec less "$@" diff --git a/bin/lt b/bin/lt @@ -17,7 +17,7 @@ # -rwxr-xr-x 1 josuah josuah 5430 Feb 17 19:51 | `- xdg-open # -rwxr-xr-x 1 josuah josuah 468 Feb 17 19:55 ... -LC_COLLATE=C +LC_COLLATE="C" cd "${1:-.}" diff --git a/bin/pack b/bin/pack @@ -2,8 +2,8 @@ export SYSROOT="${SYSROOT:-$HOME/.local}" export PKG="$HOME/etc/pack/$2" -export SRC="$SYSROOT/src/$2" -export OPT="$SYSROOT/opt/$2" +export SRC="$HOME/src/$2" +export OPT="$HOME/opt/$2" export CFLAGS="-I'$SYSROOT/include'" export LDFLAGS="-L'$SYSROOT/lib'" @@ -11,7 +11,7 @@ case "$1" in (tar) [ -d "$SRC" ] && exit 0 || mkdir -p "$SRC" - IFS='' read -r url < "$PKG/tar" + IFS="" read -r url < "$PKG/tar" curl -#L "$url" | case "$url" in (*.tgz|*.tar.gz) gzip -d - ;; @@ -19,14 +19,14 @@ case "$1" in (*.txz|*.tar.xz) xz -d - ;; esac | tar -xf - -C "$SRC" || rmdir "$SRC" - find "$SRC" -mindepth 2 -maxdepth 2 -exec mv {} "$SRC" ';' + find "$SRC" -mindepth 2 -maxdepth 2 -exec mv {} "$SRC" \; rmdir "$SRC"/* 2>/dev/null || true ;; (git) [ -d "$SRC" ] && exit 0 mkdir -p "$(dirname "$SRC")" - IFS='' read -r url < "$PKG/git" + IFS="" read -r url < "$PKG/git" git clone "$url" "$SRC" ;; (get) @@ -59,8 +59,8 @@ case "$1" in -type l -exec rm {} + ;; (*) - echo 'usage: pack tar | git | get | build | add | del <package>' - echo '' + echo "usage: pack tar | git | get | build | add | run | del <package>" + echo "" COLUMNS=80 ls "$HOME/etc/pack" ;; esac diff --git a/bin/qemu b/bin/qemu @@ -1,20 +1,20 @@ #!/bin/sh -e -mkdir -p "$HOME/var/log/qemu" "$HOME/var/qemu" "$HOME/lib/iso/qemu" +mkdir -p "$HOME/log/qemu" "$HOME/var/qemu" "$HOME/lib/qemu" case "$1" in (new) - [ "$#" -ne 3 ] || ! [ -r "$HOME/lib/iso/qemu/$3" ] || + [ "$#" -ne 3 ] || ! [ -r "$HOME/lib/qemu/$3" ] || exec "$0" - cp "$HOME/lib/iso/qemu/$2" "$HOME/var/qemu/$3" + cp "$HOME/lib/qemu/$2" "$HOME/var/qemu/$3" ;; (start) - [ "$#" -ne 3 ] || ! [ -r "$HOME/lib/iso/qemu/$2" ] || + [ "$#" -ne 3 ] || ! [ -r "$HOME/lib/qemu/$2" ] || exec "$0" - beg='10000' - end='10100' + beg="10000" + end="10100" port="$(netstat -natl | awk -v b="$beg" -v e="$end" \ '$6 == "LISTEN" && sub(".*[.:]", "", $4) && b <= $4 + 0 && $4 + 0 <= e { @@ -29,14 +29,14 @@ case "$1" in -netdev user,id=net0,hostfwd=tcp::$port-:22 \ -display none \ "$HOME/var/qemu/$2" \ - 1>> "$HOME/var/log/qemu/$2" & + 1>> "$HOME/log/qemu/$2" & ;; (*) echo 'usage: qemu start <name.img>' 1>&2 echo ' qemu new <ref.img> <new.img>' 1>&2 echo 'store:' 1>&2 - ls "$HOME/lib/iso/qemu" | sed 's/^/ /' 1>&2 + ls "$HOME/lib/qemu" | sed 's/^/ /' 1>&2 echo 'created:' 1>&2 ls "$HOME/var/qemu" | sed 's/^/ /' 1>&2 diff --git a/bin/run b/bin/run @@ -1,6 +1,6 @@ #!/bin/sh -e -mkdir -p "$HOME/var/log" +mkdir -p "$HOME/log" [ "$#" -ge 1 ] || exec ls "$HOME/.config/run" diff --git a/man/configure.7 b/man/configure.7 @@ -47,13 +47,24 @@ Sets the directory containing all .Sy generated data , including irc, mail, tox, torrent, qemu images... . -.It Pa ~/var/run +.It Pa ~/run Information and pipes for currently running programs. . -.It Pa ~/var/log +.It Pa ~/log Logs for each program started by .Xr run 1 . . +.It Pa ~/etc +Source of the configuration file, symlinked into +.Pa ~/.config +. +.It Pa ~/opt +Local installation path for package, symlinked into +.Pa ~/.local +. +.It Pa ~/src +Source of packages which can be compiled and installed in ~/opt +. .It Pa ~/.cache Directory containing generated data cached for increasing performances. . diff --git a/run/collectd b/run/collectd @@ -4,5 +4,5 @@ exec collectd \ -f \ -P "$HOME/var/run/collectd.pid" \ -C "$HOME/.config/collectd.conf" \ - 1>> "$HOME/var/log/collectd" \ - 2>> "$HOME/var/log/collectd" & + 1>> "$HOME/log/collectd" \ + 2>> "$HOME/log/collectd" & diff --git a/run/crond b/run/crond @@ -2,5 +2,5 @@ exec crond \ -f "/etc/crontab" \ - 1>> "$HOME/var/log/crond" \ - 2>> "$HOME/var/log/crond" & + 1>> "$HOME/log/crond" \ + 2>> "$HOME/log/crond" & diff --git a/run/geomyidae b/run/geomyidae @@ -8,5 +8,5 @@ exec geomyidae \ -b "$path" \ -p "$port" \ -h "$host" \ - 1>> "$HOME/var/log/geomyidae" \ - 2>> "$HOME/var/log/geomyidae" & + 1>> "$HOME/log/geomyidae" \ + 2>> "$HOME/log/geomyidae" & diff --git a/run/git b/run/git @@ -7,5 +7,5 @@ exec git daemon \ --base-path="$path" \ --export-all \ --port="$port" \ - 1>> "$HOME/var/log/git" \ - 2>> "$HOME/var/log/git" & + 1>> "$HOME/log/git" \ + 2>> "$HOME/log/git" & diff --git a/run/ii b/run/ii @@ -9,7 +9,7 @@ port="${2:-6667}" [ -S "/tmp/$host" ] && p="u" port="/tmp/$host" || p="p" -mkdir -p "$HOME/var/irc/$host" "$HOME/var/log/ii" +mkdir -p "$HOME/var/irc/$host" "$HOME/log/ii" pgrep -f "ii -s $host" || exec ii \ -s "$host" \ @@ -19,4 +19,4 @@ pgrep -f "ii -s $host" || exec ii \ -k "PASS" \ -f "$NAME" \ 1>> "$HOME/var/irc/$host/log" \ - 2>> "$HOME/var/log/ii/$host" & + 2>> "$HOME/log/ii/$host" & diff --git a/run/inetd b/run/inetd @@ -1,5 +1,5 @@ #!/bin/sh -e exec inetd \ - 1>> "$HOME/var/log/inetd" \ - 2>> "$HOME/var/log/inetd" & + 1>> "$HOME/log/inetd" \ + 2>> "$HOME/log/inetd" & diff --git a/run/ngircd b/run/ngircd @@ -3,5 +3,5 @@ exec ngircd \ -n \ -f "/etc/ngircd/conf" \ - 1>> "$HOME/var/log/ngircd" \ - 2>> "$HOME/var/log/ngircd" & + 1>> "$HOME/log/ngircd" \ + 2>> "$HOME/log/ngircd" & diff --git a/run/opentracker b/run/opentracker @@ -2,5 +2,5 @@ exec opentracker \ -d "$HOME/var/torrent" \ - 1>> "$HOME/var/log/opentracker" \ - 2>> "$HOME/var/log/opentracker" & + 1>> "$HOME/log/opentracker" \ + 2>> "$HOME/log/opentracker" & diff --git a/run/quark b/run/quark @@ -6,5 +6,5 @@ exec quark \ -h localhost \ -d "$path" \ -V \ - 1>> "$HOME/var/log/quark" \ - 2>> "$HOME/var/log/quark" & + 1>> "$HOME/log/quark" \ + 2>> "$HOME/log/quark" & diff --git a/run/ratox b/run/ratox @@ -6,5 +6,5 @@ mkdir -p "$path" cd "$path" exec ratox \ - 1>> "$HOME/var/log/ratox" \ - 2>> "$HOME/var/log/ratox" & + 1>> "$HOME/log/ratox" \ + 2>> "$HOME/log/ratox" & diff --git a/run/ssh-agent b/run/ssh-agent @@ -5,5 +5,5 @@ rm -f "$SSH_AUTH_SOCK" ssh-agent \ -a "$SSH_AUTH_SOCK" \ - 1>> "$HOME/var/log/ssh-agent" \ - 2>> "$HOME/var/log/ssh-agent" & + 1>> "$HOME/log/ssh-agent" \ + 2>> "$HOME/log/ssh-agent" & diff --git a/run/tincd b/run/tincd @@ -3,4 +3,4 @@ mkdir -p "$HOME/var/run" exec tincd \ - --logfile="$HOME/var/log/tincd" + --logfile="$HOME/log/tincd" diff --git a/run/tor b/run/tor @@ -1,5 +1,5 @@ #!/bin/sh -e exec tor \ - 1>> "$HOME/var/log/tor" \ - 2>> "$HOME/var/log/tor" & + 1>> "$HOME/log/tor" \ + 2>> "$HOME/log/tor" &