dot

packages and services management
Log | Files | Refs | README

commit a03157dcaac791a0c33637007fdb93632da5ba46
parent f711173757129160c1d725a8145a4e878bd71a21
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun,  8 Apr 2018 21:47:10 +0200

big cleanup: more things in run/*/ less in *

Diffstat:
D.bash_profile | 1-
D.bashrc | 5-----
D.emacs | 296-------------------------------------------------------------------------------
D.profile | 58----------------------------------------------------------
D.tmux.conf | 62--------------------------------------------------------------
Dbin/back | 70----------------------------------------------------------------------
Dbin/blih-openssl | 33---------------------------------
Dbin/git-mirror | 6------
Dbin/markup | 0
Abin/markup-gopher | 1+
Abin/markup-html | 1+
Dbin/random | 6------
Dbin/term | 16----------------
Dbin/tls | 16----------------
Mbin/update-sfeed | 2+-
Dbin/wifi | 12------------
Dbin/www | 87-------------------------------------------------------------------------------
Mconfigure | 35++++++++++++++++-------------------
Rskel/exports.bsd -> exports | 0
Rskel/fstab.linux -> fstab | 0
Rskel/hosts -> hosts | 0
Mman/README.7 | 6+++---
Amblaze/.gitignore | 4++++
R.mpoprc -> mpoprc | 0
R.msmtprc -> msmtprc | 0
Mpack/sfeed/build | 2+-
Mpack/tinc/build | 8+++-----
Aprofile | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rrun/tls/port -> run/brssl/port | 0
Arun/brssl/run | 11+++++++++++
Rcollectd.conf -> run/collectd/conf | 0
Mrun/collectd/run | 2+-
Drun/ghttp/host | 2--
Drun/ghttp/port | 2--
Drun/ghttp/run | 8--------
Rbin/gproxy -> run/gproxy/gproxy | 0
Mrun/ii/run | 4----
Arun/ngircd/tls | 8++++++++
Rtinc/conf.d/common.conf -> run/tinc/conf.d/common.conf | 0
Rtinc/hosts/kroa -> run/tinc/hosts/kroa | 0
Rtinc/hosts/nas -> run/tinc/hosts/nas | 0
Rtinc/hosts/pdmg -> run/tinc/hosts/pdmg | 0
Rtinc/hosts/rpi -> run/tinc/hosts/rpi | 0
Rtinc/hosts/t470s -> run/tinc/hosts/t470s | 0
Mrun/tinc/run | 5++---
Rtinc/tinc-up -> run/tinc/tinc-up | 0
Drun/tls/run | 9---------
Mrun/tor/run | 2+-
Rskel/torrc -> run/tor/torrc | 0
Aservices | 6++++++
Msfeed | 3+++
Dskel/crontab | 13-------------
Dskel/exports.linux | 1-
Dskel/services | 10----------
R.ssh/authorized_keys -> ssh/authorized_keys | 0
R.ssh/config -> ssh/config | 0
Duser/git | 4----
Rskel/wpa_supplicant.conf -> wpa_supplicant.conf | 0
R.xinitrc -> xinitrc | 0
59 files changed, 120 insertions(+), 755 deletions(-)

diff --git a/.bash_profile b/.bash_profile @@ -1 +0,0 @@ -. $HOME/.bashrc diff --git a/.bashrc b/.bashrc @@ -1,5 +0,0 @@ -. "$HOME/.profile" - -PS1='\[\033[31;1m\]$([ $? -gt 0 ] && printf "x\\n ")\033[m\] -\[\033]0;$PWD\a\]\h\$ ' -alias ix='curl -F f:1=@- ix.io' diff --git a/.emacs b/.emacs @@ -1,296 +0,0 @@ -(setq - user-full-name "Josuah Demangeon" - user-mail-address "mail@josuah.net" - - custom-file (expand-file-name "emacs-custom.el" temporary-file-directory)) - -(add-to-list 'load-path "~/.emacs.d/lisp") - -; --- appearance --------------------------------------------------------------- - -(when (fboundp 'menu-bar-mode) (menu-bar-mode -1)) -(when (fboundp 'fringe-mode) (fringe-mode 0)) -(when (fboundp 'tool-bar-mode) (tool-bar-mode -1)) -(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) - -(set-frame-font "mono:size=15") -(add-to-list 'default-frame-alist - '(font . "mono:size=15")) - -; --- packages ----------------------------------------------------------------- - -(require 'package) - -(setq package-list '(ivy swiper counsel)) - -(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) - -(package-initialize) - -(unless package-archive-contents (package-refresh-contents)) - -(dolist (package '(ivy swiper counsel)) - (unless (package-installed-p package) (package-install package))) - -; --- core settings ------------------------------------------------------------ - -(setq - echo-keystrokes 0.1 - - inhibit-startup-message t - initial-scratch-message nil - - tab-always-indent 'complete) - -(defalias 'display-startup-echo-area-message - (lambda () (message "Emacs loaded in %s" (emacs-init-time)))) -(defalias 'yes-or-no-p 'y-or-n-p) - -(column-number-mode) - -(require 'files) -(setq - backup-directory-alist ;Backup and autosaves - `((".*" . ,(expand-file-name "tmp" user-emacs-directory))) - auto-save-file-name-transforms - `((".*" ,(expand-file-name "tmp" user-emacs-directory)))) - -(require 'hideshow) -(add-hook 'prog-mode-hook 'hs-minor-mode) - -(provide 'reveal) -(global-reveal-mode) - -(require 'which-func) -(add-hook 'prog-mode-hook 'which-function-mode) -(add-hook 'text-mode-hook 'which-function-mode) - -(require 'prog-mode) -(setq prettify-symbols-unprettify-at-point 'right-edge) -(prettify-symbols-mode) - -(require 'paren) -(setq show-paren-when-point-inside-paren t - show-paren-when-point-in-periphery t - show-paren-style 'mixed) - -(show-paren-mode 1) - -(require 'misc) -(global-set-key (kbd "M-z") 'zap-up-to-char) - -(require 'eldoc) -(add-hook 'prog-mode-hook 'eldoc-mode) - -(require 'doc-view) -(setq doc-view-resolution 100) - -; --- ibuffer ------------------------------------------------------------------ - -(require 'ibuffer) -(require 'ibuf-ext) - -(setq - ibuffer-saved-filter-groups - '(("default" - ("Gnus" - (or (mode . message-mode) - (mode . mail-mode) - (mode . gnus-group-mode) - (mode . gnus-summary-mode) - (mode . gnus-article-mode) - (mode . gnus-edit-form-mode) - (name . "^\\.newsrc-dribble"))) - ("Irc" (mode . rcirc-mode)) - ("Web" (mode . eww-mode)) - ("Shell" - (or (name . "^\\*Shell Command Output\\*$") - (name . "^\\*Async Shell Command\\*$") - (name . "^\\*Whois\\*$") - (mode . eshell-mode) - (mode . shell-mode))) - ("Emacs" - (or (name . "^\\*scratch\\*$") - (name . "^\\*backtrace\\*$") - (name . "^\\*Dired log\\*$") - (mode . messages-buffer-mode) - (mode . completion-list-mode) - (mode . Info-mode) - (mode . help-mode) - (mode . compilation-mode) - (mode . package-menu-mode) - (mode . occur-mode) - (mode . Custom-mode))) - ("VC" - (or (name . "^\\*vc\\*$") - (mode . diff-mode) - (mode . vc-dir-mode))) - ("Dired" (mode . dired-mode)) - ("Elisp" (mode . emacs-lisp-mode)) - ("Org" (mode . org-mode)) - ("Documents" (filename . ".pdf\\|.ps\\|.odt\\|.ods")) - ("Other Files" (filename . ""))))) - -(add-hook - 'ibuffer-mode-hook - (lambda () (ibuffer-switch-to-saved-filter-groups "default"))) - -(defalias 'list-buffers 'ibuffer) - -; --- eshell ------------------------------------------------------------------- - -(require 'eshell) -(require 'em-prompt) -(require 'em-term) -(require 'em-cmpl) -(require 'em-smart) -(require 'em-banner) - -(setq - eshell-where-to-jump 'begin - eshell-review-quick-commands nil - eshell-smart-space-goes-to-end t - pcomplete-cycle-completions nil - eshell-prompt-function 'my-eshell-prompt-function - eshell-prompt-regexp "^> ") - -(defmacro with-face (string &rest properties) - "Set face for STRING without defining it, according to PROPERTIES." - `(propertize ,string 'face (list ,@properties))) - -(defun my-eshell-prompt-function () - "Function generating the eshell prompt." - (concat - "\n" - (with-face (concat " " (abbreviate-file-name (eshell/pwd)) " ") - :inverse-video t) - (with-face (format-time-string " %H:%M " (current-time)) - :inherit 'hl-line) - - (with-face (or (ignore-errors - (format "%s %s" - (vc-responsible-backend default-directory) - (vc-state default-directory))) - "") - :inherit 'hl-line) - (with-face "\n" - :inherit 'hl-line) - "> ")) - -(add-to-list 'eshell-visual-commands "alsamixer") -(add-to-list 'eshell-visual-commands "cfdisk") - -(add-hook 'eshell-mode-hook 'eshell-smart-initialize) - -; --- org ---------------------------------------------------------------------- - -(require 'org) -(require 'ox-publish) - -(setq - org-descriptive-links nil - org-startup-folded nil) - -(org-babel-do-load-languages - 'org-babel-load-languages - '((emacs-lisp . t) (python . t) (R . t))) - -; --- gnus --------------------------------------------------------------------- - -(require 'nnimap) -(require 'gnus-mlspl) -(require 'nnir) - -(setq - ;; E-mails - - gnus-select-method - '(nnimap - "gmail" - - (nnimap-stream ssl) ;Reading - (nnimap-address "imap.gmail.com") - (nnimap-inbox "INBOX") - - (smtpmail-smtp-server "smtp.gmail.com") ;Sending - (smtpmail-smtp-service 587) - (send-mail-function smtpmail-send-it) - - (nnir-search-engine imap) ;Searching - - (nnimap-split-methods nnmail-split-fancy) ;Splitting - (nnimap-unsplittable-articles nil) - - (nnmail-split-fancy - (& (| (: nnmail-split-fancy-with-parent) - (: gnus-group-split-fancy)) - (from "josuah\\.demangeon@gmail\\.com" "mail.sent"))) - - (gnus-group-split-default-catch-all-group "INBOX") - - (gnus-parameters ;Group parameters - ((".*\\[Gmail\\].*" - (subscribed . t)) - ("mail\\..*" - (display . all) - (subscribed . t)) - ("mail\\.me" - (to-list . "josuah.demangeon@gmail.com")) - ("mail\\.sfbi" - (to-list . "bioinfo@sfbi.fr")) - ("mail\\.fsf" - (to-list . "info@fsf.org")) - ("mail\\.univ-rennes1" - (split-regexp . ".*univ-rennes1\\.fr")) - ("mail\\.github" - (to-list . "notifications@github\\.com") - (split-regexp . ".*github\\.com")) - ("mail\\.expenses" - (split-regexp . "@amazon.*") - (split-regexp . "@.*sfr\\.fr")) - ("list\\..*" - (display . all))))) - - message-subscribed-address-functions - '(gnus-find-subscribed-addresses) - - gnus-ignored-from-addresses nil ;Hide no group or email adress - gnus-ignored-newsgroups "" - - mm-attachment-override-types '("image/.*") ;Display images inline - - gnus-use-full-window nil ;So not change window config - - ;; NTP - - gnus-secondary-select-methods '((nntp "news.gmane.org") - (nntp "news.gnus.org"))) - -(add-hook 'gnus-group-mode-hook 'gnus-topic-mode) - -; --- ivy ---------------------------------------------------------------------- - -(require 'ivy) -(require 'swiper) -(require 'counsel) -(ivy-mode) -(counsel-mode) - -(global-set-key (kbd "C-s") 'swiper) -(global-set-key (kbd "M-x") 'counsel-M-x) - -; ------------------------------------------------------------------------------ - -(c-add-style "epitech" - '("linux" - (c-offsets-alist - (func-decl-cont . 8) - (topmost-intro-cont . 8) - (member-init-cont . 8) - (inner-cont . 8) - (statement-cont . 8) - (arglist-cont . 8) - (arglist-cont-nonempty . 8)))) -(setq c-default-style "epitech") - -(provide 'init) diff --git a/.profile b/.profile @@ -1,58 +0,0 @@ -export NAME="Josuah Demangeon" -export TZ="Europe/Paris" -export NICK="josuah" -export EMAIL="mail@josuah.net" -export MAILTO="$EMAIL" - -export ENV="$HOME/.profile" - -export EDITOR="edit" -export VISUAL="edit" -export PAGER="less" - -export LANG="en_US.UTF-8" -export 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 PACK="$HOME/etc/pack" -export PACKROOT="$HOME/.local" -export LD_LIBRARY_PATH="$PACKROOT/lib" - -export PLAN9="$HOME/.local/src/plan9" - -export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/sbin" -export PATH="$PATH:/usr/X11R6/bin" -export PATH="$HOME/etc/bin:$PACKROOT/bin:$PATH:$PLAN9/bin" - -export MANPATH="$HOME/etc/man:/usr/share/man:/usr/local/share/man:$PLAN9/man" -export MANPATH="$PACKROOT/share/man:$MANPATH" - -export ABDUCO_CMD="dvtm-status" -export ABDUCO_SOCKET_DIR="/tmp" - -export BLIH="josuah.demangeon@epitech.eu" - -export CVSROOT="anoncvs@anoncvs.fr.openbsd.org:/cvs" - -export LESS="-R~X" -export LESSHISTFILE="-" - -export MBLAZE="$HOME/.config/mblaze" - -export TWT_CONF="$HOME/.config/twt" -export TWT_PATH="$HOME/var/twt" -export TWT_FEED="$HOME/srv/twt/josuah" - -export SSH_AUTH_SOCK="/tmp/ssh-agent" - -export SVDIR="$HOME/run" - -export TERM="screen" -export PS1='$([ $? -gt 0 ] && printf "\033[31;1mx\033[m\\n\\r")'"$( - [ "$(whoami)" = "root" ] && s='#' || s='$' - printf '\033]0;%s\a\n%s%s ' '$PWD' "$(uname -n)" "$s" -)" diff --git a/.tmux.conf b/.tmux.conf @@ -1,62 +0,0 @@ -set -g prefix C-Space -unbind C-b -bind C-Space send-key C-Space - -bind -n PPage if -F '#{alternate_on}' 'send PPage' 'copy -e; send PPage' - -bind -r k select-pane -U -bind -r j select-pane -D -bind -r h select-pane -L -bind -r l select-pane -R -bind -r o select-pane -t :.+ -bind -r C-k resize-pane -U 2 -bind -r C-j resize-pane -D 2 -bind -r C-h resize-pane -L 5 -bind -r C-l resize-pane -R 5 - -bind -r < swap-window -t - -bind -r > swap-window -t + -bind -r p previous-window -bind -r n next-window -bind -r Tab last-window -bind -r c new-window -bind -r C new-window -c '#{pane_current_path}' - -bind -n C-z detach -bind r source ~/.tmux.conf\; display "Config loaded" - -set -g base-index 1 -set -g pane-base-index 1 -set -g renumber-windows on -set -g display-time 2000 -set -g repeat-time 500 -set -g detach-on-destroy off -set -g message-style bold,fg=red -set -g message-command-style bold,fg=white - -set -g display-panes-colour white -set -g display-panes-active-colour red - -set -g clock-mode-colour white -set -g clock-mode-style 24 - -set -g mode-style bg=white,fg=black - -set -g status-interval 5 -set -g status-position top -set -g status-justify left -set -g status-style bg=black,fg=white -set -g status-left-length 30 -set -g status-left-style fg=white -set -g status-left "#[fg=black,bg=white] #S #[default] " -set -g status-right-length 100 -set -g status-right-style fg=white -set -g status-right "#(status)" - -set -g window-status-separator " " -set -g window-status-style bold,fg=black -set -g window-status-format " #I #W " -set -g window-status-current-style bold,fg=white -set -g window-status-current-format " #I #W " -set -g window-status-bell-style fg=white,bg=red -set -g window-status-activity-style fg=white,bg=yellow diff --git a/bin/back b/bin/back @@ -1,70 +0,0 @@ -#!/bin/sh -e - -# store a directory tree in compressed and hash-indexed backups - -# A b2sum hash of every file in current directory is calculated and every file -# is copied to a $BACK/0/obj/ directory with the hash as its name. - -BACK="${BACK:-$HOME/back}" - -mkdir -p "$BACK/0/rev" "$BACK/0/obj" -sum='b2sum -l 256' -[ -r "$BACK/log" ] && -rev="$BACK/0/rev/$(sed -n '$ s/[^ ]* // p' "$BACK/log")" - -case "$1" in -(up) - [ -e "$BACK/0/new" ] && exit 1 - - # Find all files in current directory. If newer than the latest - # revision, calculate their hash, otherwise, lookup their hash in - # the latest revision. For every file if they were not in the - # $BACK/0/obj directory already, copy them as a compressed file. - - find . -type f '(' \ - -exec test "$rev" -nt {} ';' \ - -exec grep -F {} "$rev" ';' -o \ - -exec $sum {} + \ - ')'| - tee "$BACK/0/new" | - while read -r hash path - do - [ -f "$BACK/0/obj/$hash.lz4" ] || - lz4 -vq "$path" "$BACK/0/obj/$hash.lz4" - done - - sort "$BACK/0/new" -o "$BACK/0/new" - rev="$($sum "$BACK/0/new" | sed 's/ .*//')" - mv "$BACK/0/new" "$BACK/0/rev/$rev" - date +"%Y-%m-%d-%H-%M-%S $rev" >> $BACK/log - ;; -(to) - more "$BACK/0/rev/$2" - printf 'apply %s? [Y/n] ' "$2" 1>&2 - case "$(sed q)" in (y|Y|'') ;; (*) exit 0 ;; esac - - rm -fr * .* - - while read -r hash path - do - mkdir -p "$(dirname "$path")" - lz4 -q "$BACK/0/obj/$hash.lz4" "$path" - done < "$BACK/0/rev/$2" - ;; -(log) - less "$BACK/log" - ;; -(rsync) - rsync --size-only -vr "$2/" "$BACK/0/" - rsync --size-only -vr "$BACK/0/" "$2/" - ;; -(*) - echo 'usage: back up' - echo ' back to <rev>' - echo ' back log' - echo ' back rsync <remote>' - exit 1 - ;; -esac - -find "$BACK/0/obj" -type f -exec chmod -w {} + diff --git a/bin/blih-openssl b/bin/blih-openssl @@ -1,33 +0,0 @@ -#!/bin/sh -# bocal lightweight interface for human client - -usr="$BLIH" -host='blih.epitech.eu' - -printf 'password: ' 1>&2 -stty -echo -IFS='' read -r pwd -stty echo -printf '\n' - -tok="$(printf %s "$pwd" | openssl dgst -sha512 | cut -d ' ' -f 2)" -sig="$(printf %s "$usr" | openssl dgst -sha512 -hmac "$tok" | - cut -d ' ' -f 2)" -data="{\"user\": \"$usr\", \"signature\": \"$sig\"}" -method='GET' -request="$1" - -openssl s_client -connect "$host:443" -quiet 2> /dev/null \ - << EOF | sed '1,/^.$/d' -$method //$request HTTP/1.1 -Accept-Encoding: identity -Content-Length: $#data -Host: $host -Content-Type: application/json -User-Agent: blih-1.7 -Connection: close - -$data -EOF - -printf '\n' diff --git a/bin/git-mirror b/bin/git-mirror @@ -1,6 +0,0 @@ -#!/bin/sh -e - -mkdir -p "$HOME/var/git" -cd "$HOME/var/git" - -xargs -n 1 git clone --bare "$repo" < "$HOME/.config/git/repos" diff --git a/bin/markup b/bin/markup diff --git a/bin/markup-gopher b/bin/markup-gopher @@ -0,0 +1 @@ +#!/usr/bin/awk -f diff --git a/bin/markup-html b/bin/markup-html @@ -0,0 +1 @@ +#!/usr/bin/awk -f diff --git a/bin/random b/bin/random @@ -1,6 +0,0 @@ -#!/bin/sh -e - -dd status=none if=/dev/urandom bs=1 | - od -dA n | - tr -cd 0-9 | - fold -w "$1" diff --git a/bin/term b/bin/term @@ -1,16 +0,0 @@ -#!/bin/sh - -case "$1" in -(inv) - printf '\033[?5h' - ;; -(norm) - printf '\033[?5l' - ;; -(name) - shift - printf '\033]0;%s\a' "$*" - ;; -(*) - echo 'usage: term norm | inv | name <name>' -esac diff --git a/bin/tls b/bin/tls @@ -1,16 +0,0 @@ -#!/bin/sh -e - -prefix="/var/tls/$1" - -[ "$#" -eq 1 ] || exec echo 'usage: tls <name>' - -mkdir -p "$(dirname "$prefix")" -set -x - -openssl req -x509 -newkey rsa:4096 -days 365 \ - -keyout "$prefix.key" -out "$prefix.pem" -chmod 400 "$prefix.key" -chmod 444 "$prefix.pem" - -openssl dhparam -out "$prefix.dhp" 4096 -chmod 444 "$prefix.dhp" diff --git a/bin/update-sfeed b/bin/update-sfeed @@ -22,4 +22,4 @@ do # deliver using mblaze(7) sfeed_mbox "$file" | mdeliver -M "$HOME/var/mail/sfeed/$name" -done < "$HOME/.config/sfeed" +done < "$HOME/etc/sfeed" diff --git a/bin/wifi b/bin/wifi @@ -1,12 +0,0 @@ -#!/bin/sh - -[ "$#" -ne 2 ] && exec printf 'usage: wifi <nwid> <wpa_passphrase>\n' - -case "$(uname)" in -(*BSD) - doas ifconfig iwm0 nwid "$1" wpa wpakey "$2" - ;; -(*) - echo 'unsupported system' - ;; -esac diff --git a/bin/www b/bin/www @@ -1,87 +0,0 @@ -#!/bin/sh - -# static website generator for one particular website - -cd "$(dirname "$0")" - -export LAYOUT="$(cat layout.html)" || exit 1 -export ROOT="$PWD" - -parse() -{ #1 content of the layout to parse - - # print the input up to the next keyword, and shift position in input - printf %s "${1%%<%*}" - - # check for remaining keywords - [ "${1##*<%*}" ] && return 0 - - # take the separator out of the keyword - set -- "${1#*<%}" - - # execute the keyword action and print its output - case "${1%%%>*}" in - (*content*) printf %s "$(sed 1d index.txt)" ;; - (*gallery*) printf %s "$(gallery)" ;; - (*cover* ) printf %s "$(cover)" ;; - (*title*) printf %s "$(sed 1q index.txt)" ;; - (*root*) printf %s "$(root)" ;; - (*nav*) printf %s "$(nav)" ;; - (*sitemap*) printf %s "$(sitemap)" ;; - esac - - parse "${1#*%>}" -} - -gallery() -{ - ls -d *.[jJ][pP][gG] \ - *.[jJ][pP][eE][gG] \ - *.[pP][nN][gG] \ - 2>/dev/null | while IFS='' read -r img - do - printf '<a class="gallery" href="%s">\n' "$img" - printf '\t<img src="%s"></img>\n' "$img" - printf '</a>\n' - done -} - -root() -{ - printf '%s\n' "${PWD#$ROOT}" | - sed 's|[^/]||g; s|.|../|g; s|/$||; s|^$|.|' -} - -nav() -{ - ls -d */*/index.txt | while IFS='' read -r index - do - cat << EOF -<a class="nav" href="${index%.txt}.html"> - <span>$(sed q "$index")</span> - <img src="$( - ls -d "${index%/*}"/*.[jJ][pP][gG] \ - "${index%/*}"/*.[jJ][pP][eE][gG] \ - "${index%/*}"/*.[pP][nN][gG] \ - 2>/dev/null | sed q - )"></img> -</a> -EOF - done -} - -sitemap() -{ - tree=${PWD#$ROOT} root=$(root) sep='' - - while [ "$tree" ] - do - tree="${tree%/*}" - printf '<a href="%s%s/index.html">%s</a>%s\n' \ - "$root" "$tree" "$(sed q "$root/$tree/index.txt")" "$sep" - sep=' >' - done -} - -find . -name 'index.txt' \ - -exec sh 'cd "$0/.." && parse "$LAYOUT" > index.html' {} \; diff --git a/configure b/configure @@ -1,31 +1,28 @@ -#!/bin/sh -e +#!/bin/sh -ex -cd "${0%/*}" +cd "$(dirname "$0")" mkdir -p "$HOME/run" +mkdir -p "$HOME/var/http" +mkdir -p "$HOME/var/git" +mkdir -p "$HOME/var/gopher" +mkdir -p "$HOME/var/torrent" +mkdir -p "$HOME/var/mail" +mkdir -p "$HOME/var/iso" mkdir -p "$HOME/.config/enchive" ln -fs /mnt/key/enchive.pub "$HOME/.config/enchive/enchive.pub" ln -fs /mnt/key/enchive.sec "$HOME/.config/enchive/enchive.sec" -mkdir='mkdir -p "$0/$1";:' -symln='ln -sf "$PWD/$1" "$0/$1";:' +mkdir -p "$HOME/.ssh" +cp "$PWD/ssh/authorized_keys" "$HOME/.ssh/authorized_keys" +ln -fs "$PWD/ssh/config "$HOME/.ssh/config" -# symlink ./* into ~/.config/* -find * \ - -path './README' -prune -o \ - -path './configure' -prune -o \ - -path './man/*' -prune -o \ - -path './runit/*' -prune -o \ - -type d -exec sh -c "$mkdir" "$HOME/.config" {} \; -o \ - -type f -exec sh -c "$symln" "$HOME/.config" {} \; - -# symlink dotfiles into ~/.* -find .[!.]* \ - -name '.git' -prune -o \ - -type d -exec sh -c "$mkdir" "$HOME" {} \; -o \ - -type f -exec sh -c "$symln" "$HOME" {} \; -o \ - -type l -exec sh -c "$symln" "$HOME" {} \; +ln -fs "$PWD/profile" "$HOME/.profile" +ln -fs "$PWD/mpoprc" "$HOME/.mpoprc" +ln -fs "$PWD/msmtprc" "$HOME/.msmtprc" +ln -fs "$PWD/xinitrc" "$HOME/.xinitrc" +ln -fs "$PWD/git" "$HOME/.config/git" mkdir -p "$HOME/var/git" (cd "$HOME/var/git" && xargs -n 1 git clone --bare) <git/repos diff --git a/skel/exports.bsd b/exports diff --git a/skel/fstab.linux b/fstab diff --git a/skel/hosts b/hosts diff --git a/man/README.7 b/man/README.7 @@ -37,7 +37,7 @@ Directory where original data are stored. .It Pa ~/var/ Sets the directory containing all .Sy generated data , -including runit, irc, mail, tox, torrent, qemu images... +including git, irc, mail, tox, torrent, qemu iso... . .It Pa ~/etc/ Source of the configuration file, symlinked into @@ -49,7 +49,7 @@ Alternate root directory where installs local packages. . .It Pa ~/.cache/ -Directory containing generated data cached for increasing performances. +Directory containing generated data cached for performances. . .It Pa ~/.config/ Local configuration directory, where software are configured to search @@ -107,7 +107,7 @@ which are symlinked to . .It Xr xdg-open 1 A general-purpose piping utility which chooses the apropriate program to open -the file passed as argument. +the string passed as argument. . .El . diff --git a/mblaze/.gitignore b/mblaze/.gitignore @@ -0,0 +1,4 @@ +* +!profile +!filter +!.gitignore diff --git a/.mpoprc b/mpoprc diff --git a/.msmtprc b/msmtprc diff --git a/pack/sfeed/build b/pack/sfeed/build @@ -4,4 +4,4 @@ cp "$PACK/sfeed/sfeed_twtxt.c" "$SRC" make MANPREFIX="$PREFIX/share/man" PREFIX="$PREFIX" install make BIN='sfeed_twtxt' -cp "$SRC/sfeed_twtxt" "$PREFIX/bin/sfeed_twtxt" +cp sfeed_twtxt "$PREFIX/bin/sfeed_twtxt" diff --git a/pack/tinc/build b/pack/tinc/build @@ -1,14 +1,12 @@ #!/bin/sh -ex ./configure \ - --prefix="$PREFIX" \ + --prefix="$PREFIX" \ --sbindir="$PREFIX/bin" \ --sysconfdir="$HOME/.config" \ - --localstatedir="$HOME/var" \ + --localstatedir="$HOME/run/tinc" \ --disable-lzo \ --disable-readline \ --disable-curses -case "$(uname)" in (*BSD) make=gmake ;; (*) make=make ;; esac - -$make install +exec "$PACK/build/make" diff --git a/profile b/profile @@ -0,0 +1,58 @@ +export NAME="Josuah Demangeon" +export TZ="Europe/Paris" +export NICK="josuah" +export EMAIL="mail@josuah.net" +export MAILTO="$EMAIL" + +export ENV="$HOME/.profile" + +export EDITOR="edit" +export VISUAL="edit" +export PAGER="less" + +export LANG="en_US.UTF-8" +export 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 PACK="$HOME/etc/pack" +export PACKROOT="$HOME/.local" +export LD_LIBRARY_PATH="$PACKROOT/lib" + +export PLAN9="$HOME/.local/src/plan9" + +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/sbin" +export PATH="$PATH:/usr/X11R6/bin" +export PATH="$HOME/etc/bin:$PACKROOT/bin:$PATH:$PLAN9/bin" + +export MANPATH="$HOME/etc/man:/usr/share/man:/usr/local/share/man:$PLAN9/man" +export MANPATH="$PACKROOT/share/man:$MANPATH" + +export ABDUCO_CMD="dvtm-status" +export ABDUCO_SOCKET_DIR="/tmp" + +export BLIH="josuah.demangeon@epitech.eu" + +export CVSROOT="anoncvs@anoncvs.fr.openbsd.org:/cvs" + +export LESS="-R~X" +export LESSHISTFILE="-" + +export MBLAZE="$HOME/etc/mblaze" + +export TWT_CONF="$HOME/etc/twt" +export TWT_PATH="$HOME/var/twt" +export TWT_FEED="$HOME/var/srv/twt/josuah" + +export SSH_AUTH_SOCK="/tmp/ssh-agent" + +export SVDIR="$HOME/run" + +export TERM="screen" +export PS1='$([ $? -gt 0 ] && printf "\033[31;1mx\033[m\\n\\r")'"$( + [ "$(whoami)" = "root" ] && s='#' || s='$' + printf '\033]0;%s\a\n%s%s ' '$PWD' "$(uname -n)" "$s" +)" diff --git a/run/tls/port b/run/brssl/port diff --git a/run/brssl/run b/run/brssl/run @@ -0,0 +1,11 @@ +#!/bin/sh -e + +# TLS proxy based off brsl + +host="$(cd "$(dirname "$0")" && pwd | sed 's:.*/brssl-::')" + +exec 2>&1 + +IFS='' read -r port <port + +exec unixserver "/tmp/$host" brssl client "$host:$port" diff --git a/collectd.conf b/run/collectd/conf diff --git a/run/collectd/run b/run/collectd/run @@ -1,4 +1,4 @@ #!/bin/sh -e exec 2>&1 -exec collectd -f -C "$HOME/.config/collectd.conf" +exec collectd -f -C conf diff --git a/run/ghttp/host b/run/ghttp/host @@ -1 +0,0 @@ -josuah.net- \ No newline at end of file diff --git a/run/ghttp/port b/run/ghttp/port @@ -1 +0,0 @@ -80- \ No newline at end of file diff --git a/run/ghttp/run b/run/ghttp/run @@ -1,8 +0,0 @@ -#!/bin/sh - -exec 2>&1 - -IFS='' read -r host <host -IFS='' read -r port <port - -exec tcpserver 0.0.0.0 "$port" ghttpd "$host" diff --git a/bin/gproxy b/run/gproxy/gproxy diff --git a/run/ii/run b/run/ii/run @@ -8,11 +8,7 @@ path="$HOME/var/irc" host="$(cd "$0/.." && pwd | sed 's:.*/ii-::')" - -mkdir -p "$path/$host" - [ -S "/tmp/$host" ] && p="u" port="/tmp/$host" || p="p" port="6667" exec 2>&1 -exec 1>> "$path/$host/log" exec ii -s "$host" -i "$path" -$p "$port" -n "$NICK"ii -k "PASS" -f "$NAME" diff --git a/run/ngircd/tls b/run/ngircd/tls @@ -0,0 +1,8 @@ +#!/bin/sh -ex + +openssl req -x509 -newkey rsa:4096 -days 365 -keyout key -out pem +chmod 400 key +chmod 444 pem + +openssl dhparam -out dhp 4096 +chmod 444 dhp diff --git a/tinc/conf.d/common.conf b/run/tinc/conf.d/common.conf diff --git a/tinc/hosts/kroa b/run/tinc/hosts/kroa diff --git a/tinc/hosts/nas b/run/tinc/hosts/nas diff --git a/tinc/hosts/pdmg b/run/tinc/hosts/pdmg diff --git a/tinc/hosts/rpi b/run/tinc/hosts/rpi diff --git a/tinc/hosts/t470s b/run/tinc/hosts/t470s diff --git a/run/tinc/run b/run/tinc/run @@ -2,7 +2,6 @@ debug="4" -mkdir -p "$HOME/var/run" - exec 2>&1 -exec tincd -D -d "$debug" +mkdir -p run +exec tincd -D -d "$debug" --config="$PWD" diff --git a/tinc/tinc-up b/run/tinc/tinc-up diff --git a/run/tls/run b/run/tls/run @@ -1,9 +0,0 @@ -#!/bin/sh -e - -host="$(cd "$(dirname "$0")" && pwd | sed 's:.*/tls-::')" - -exec 2>&1 - -IFS='' read -r port <port - -exec unixserver "/tmp/$host" brssl client "$host:$port" diff --git a/run/tor/run b/run/tor/run @@ -1,4 +1,4 @@ #!/bin/sh -e exec 2>&1 -exec tor +exec tor -f torrc diff --git a/skel/torrc b/run/tor/torrc diff --git a/services b/services @@ -0,0 +1,6 @@ +#name port/proto aliases +u9fs 564/tcp +tinc 655/tcp TINC +tinc 655/udp TINC +http-alt 8080/tcp +rsync 873/tcp diff --git a/sfeed b/sfeed @@ -5,3 +5,6 @@ xkcd.com http://xkcd.com/atom.xml research.googleblog.com http://feeds.feedburner.com/blogspot/gJZg bitreich.org gopher://bitreich.org/0/news.atom.xml swordarmor.fr https://www.swordarmor.fr/feeds/all.rss.xml +r-datahoarder https://www.reddit.com/r/datahoarder/.rss +r-homelab https://www.reddit.com/r/homelab/.rss +r-unixporn https://www.reddit.com/r/unixporn/.rss diff --git a/skel/crontab b/skel/crontab @@ -1,13 +0,0 @@ -# min hour day month wkday command - -#*/15 * * * * mpop && mfilter -#*/15 * * * * update-agenda -#*/15 * * * * update-sfeed - -#10 6 * * * back rsync "$HOME/back/1" -#20 6 * * * back rsync "$HOME/back/2" -#30 6 * * * back rsync "$HOME/back/3" -#40 6 * * * back rsync "$HOME/back/4" -#50 6 * * * back rsync "$HOME/back/5" - -#*/15 * * * * cd "$HOME/srv" && make stat diff --git a/skel/exports.linux b/skel/exports.linux @@ -1 +0,0 @@ - diff --git a/skel/services b/skel/services @@ -1,10 +0,0 @@ -#name port/proto aliases - -#u9fs 564/tcp - -#tinc 655/tcp TINC -#tinc 655/udp TINC - -#http-alt 8080/tcp - -#rsync 873/tcp diff --git a/.ssh/authorized_keys b/ssh/authorized_keys diff --git a/.ssh/config b/ssh/config diff --git a/user/git b/user/git @@ -1,4 +0,0 @@ -#!/bin/sh - -useradd -s /bin/false -d "$HOME/srv/git" git -passwd git diff --git a/skel/wpa_supplicant.conf b/wpa_supplicant.conf diff --git a/.xinitrc b/xinitrc