dot

packages and services management
Log | Files | Refs | README

commit 4f32affab7ca387e91b699b3286e61955d0ac49e
parent e31f94b80a5a83f2945e33638d4725789202afc7
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 25 Aug 2017 00:55:16 +0200

[BROKEN] converting to a port tree

Diffstat:
DREADME | 29-----------------------------
DREADME.md | 83-------------------------------------------------------------------------------
Dalsa/.asoundrc | 10----------
Renchive/build -> archive/enchive/build | 0
Renchive/tar -> archive/enchive/tar | 0
Rliblzma/tar -> archive/liblzma/tar | 0
Aarchive/libz/build.sh | 13+++++++++++++
Aarchive/libz/lastversion.sh | 2++
Aarchive/libz/source.sh | 2++
Rlibz/tar -> archive/libz/tar | 0
Aarchive/libz/version | 1+
Datreus/build | 1-
Datreus/layout.h | 24------------------------
Datreus/tar | 1-
Dbmake/tar | 1-
Dbuild | 4----
Dcalendar/bin/calendar-import | 47-----------------------------------------------
Dcalendar/bin/calendar-show | 31-------------------------------
Dcalendar/bin/calendar-update | 4----
Rgit/bin/git-all -> devel/git/bin/git-all | 0
Rgit/bin/git-count -> devel/git/bin/git-count | 0
Rgit/bin/git-index -> devel/git/bin/git-index | 0
Rgit/bin/git-status -> devel/git/bin/git-status | 0
Rgit/bin/git-sync -> devel/git/bin/git-sync | 0
Rgit/cron -> devel/git/cron | 0
Rgit/git-index.1 -> devel/git/git-index.1 | 0
Rgit/run -> devel/git/run | 0
Rgit/tar -> devel/git/tar | 0
Rgit/user -> devel/git/user | 0
Rlibtool/tar -> devel/libtool/tar | 0
Rm4/tar -> devel/m4/tar | 0
Rlex/build -> devel/reflex/build | 0
Rlex/tar -> devel/reflex/tar | 0
Adevel/yacc/tar | 1+
Adevel/yasm/tar | 1+
Red/build -> editor/ed/build | 0
Red/git -> editor/ed/git | 0
Rired/tar -> editor/ired/tar | 0
Rkakoune/build -> editor/kakoune/build | 0
Rkakoune/git -> editor/kakoune/git | 0
Rnafe/build -> editor/nafe/build | 0
Rnafe/tar -> editor/nafe/tar | 0
Demacs/.emacs | 293-------------------------------------------------------------------------------
Dgit/.gitconfig | 9---------
Dlinux-headers | 2--
Rdma/build -> mail/dma/build | 0
Rdma/dma.conf -> mail/dma/dma.conf | 0
Rdma/tar -> mail/dma/tar | 0
Rmblaze/bin/mblaze-filter -> mail/mblaze/bin/mblaze-filter | 0
Rmblaze/build -> mail/mblaze/build | 0
Rmblaze/tar -> mail/mblaze/tar | 0
Rmbsync/build -> mail/mbsync/build | 0
Rmbsync/tar -> mail/mbsync/tar | 0
Rmpop/build -> mail/mpop/build | 0
Rmpop/tar -> mail/mpop/tar | 0
Rmsmtp/build -> mail/msmtp/build | 0
Rmsmtp/tar -> mail/msmtp/tar | 0
Rpopa3d/inetd -> mail/popa3d/inetd | 0
Rpopa3d/tar -> mail/popa3d/tar | 0
Rman-freebsd/tar -> man/freebsd/tar | 0
Rman-linux/tar -> man/linux/tar | 0
Rman-openbsd/tar -> man/openbsd/tar | 0
Rman-plan9/tar -> man/plan9/tar | 0
Rman-posix/build -> man/posix/build | 0
Rman-posix/tar -> man/posix/tar | 0
Dmblaze/.mblaze/profile | 2--
Dmbsync/.mbsyncrc | 19-------------------
Rffmpeg/tar -> media/ffmpeg/tar | 0
Rlibopus/build -> media/libopus/build | 0
Rlibopus/tar -> media/libopus/tar | 0
Rlibvpx/build -> media/libvpx/build | 0
Rlibvpx/tar -> media/libvpx/tar | 0
Amk/package.mk | 36++++++++++++++++++++++++++++++++++++
Dmpop/.mpoprc | 0
Dmsmtp/.msmtprc | 10----------
Rcgo/build -> net/cgo/build | 0
Rcgo/tar -> net/cgo/tar | 0
Rgeomyidae/tar -> net/geomyidae/tar | 0
Rii/bin/ii-client -> net/ii/bin/ii-client | 0
Rii/bin/ii-filter -> net/ii/bin/ii-filter | 0
Rii/bin/no -> net/ii/bin/no | 0
Rii/run -> net/ii/run | 0
Rii/tar -> net/ii/tar | 0
Rlibowfat/tar -> net/libowfat/tar | 0
Rlibtox/build -> net/libtox/build | 0
Rlibtox/tar -> net/libtox/tar | 0
Rngircd/build -> net/ngircd/build | 0
Rngircd/crash -> net/ngircd/crash | 0
Rngircd/ngircd.conf -> net/ngircd/ngircd.conf | 0
Rngircd/ngircd.motd -> net/ngircd/ngircd.motd | 0
Rngircd/run -> net/ngircd/run | 0
Rngircd/tar -> net/ngircd/tar | 0
Ropenssh/build.sh -> net/openssh/build.sh | 0
Ropenssh/lastversion.sh -> net/openssh/lastversion.sh | 0
Ropenssh/openssh-sys_param.patch -> net/openssh/openssh-sys_param.patch | 0
Ropenssh/patch.sh -> net/openssh/patch.sh | 0
Ropenssh/source.sh -> net/openssh/source.sh | 0
Ropenssh/version -> net/openssh/version | 0
Ropentracker/build -> net/opentracker/build | 0
Ropentracker/git -> net/opentracker/git | 0
Ropentracker/run -> net/opentracker/run | 0
Rquark/config.h -> net/quark/config.h | 0
Rquark/configure -> net/quark/configure | 0
Rquark/git -> net/quark/git | 0
Rquark/run -> net/quark/run | 0
Rratox/config.mk -> net/ratox/config.mk | 0
Rratox/git -> net/ratox/git | 0
Rratox/run -> net/ratox/run | 0
Rratox/tar -> net/ratox/tar | 0
Rretawq/build -> net/retawq/build | 0
Rretawq/tar -> net/retawq/tar | 0
Rrsync/build.sh -> net/rsync/build.sh | 0
Rrsync/lastversion.sh -> net/rsync/lastversion.sh | 0
Rrsync/patch.sh -> net/rsync/patch.sh | 0
Rrsync/rsync-fix-proto.h-tstamp-target.patch -> net/rsync/rsync-fix-proto.h-tstamp-target.patch | 0
Rrsync/source.sh -> net/rsync/source.sh | 0
Rrsync/version -> net/rsync/version | 0
Anet/tcpdump/tar | 1+
Anet/unbound/tar | 1+
Dpackage.mk | 43-------------------------------------------
Dpkg/bin/pkg-build | 11-----------
Dpkg/bin/pkg-configure | 35-----------------------------------
Dpkg/bin/pkg-git | 3---
Dpkg/bin/pkg-install | 9---------
Dpkg/bin/pkg-remove | 4----
Dpkg/bin/pkg-service | 75---------------------------------------------------------------------------
Dpkg/bin/pkg-tar | 12------------
Dpkg/cron | 1-
Drc | 15---------------
Rlibbearssl/bin/bot -> security/libbearssl/bin/bot | 0
Rlibbearssl/build -> security/libbearssl/build | 0
Rlibbearssl/run -> security/libbearssl/run | 0
Rlibbearssl/tar -> security/libbearssl/tar | 0
Rlibressl/build.sh -> security/libressl/build.sh | 0
Rbusybox/deps -> security/libressl/deps | 0
Rlibressl/lastversion.sh -> security/libressl/lastversion.sh | 0
Rlibressl/source.sh -> security/libressl/source.sh | 0
Rlibressl/tar -> security/libressl/tar | 0
Rlibressl/version -> security/libressl/version | 0
Rlibsodium/tar -> security/libsodium/tar | 0
Asecurity/stunnel/build | 3+++
Asecurity/stunnel/stunnel.conf | 11+++++++++++
Asecurity/stunnel/tar | 1+
Dsetup.sh | 45---------------------------------------------
Dshell/.bashrc | 2--
Dshell/.mkshrc | 2--
Dshell/.profile | 1-
Dshell/.zshrc | 2--
Dshell/bin/80 | 13-------------
Dshell/bin/adagio | 237-------------------------------------------------------------------------------
Dshell/bin/color | 5-----
Dshell/bin/dns-used-tld | 41-----------------------------------------
Dshell/bin/doc-rfc | 5-----
Dshell/bin/doc-wiki | 49-------------------------------------------------
Dshell/bin/extract | 16----------------
Dshell/bin/fig | 30------------------------------
Dshell/bin/fig-blawk | 61-------------------------------------------------------------
Dshell/bin/fig-drawk | 56--------------------------------------------------------
Dshell/bin/fig-fullwidth | 10----------
Dshell/bin/fig-mirror | 1-
Dshell/bin/fig-reverse | 19-------------------
Dshell/bin/fmt | 1-
Dshell/bin/fun-dna | 105-------------------------------------------------------------------------------
Dshell/bin/fun-dump | 16----------------
Dshell/bin/fun-piano | 138-------------------------------------------------------------------------------
Dshell/bin/fun-psyche | 420-------------------------------------------------------------------------------
Dshell/bin/fun-saber | 171-------------------------------------------------------------------------------
Dshell/bin/fun-troll | 20--------------------
Dshell/bin/fun-type | 11-----------
Dshell/bin/http-ix | 1-
Dshell/bin/http-myip | 1-
Dshell/bin/http-w1r3 | 1-
Dshell/bin/http-wttr | 1-
Dshell/bin/ipconv | 32--------------------------------
Dshell/bin/l | 8--------
Dshell/bin/lines | 1-
Dshell/bin/madown | 118-------------------------------------------------------------------------------
Dshell/bin/pgrep | 3---
Dshell/bin/phaste | 42------------------------------------------
Dshell/bin/printree | 37-------------------------------------
Dshell/bin/sane-name | 10----------
Dshell/bin/screen-brightness | 1-
Dshell/bin/screen-cast | 7-------
Dshell/bin/screen-rotate | 15---------------
Dshell/bin/term-inv | 1-
Dshell/bin/term-name | 1-
Dshell/bin/tty-theme | 372-------------------------------------------------------------------------------
Dshell/bin/tty-video | 7-------
Dshell/bin/txt | 93-------------------------------------------------------------------------------
Dshell/bin/txt-html | 69---------------------------------------------------------------------
Dshell/bin/uri | 36------------------------------------
Dshell/bin/version | 145-------------------------------------------------------------------------------
Dshell/bin/www | 61-------------------------------------------------------------
Dshell/bin/x-www-browser | 1-
Dssh/.ssh/config | 8--------
Dst/build | 5-----
Dst/config.mk | 26--------------------------
Dst/st-scrollback-0.7.diff | 387-------------------------------------------------------------------------------
Dst/tar | 1-
Dstunnel/build | 3---
Dstunnel/stunnel.conf | 11-----------
Dstunnel/tar | 1-
Dsyslinux/build.sh | 13-------------
Dsyslinux/lastversion.sh | 2--
Dsyslinux/patch.sh | 55-------------------------------------------------------
Dsyslinux/source.sh | 2--
Dsyslinux/version | 1-
Rbusybox/build -> system/busybox/build | 0
Rbusybox/build.sh -> system/busybox/build.sh | 0
Re2fsprogs/deps -> system/busybox/deps | 0
Rbusybox/kconfig.default -> system/busybox/kconfig.default | 0
Rbusybox/lastversion.sh -> system/busybox/lastversion.sh | 0
Rbusybox/patch.sh -> system/busybox/patch.sh | 0
Rbusybox/source.sh -> system/busybox/source.sh | 0
Rbusybox/tar -> system/busybox/tar | 0
Rbusybox/version -> system/busybox/version | 0
Re2fsprogs/build.sh -> system/e2fsprogs/build.sh | 0
Rlibressl/deps -> system/e2fsprogs/deps | 0
Re2fsprogs/lastversion.sh -> system/e2fsprogs/lastversion.sh | 0
Re2fsprogs/patch.sh -> system/e2fsprogs/patch.sh | 0
Re2fsprogs/source.sh -> system/e2fsprogs/source.sh | 0
Re2fsprogs/version -> system/e2fsprogs/version | 0
Rlibixp/tar -> system/libixp/tar | 0
Asystem/linux-headers | 2++
Rlinux/build.sh -> system/linux/build.sh | 0
Rlinux/crusoe-nopl-emu.patch -> system/linux/crusoe-nopl-emu.patch | 0
Rlinux/kconfig.sabotage -> system/linux/kconfig.sabotage | 0
Rlinux/lastversion.sh -> system/linux/lastversion.sh | 0
Rlinux/patch.sh -> system/linux/patch.sh | 0
Rlinux/source.sh -> system/linux/source.sh | 0
Rlinux/version -> system/linux/version | 0
Rmonitor/bin/monitor -> system/monitor/bin/monitor | 0
Rmonitor/bin/monitor-plot -> system/monitor/bin/monitor-plot | 0
Rmonitor/bin/monitor-send -> system/monitor/bin/monitor-send | 0
Rmonitor/bin/monitor-step -> system/monitor/bin/monitor-step | 0
Rmonitor/bin/plot -> system/monitor/bin/plot | 0
Rmonitor/cron -> system/monitor/cron | 0
Rmonitor/run -> system/monitor/run | 0
Rmusl/build.sh -> system/musl/build.sh | 0
Rmusl/deps -> system/musl/deps | 0
Rmusl/lastversion.sh -> system/musl/lastversion.sh | 0
Rlibc/tar -> system/musl/libmusll/tar | 0
Rmusl/source.sh -> system/musl/source.sh | 0
Rmusl/version -> system/musl/version | 0
Rnewsyslog/tar -> system/newsyslog/tar | 0
Rsbase/git -> system/sbase/git | 0
Rscron/crash -> system/scron/crash | 0
Rscron/git -> system/scron/git | 0
Rscron/run -> system/scron/run | 0
Rscron/tar -> system/scron/tar | 0
Asystem/syslinux/build.sh | 13+++++++++++++
Asystem/syslinux/lastversion.sh | 2++
Asystem/syslinux/patch.sh | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asystem/syslinux/source.sh | 2++
Asystem/syslinux/version | 1+
Asystem/tonic-init/build.sh | 9+++++++++
Asystem/tonic-init/init.c | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asystem/tonic-init/linuxrc | 42++++++++++++++++++++++++++++++++++++++++++
Asystem/tonic-init/rc.init | 42++++++++++++++++++++++++++++++++++++++++++
Asystem/tonic-init/rc.shutdown | 22++++++++++++++++++++++
Dtcpdump/tar | 1-
Riomenu/bin/io -> text/iomenu/bin/io | 0
Riomenu/bin/io-agenda -> text/iomenu/bin/io-agenda | 0
Riomenu/bin/io-cache -> text/iomenu/bin/io-cache | 0
Riomenu/bin/io-jobs -> text/iomenu/bin/io-jobs | 0
Riomenu/bin/io-mail -> text/iomenu/bin/io-mail | 0
Riomenu/bin/io-music -> text/iomenu/bin/io-music | 0
Riomenu/bin/io-ps -> text/iomenu/bin/io-ps | 0
Riomenu/bin/io-search -> text/iomenu/bin/io-search | 0
Riomenu/bin/io-unicode -> text/iomenu/bin/io-unicode | 0
Riomenu/man/io.1 -> text/iomenu/man/io.1 | 0
Riomenu/tar -> text/iomenu/tar | 0
Rjq/tar -> text/jq/tar | 0
Rmandoc/build -> text/mandoc/build | 0
Rmandoc/tar -> text/mandoc/tar | 0
Rmupdf/build -> text/mupdf/build | 0
Rmupdf/tar -> text/mupdf/tar | 0
Dtonic-init/build.sh | 9---------
Dtonic-init/init.c | 83-------------------------------------------------------------------------------
Dtonic-init/linuxrc | 42------------------------------------------
Dtonic-init/rc.init | 42------------------------------------------
Dtonic-init/rc.shutdown | 22----------------------
Dunbound/tar | 1-
Rabduco/tar -> utils/abduco/tar | 0
Autils/ag/tar | 1+
Autils/entr/tar | 1+
Rless/profile -> utils/less/profile | 0
Rless/tar -> utils/less/tar | 0
Autils/wendy/tar | 1+
Dvim/.vimrc | 16----------------
Dwendy/tar | 1-
Dx11/.xinitrc | 11-----------
Rdmenu/build -> x11/dmenu/build | 0
Rdmenu/tar -> x11/dmenu/tar | 0
Rdwm/config.h -> x11/dwm/config.h | 0
Rdwm/config.mk -> x11/dwm/config.mk | 0
Rdwm/tar -> x11/dwm/tar | 0
Rsent/tar -> x11/sent/tar | 0
Ax11/st/build | 5+++++
Ax11/st/config.mk | 26++++++++++++++++++++++++++
Ax11/st/st-scrollback-0.7.diff | 387+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ax11/st/tar | 1+
Ax11/xdg/profile | 17+++++++++++++++++
Dxdg/profile | 17-----------------
Dyacc/tar | 1-
Dyasm/tar | 1-
Dzlib/build.sh | 13-------------
Dzlib/lastversion.sh | 2--
Dzlib/source.sh | 2--
Dzlib/version | 1-
310 files changed, 785 insertions(+), 4099 deletions(-)

diff --git a/README b/README @@ -1,29 +0,0 @@ -= pkg ========================================================================== - -This is a set of package management scripts, associated dotfiles and -scripts and a service management to get a whole software downloaded, -compiled, installed, configured and running. - -It is really unstable (I change stuff all of the time), and undocumented -(as it changes all of the time...). - -To try it: clone it in "$HOME": - - cd $HOME - git clone http://github.com/josuah/pkg - . "$HOME/pkg/rc" # this sets PATH - -Then: - - pkg-configure <package> # to link the dotfiles - pkg-tar <package> # to download a package in ~/src - pkg-build <package> # to compile it in ~/opt - pkg-install <package> # to symlink it to ~/{bin,lib,etc,...} - -And you are ready to use the program. If it is a service (package with -a start script), you can also stat it: - - pkg-service start <package> - pkg-service status <package> - pkg-service restart <package> - pkg-service stop <package> diff --git a/README.md b/README.md @@ -1,83 +0,0 @@ -# Cyberia recipe collection - -This is a collection of recipe definitions for compiling a tiny linux system -from scratch. Each package has its own directory with a number of files with -each of their respective functions. The recipes are targeted to not be -dependent on a specific build system. This means that recipes are not allowed -to contain references to a specific build system, and that the recipe's -interface must not be too complex so it's possible for interested users to -write their own package manager. - -## Contents of the recipe directory - -Having a `build.sh` is the minimum for a recipe to be able to build. In -practice, you also want a `source.sh` to define which tarballs to use. Shell -script should have the executable flag and a proper shebang line set. - -### version - -Text file with the current version string of the software. - -### source.sh - -A shellscript that outputs a list of urls where the corresponding tarball is -located. Should use the value of the `version` file. - -### patch.sh - -This script is run using the freshly extracted tarball as working directory. -Use this to make changes to the sourcecode, like patches or `sed` commands. If -you need to reference contents from the recipe directory here, use the -`$PKGDIR` enviroment variable. - -### build.sh - -After being extracted and optionally patched, this script is run in the same -environment like `patch.sh`. Its goal is to trigger the compilation process of -the sourcecode and copy the results to `$DESTDIR`. Special care has to be taken -that variables like `$PREFIX` or `$CC` are passed properly to `make` -invocations or comparable facilities. - -## Environment variables - -### $PKGDIR - -The directory of the recipe. This is typicaly used to load patchfiles from the -recipe directory. - -### $PGKNAME - -The name of the package. This is currently only used for the linux-headers -package which itself is a symlink to the linux package. The `build.sh` script -from the linux recipe has different behavior when invoked via `linux-headers` - -### $SYSROOT - -Path to the root directory of the target systems. Recipes MUST NEVER use this -variable to write data or build results. Recipes use this variable to determine -the location of the `include/` and `lib/` directories. This path is absolute to -the host systems root for cross-compiling and empty/unset for self-managing -setups. - -### $PREFIX - -Directory prefix for the compiled program. This is set to "/usr" for many -programs on some distributions. We usually leave it empty/unset. Another -usecase for this variable is for per-user compiles. A typical value for that -usecase would be `PREFIX="$HOME/.local"` - -### $DESTDIR - -Directory where the build results must be stored. `$DESTDIR` is to be seen as -the targets root directory, but might be set to different values by the build -system. If an recipe produces an `/bin/mksh` binary, the `$PREFIX` variable is -set to "/usr" and `$DESTDIR` is defined as "/tmp/target", the final location of -the binary would be "/tmp/target/usr/bin/mksh". - -### $CC, $CFLAGS, $LDFLAGS, $MAKEFLAGS, $CONFFLAGS - -Globally-defined values for the tools required to build the source. The -architecture of the target system will be derived from the `$CC` variable. -`$MAKEFLAGS` will typically contain the -j variable for build parallelisation. -Recipes need to extend those variables so that the compiled sourcecode respects -the `$SYSROOT` variable. diff --git a/alsa/.asoundrc b/alsa/.asoundrc @@ -1,10 +0,0 @@ -pcm.!default { - type hw - card 1 - device 0 -} - -ctl.!default { - type hw - card 1 -} diff --git a/enchive/build b/archive/enchive/build diff --git a/enchive/tar b/archive/enchive/tar diff --git a/liblzma/tar b/archive/liblzma/tar diff --git a/archive/libz/build.sh b/archive/libz/build.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -e + +export LDFLAGS="$LDFLAGS -Wl,-rpath-link=$SYSROOT$PREFIX/lib" +export CC="$CC -L$SYSROOT/lib -isystem $SYSROOT/include" +export CPPFLAGS="-D_GNU_SOURCE" + +./configure $CONFFLAGS \ + --prefix="$PREFIX" + +make $MAKEFLAGS +make $MAKEFLAGS DESTDIR="$DESTDIR" install + diff --git a/archive/libz/lastversion.sh b/archive/libz/lastversion.sh @@ -0,0 +1,2 @@ +#!/bin/sh +curl -s "http://zlib.net/"|grep -oE 'zlib-[0-9\.]*[0-9]'|cut '-d-' -f2|sort -Vu|tail -n 1 diff --git a/archive/libz/source.sh b/archive/libz/source.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo "http://zlib.net/zlib-$VERSION.tar.xz" diff --git a/libz/tar b/archive/libz/tar diff --git a/archive/libz/version b/archive/libz/version @@ -0,0 +1 @@ +1.2.11 diff --git a/atreus/build b/atreus/build @@ -1 +0,0 @@ -cp -f ~/.config/atreus/layout.h layout.h diff --git a/atreus/layout.h b/atreus/layout.h @@ -1,24 +0,0 @@ -int layer0[44] = { - KEY_Q, KEY_W, KEY_E, KEY_R, KEY_T, 0, KEY_Y, KEY_U, KEY_I, KEY_O, KEY_P, - KEY_A, KEY_S, KEY_D, KEY_F, KEY_G, 0, KEY_H, KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, - KEY_Z, KEY_X, KEY_C, KEY_V, KEY_B, KEYBOARD_LEFT_ALT, KEY_N, KEY_M, KEY_COMMA, KEY_PERIOD, KEY_SLASH, - KEY_ESC, KEY_TAB, KEYBOARD_LEFT_GUI, KEYBOARD_LEFT_SHIFT, KEY_BACKSPACE, KEYBOARD_LEFT_CTRL, KEY_SPACE, PRE_FUNCTION(1), 0, 0, KEY_ENTER -}; - -int layer1[44] = { - KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, 0, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0, - KEY_TILDE, 0, 0, 0, 0, 0, 0, KEY_MINUS, KEY_EQUAL, KEY_LEFT_BRACE, KEY_RIGHT_BRACE, - 0, 0, 0, 0, 0, KEYBOARD_LEFT_ALT, 0, 0, 0, KEY_QUOTE, KEY_BACKSLASH, - FUNCTION(2), KEY_TAB, KEYBOARD_LEFT_GUI, KEYBOARD_LEFT_SHIFT, KEY_BACKSPACE, KEYBOARD_LEFT_CTRL, KEY_SPACE, PRE_FUNCTION(1), 0, 0, KEY_ENTER -}; - -int layer2[44] = { - KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_0, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, - KEY_F11, KEY_F12, 0, 0, 0, 0, KEY_LEFT, KEY_DOWN, KEY_UP, KEY_RIGHT, 0, - 0, 0, 0, 0, 0, KEYBOARD_LEFT_ALT, 0, 0, 0, 0, 0, - PRE_FUNCTION(1), KEY_TAB, KEYBOARD_LEFT_GUI, KEYBOARD_LEFT_SHIFT, KEY_BACKSPACE, KEYBOARD_LEFT_CTRL, KEY_SPACE, PRE_FUNCTION(1), 0, 0, FUNCTION(0) -}; - -int *layers[] = {layer0, layer1, layer2}; - -#include "layout_common.h" diff --git a/atreus/tar b/atreus/tar @@ -1 +0,0 @@ -http://github.com/technomancy/atreus-firmware/archive/master.tar.gz diff --git a/bmake/tar b/bmake/tar @@ -1 +0,0 @@ -http://www.crufty.net/ftp/pub/sjg/bmake.tar.gz diff --git a/build b/build @@ -1,4 +0,0 @@ -find "$ROOT/pkg/${PWD##*/}" -name '*.diff' -exec patch -N -p 1 -i {} ';' -find "$ROOT/pkg/${PWD##*/}" -name 'config.*' -exec cp -f {} . ';' -[ -f ./configure ] && ./configure --prefix="$PREFIX" -make && make prefix="$PREFIX" PREFIX="$PREFIX" install clean diff --git a/calendar/bin/calendar-import b/calendar/bin/calendar-import @@ -1,47 +0,0 @@ -# store an ical one line per event - -exec awk ' - -BEGIN { - FS = ":"; -} - - -{ - gsub("\015", ""); - gsub("\t", " "); -} - - -/BEGIN:VEVENT/,/END:VEVENT/ { - if (substr($0, 1, 1) != " ") { - type = $1; - vevent[type] = substr($0, \ - index($0, ":") + 1, length($0) - length($1)); - } else { - vevent[type] = vevent[type] substr($0, 2, length($0) - 1); - } -} - - -/END:VEVENT/ { - gsub(/\\n/, " ", vevent["DESCRIPTION"]); - gsub(/\\/, "", vevent["DESCRIPTION"]); - gsub(/\\/, "", vevent["LOCATION"]); - gsub(/\\/, "", vevent["SUMMARY"]); - - printf("%04d/%02d/%02d %02d:%02d - %04d/%02d/%02d %02d:%02d %s %s %s\n", - substr(vevent["DTSTART"], 1, 4), - substr(vevent["DTSTART"], 5, 2), - substr(vevent["DTSTART"], 7, 2), - substr(vevent["DTSTART"], 10, 2), - substr(vevent["DTSTART"], 12, 2), - substr(vevent["DTEND" ], 1, 4), - substr(vevent["DTEND" ], 5, 2), - substr(vevent["DTEND" ], 7, 2), - substr(vevent["DTEND" ], 10, 2), - substr(vevent["DTEND" ], 12, 2), - vevent["SUMMARY"], - vevent["LOCATION"], - vevent["DESCRIPTION"]); -}' "$@" | sort -u diff --git a/calendar/bin/calendar-show b/calendar/bin/calendar-show @@ -1,31 +0,0 @@ -# command line calendar (WIP) - -awk ' -function is_bissextile(year) -{ - return (year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0); -} - - -function days_in_month(month, year) -{ - if (month == 2) { - return 28 + is_bissextile(year); - } else if (month < 8) { - return 30 + (month % 2 == 1); - } else { - return 30 + (month % 2 == 0); - } -} - - -function to_seconds(year, month, day, hour, minute, second) -{ - for (month--; month > 0; month--) - day += days_in_month(month, year); - - for (year--; year >= 1970; year--) - day += 365 + is_bissextile(year); - - return (second + 60 * (minute + 60 * (hour + (24 * (day - 1))))); -}' diff --git a/calendar/bin/calendar-update b/calendar/bin/calendar-update @@ -1,4 +0,0 @@ -# pull calendar data from various sources - -wget -qO- 'http://planning.univ-rennes1.fr/jsp/custom/modules/plannings/cal.jsp?data=8241fc3873200214d3ba247351a161f5bd72d825015315fe5d6496b849150f14ec7f554d6ed7ba1bbad7b9bdf5b7bdb27fbb53e06bf966cea3b3f4c7cc4cd75b8af069ff1fd12df97e86aed5fc16ce3b8edd3cda7b61e593' | -calendar-import | sed 's/ (Exp.*//' > "$ROOT/var/cal/university" diff --git a/git/bin/git-all b/devel/git/bin/git-all diff --git a/git/bin/git-count b/devel/git/bin/git-count diff --git a/git/bin/git-index b/devel/git/bin/git-index diff --git a/git/bin/git-status b/devel/git/bin/git-status diff --git a/git/bin/git-sync b/devel/git/bin/git-sync diff --git a/git/cron b/devel/git/cron diff --git a/git/git-index.1 b/devel/git/git-index.1 diff --git a/git/run b/devel/git/run diff --git a/git/tar b/devel/git/tar diff --git a/git/user b/devel/git/user diff --git a/libtool/tar b/devel/libtool/tar diff --git a/m4/tar b/devel/m4/tar diff --git a/lex/build b/devel/reflex/build diff --git a/lex/tar b/devel/reflex/tar diff --git a/devel/yacc/tar b/devel/yacc/tar @@ -0,0 +1 @@ +http://invisible-island.net/datafiles/release/byacc.tar.gz diff --git a/devel/yasm/tar b/devel/yasm/tar @@ -0,0 +1 @@ +http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz diff --git a/ed/build b/editor/ed/build diff --git a/ed/git b/editor/ed/git diff --git a/ired/tar b/editor/ired/tar diff --git a/kakoune/build b/editor/kakoune/build diff --git a/kakoune/git b/editor/kakoune/git diff --git a/nafe/build b/editor/nafe/build diff --git a/nafe/tar b/editor/nafe/tar diff --git a/emacs/.emacs b/emacs/.emacs @@ -1,293 +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)) - - -; --- 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")) -(add-to-list 'default-frame-alist '(alpha 70 255)) -(set-frame-parameter (selected-frame) 'alpha '(70 255)) - - -; --- 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) - - -; ------------------------------------------------------------------------------ - -(provide 'init) diff --git a/git/.gitconfig b/git/.gitconfig @@ -1,9 +0,0 @@ -[user] - email = josuah.demangeon@gandi.net - name = Josuah Demangeon - -[alias] - graph = log --graph --date=short --format='%h %cd %cn <%ce>%d%n%s%n' --color=never --decorate --tags --branches --remotes - -[core] - editor = vim diff --git a/linux-headers b/linux-headers @@ -1 +0,0 @@ -linux- \ No newline at end of file diff --git a/dma/build b/mail/dma/build diff --git a/dma/dma.conf b/mail/dma/dma.conf diff --git a/dma/tar b/mail/dma/tar diff --git a/mblaze/bin/mblaze-filter b/mail/mblaze/bin/mblaze-filter diff --git a/mblaze/build b/mail/mblaze/build diff --git a/mblaze/tar b/mail/mblaze/tar diff --git a/mbsync/build b/mail/mbsync/build diff --git a/mbsync/tar b/mail/mbsync/tar diff --git a/mpop/build b/mail/mpop/build diff --git a/mpop/tar b/mail/mpop/tar diff --git a/msmtp/build b/mail/msmtp/build diff --git a/msmtp/tar b/mail/msmtp/tar diff --git a/popa3d/inetd b/mail/popa3d/inetd diff --git a/popa3d/tar b/mail/popa3d/tar diff --git a/man-freebsd/tar b/man/freebsd/tar diff --git a/man-linux/tar b/man/linux/tar diff --git a/man-openbsd/tar b/man/openbsd/tar diff --git a/man-plan9/tar b/man/plan9/tar diff --git a/man-posix/build b/man/posix/build diff --git a/man-posix/tar b/man/posix/tar diff --git a/mblaze/.mblaze/profile b/mblaze/.mblaze/profile @@ -1,2 +0,0 @@ -Sendmail: dma -Local-Mailbox: mail@josuah.net diff --git a/mbsync/.mbsyncrc b/mbsync/.mbsyncrc @@ -1,19 +0,0 @@ -IMAPAccount mail@josuah.net -Host mail.gandi.net -User mail@josuah.net -PassCmd "printf '\\npass: ' 1>&2; stty -echo; sed q | tr -d '\\n'; stty sane" - -IMAPStore gandi-remote -Account mail@josuah.net - -MaildirStore gandi-local -Path ~/var/mail/ -Inbox ~/var/mail/INBOX - -Channel mail@josuah.net -Master :gandi-remote: -Slave :gandi-local: -Patterns * -Create Both -Expunge Both -SyncState * diff --git a/ffmpeg/tar b/media/ffmpeg/tar diff --git a/libopus/build b/media/libopus/build diff --git a/libopus/tar b/media/libopus/tar diff --git a/libvpx/build b/media/libvpx/build diff --git a/libvpx/tar b/media/libvpx/tar diff --git a/mk/package.mk b/mk/package.mk @@ -0,0 +1,36 @@ +SRC = ${ROOT}/src/${PACKAGE} +OPT = ${ROOT}/opt/${PACKAGE} +PKG = ${ROOT}/pkg/${PACKAGE} +TMP = ${ROOT}/var/cache/pkg/${PACKAGE} +ETC = ${ROOT}/etc + +install: + cd '${OPT}' && find . -type d -exec mkdir -p '${ROOT}/{}' + + cd '${OPT}' && find . -type f -exec ln -s {} '${ROOT}/{}' + + +opt: ${OPT} +${OPT}: + mkdir -p '${OPT}/bin' '${OPT}/etc' '${OPT}/lib' '${OPT}/include' + mkdir -p '${OPT}/share/man' + +src: ${SRC} +${SRC}: + mkdir -p '${TMP}' + wget -O - '${TMP}' | case '${TAR}' in \ + (*bz2) bunzip2 -d ;; (*gz) gzip -d ;; (*xz) xz -d ;; (*tar) tee ;; \ + esac | tar -xf -C '${TMP}' && mv '${TMP}'/* '$@' + + git clone '${GIT}' '$@' + +remove: + rm -rf '${SRC}' '${OPT}' + find -L '${ROOT}' -type l -exec rm {} + + +dotfiles: + cd '${PKG}' && find . -type d -exec mkdir -p '${ROOT}/{}' + + cd '${PKG}' && find . -type f -exec ln -s {} '${ROOT}/{}' + + +crontab: + mkdir -p '${ETC}' + [ -f '${PKG}/cron' ] && tee -a '${ETC}/crontab' < '${PKG}/cron' + sort -u '${ETC}/crontab' -o '${ETC}/crontab' diff --git a/mpop/.mpoprc b/mpop/.mpoprc diff --git a/msmtp/.msmtprc b/msmtp/.msmtprc @@ -1,10 +0,0 @@ -account default -host mail.gandi.net -port 587 -from mail@josuah.net -user mail@josuah.net -auth on -tls on -tls_starttls on -tls_trust_file /etc/ssl/certs/ca-certificates.crt -logfile ~/msmtp.log diff --git a/cgo/build b/net/cgo/build diff --git a/cgo/tar b/net/cgo/tar diff --git a/geomyidae/tar b/net/geomyidae/tar diff --git a/ii/bin/ii-client b/net/ii/bin/ii-client diff --git a/ii/bin/ii-filter b/net/ii/bin/ii-filter diff --git a/ii/bin/no b/net/ii/bin/no diff --git a/ii/run b/net/ii/run diff --git a/ii/tar b/net/ii/tar diff --git a/libowfat/tar b/net/libowfat/tar diff --git a/libtox/build b/net/libtox/build diff --git a/libtox/tar b/net/libtox/tar diff --git a/ngircd/build b/net/ngircd/build diff --git a/ngircd/crash b/net/ngircd/crash diff --git a/ngircd/ngircd.conf b/net/ngircd/ngircd.conf diff --git a/ngircd/ngircd.motd b/net/ngircd/ngircd.motd diff --git a/ngircd/run b/net/ngircd/run diff --git a/ngircd/tar b/net/ngircd/tar diff --git a/openssh/build.sh b/net/openssh/build.sh diff --git a/openssh/lastversion.sh b/net/openssh/lastversion.sh diff --git a/openssh/openssh-sys_param.patch b/net/openssh/openssh-sys_param.patch diff --git a/openssh/patch.sh b/net/openssh/patch.sh diff --git a/openssh/source.sh b/net/openssh/source.sh diff --git a/openssh/version b/net/openssh/version diff --git a/opentracker/build b/net/opentracker/build diff --git a/opentracker/git b/net/opentracker/git diff --git a/opentracker/run b/net/opentracker/run diff --git a/quark/config.h b/net/quark/config.h diff --git a/quark/configure b/net/quark/configure diff --git a/quark/git b/net/quark/git diff --git a/quark/run b/net/quark/run diff --git a/ratox/config.mk b/net/ratox/config.mk diff --git a/ratox/git b/net/ratox/git diff --git a/ratox/run b/net/ratox/run diff --git a/ratox/tar b/net/ratox/tar diff --git a/retawq/build b/net/retawq/build diff --git a/retawq/tar b/net/retawq/tar diff --git a/rsync/build.sh b/net/rsync/build.sh diff --git a/rsync/lastversion.sh b/net/rsync/lastversion.sh diff --git a/rsync/patch.sh b/net/rsync/patch.sh diff --git a/rsync/rsync-fix-proto.h-tstamp-target.patch b/net/rsync/rsync-fix-proto.h-tstamp-target.patch diff --git a/rsync/source.sh b/net/rsync/source.sh diff --git a/rsync/version b/net/rsync/version diff --git a/net/tcpdump/tar b/net/tcpdump/tar @@ -0,0 +1 @@ +http://www.tcpdump.org/release/tcpdump-4.9.1.tar.gz diff --git a/net/unbound/tar b/net/unbound/tar @@ -0,0 +1 @@ +http://unbound.net/downloads/unbound-latest.tar.gz diff --git a/package.mk b/package.mk @@ -1,43 +0,0 @@ -SRC = $(ROOT)/src/${NAME} -OPT = $(ROOT)/opt/${NAME} -PKG = $(ROOT)/pkg/${NAME} - -src: - mkdir -p '${SRC}' - -opt: - mkdir -p ${OPT}/bin ${OPT}/etc ${OPT}/lib ${OPT}/include - mkdir -p ${OPT}/share/man - -git: src - git clone ${GIT} $(ROOT)/src/${NAME} - -tar: src - wget -O - '${TAR}' | case '${TAR}' in \ - (*bz2) bunzip2 -d ;; (*gz) gzip -d ;; (*xz) xz -d ;; (*tar) tee ;; \ - esac | tar -xf -C '$(ROOT)/src/${NAME}' - - find '${SRC}' -maxdepth 2 -mindepth 2 | xargs -I % mv % . - -autoconf: opt - ${SRC}/configure --prefix=${OPT} - make makefile - -makefile: opt - cd ${SRC} && make - -remove: - rm -rf ${SRC} ${OPT} - -dotfiles: - cd ${PGK} && find . -type d -exec mkdir -p $(HOME)/{} + - cd ${PGK} && find . -type f -exec ln -s {} $(HOME)/{} + - - find -L $(HOME) -type l -exec rm {} + - -crontab: - mkdir -p $(ROOT)/etc - [ -f "${PKG}/cron" ] && tee -a "$ROOT/etc/crontab" < "${PKG}/cron" - sort -u "$ROOT/etc/crontab" -o "$ROOT/etc/crontab" - -.PHONY: src opt git tar autoconf makefile remove dotfiles crontab diff --git a/pkg/bin/pkg-build b/pkg/bin/pkg-build @@ -1,11 +0,0 @@ -mkdir -p "$ROOT/opt/$1" && cd "$ROOT/opt/$1" || exit 1 -export PREFIX="$PWD" -mkdir -p bin etc include lib share/man -ln -s bin sbin - -cd "$ROOT/src/$1" || exit 1 - -[ -f "$ROOT/pkg/$1/build" ] && sh "$ROOT/pkg/$1/build" || sh "$ROOT/pkg/build" - -rm "$PREFIX/sbin" -rmdir "$PREFIX/share/man" "$PREFIX"/* 2> /dev/null || true diff --git a/pkg/bin/pkg-configure b/pkg/bin/pkg-configure @@ -1,35 +0,0 @@ -ROOT=${ROOT:-$HOME} - -# --- dotfiles ----------------------------------------------------------------- - -find "$ROOT/pkg/${1:-}" -path "$ROOT/pkg/*/.*" | while IFS='' read -r path -do - [ -d "$path" ] && mkdir -p "$HOME/${path#$ROOT/pkg/*/}" - [ -f "$path" ] && ln -sf "$path" "$HOME/${path#$ROOT/pkg/*/}" -done - -find -L "$ROOT" -type l -exec rm {} + 2> /dev/null - -# --- crontab ------------------------------------------------------------------ - -mkdir -p "$ROOT/etc" -[ -f "$ROOT/pkg/$1/cron" ] && tee -a "$ROOT/etc/crontab" < "$ROOT/pkg/$1/cron" -sort -u "$ROOT/etc/crontab" -o "$ROOT/etc/crontab" - -# --- configure ---------------------------------------------------------------- - -if [ ! -f "$ROOT/pkg/$1/configure" ] -then true - -elif [ "$(whoami)" = root ] -then sh "$ROOT/pkg/$1/configure" - -elif command -v doas -then doas sh "$ROOT/pkg/$1/configure" - -elif command -v sudo -then sudo sh "$ROOT/pkg/$1/configure" - -elif command -v su -then su -c 'sh "$1"' "$ROOT/pkg/$1/configure" -fi diff --git a/pkg/bin/pkg-git b/pkg/bin/pkg-git @@ -1,3 +0,0 @@ -[ $# -eq 1 ] && git=$1 || IFS='' read -r git < "$ROOT/pkg/$1/git" -mkdir -p "$ROOT/src" -git clone "$git" "$ROOT/src/$1" diff --git a/pkg/bin/pkg-install b/pkg/bin/pkg-install @@ -1,9 +0,0 @@ -exit=0 - -find "$HOME/opt/$1" | tee /dev/stderr | while IFS='' read -r path -do - [ -d "$path" ] && mkdir -p "$ROOT/${path#$HOME/opt/$1}" || exit=1 - [ -f "$path" ] && ln -sf "$path" "$ROOT/${path#$HOME/opt/$1}" || exit=1 -done - -exit "$exit" diff --git a/pkg/bin/pkg-remove b/pkg/bin/pkg-remove @@ -1,4 +0,0 @@ -: ${1:?} - -rm -rf "$ROOT/opt/$1" "$ROOT/src/$1" -find -L "$ROOT" -type l -exec rm {} + diff --git a/pkg/bin/pkg-service b/pkg/bin/pkg-service @@ -1,75 +0,0 @@ -cmd="$1" srv=${2%/} found=0 - -case "$1" in -('') - cd "$ROOT/pkg" || exit 1 - for service in */run - do "$0" status "${service%/run}" - done - exit 0 - ;; -(stop|status) - shift 2 - [ "$srv" ] && [ -d "$ROOT/var/pid/$srv" ] && - for pid in $(ls "$ROOT/var/pid/$srv") - do - for arg in "$@" - do grep -qF "$arg" "$ROOT/var/pid/$srv/$pid" || continue 2 - done - - found=1 - - if cmp "$ROOT/var/pid/$srv/$pid" "/proc/$pid/cmdline" 2> /dev/null - then - cmdline="$(tr '\0' ' ' < "$ROOT/var/pid/$srv/$pid")" - - if [ "$cmd" = stop ] && kill "$pid" - then - printf '%-15s [x] %s\n' "$srv" "$cmdline" - rm -f "$ROOT/var/pid/$srv/$pid" - else - printf '%-15s [r] %s\n' "$srv" "$cmdline" - fi - fi - done - [ "$found" = 0 ] && printf '%-15s [ ]\n' "$srv" && exit 1 - ;; -(start) - shift 2 - if ! "$0" status "$srv" "$@" - then - mkdir -p "$ROOT/var/pid/$srv" - . "$ROOT/pkg/$srv/run" "$@" >> "$ROOT/var/log/$srv" 2>&1 - - if cp "/proc/$PID/cmdline" "$ROOT/var/pid/$srv/$PID" 2> /dev/null - then - cmdline=$(tr '\0' ' ' < "$ROOT/var/pid/$srv/$PID") - printf '%-15s [+] %s\n' "$srv" "$cmdline" - else - touch "$ROOT/var/pid/$srv/$PID" - fi - fi - "$0" status "$srv" - ;; -(update) - find "$ROOT/var/pid" -type f | while IFS='' read path - do - if ! cmp "$path" "/proc/${path##*/}/cmdline" > /dev/null 2>&1 - then - srv=${path%/*} srv=${srv##*/} - printf '%-15s [!] %s\n' "$srv" "$(tr '\0' ' ' < "$path")" - rm -f "$path" - - [ -f "$ROOT/pkg/$srv/crash" ] && - sh "$ROOT/pkg/$srv/crash" - fi - done - - rmdir "$ROOT/var/pid"/* 2> /dev/null - ;; -(*) - printf '[start <pkg>|stop <pkg>|restart <pkg>|status <pkg>|update]\n' - ;; -esac - -true diff --git a/pkg/bin/pkg-tar b/pkg/bin/pkg-tar @@ -1,12 +0,0 @@ -IFS='' read -r tar < "$ROOT/pkg/$1/tar" || exit 1 - -[ -e "$ROOT/src/$1" ] && exit 1 - -mkdir -p "$(ROOT)/src/${NAME}" && cd "$ROOT/src/${NAME}" - -wget -O - "$tar" | case "$tar" in -(*bz2) bunzip2 -d ;; (*gz) gzip -d ;; (*xz) xz -d ;; (*tar) tee ;; -esac | tar -xf - - -find . -maxdepth 2 -mindepth 2 | xargs -I % mv % . -rmdir * 2> /dev/null diff --git a/pkg/cron b/pkg/cron @@ -1 +0,0 @@ -*/1 * * * * pkg-service update diff --git a/rc b/rc @@ -1,15 +0,0 @@ -export ROOT="$HOME" - -export PATH="$ROOT/bin:$PATH" -export MANPATH="$ROOT/man:$MANPATH" -export C_INCLUDE_PATH="$ROOT/include" -export LIBRARY_PATH="$ROOT/.local/lib" -export LD_LIBRARY_PATH="$ROOT/lib:$LD_LIBRARY_PATH" - -for bin in "$ROOT/pkg"/*/bin -do [ -d "$bin" ] && export PATH="$bin:$PATH" -done - -for profile in "$ROOT/pkg"/*/profile -do [ -f "$profile" ] && . "$profile" -done diff --git a/libbearssl/bin/bot b/security/libbearssl/bin/bot diff --git a/libbearssl/build b/security/libbearssl/build diff --git a/libbearssl/run b/security/libbearssl/run diff --git a/libbearssl/tar b/security/libbearssl/tar diff --git a/libressl/build.sh b/security/libressl/build.sh diff --git a/busybox/deps b/security/libressl/deps diff --git a/libressl/lastversion.sh b/security/libressl/lastversion.sh diff --git a/libressl/source.sh b/security/libressl/source.sh diff --git a/libressl/tar b/security/libressl/tar diff --git a/libressl/version b/security/libressl/version diff --git a/libsodium/tar b/security/libsodium/tar diff --git a/security/stunnel/build b/security/stunnel/build @@ -0,0 +1,3 @@ +./configure --prefix="$PREIFX" --with-ssl="$ROOT/libopenssl" && + +make && make prefix="$PREFIX" install cert diff --git a/security/stunnel/stunnel.conf b/security/stunnel/stunnel.conf @@ -0,0 +1,11 @@ +client = yes + +options = NO_SSLv2 +options = NO_SSLv3 + + +[cyberia] + +sslVersion = TLSv1 +connect = irc.cyberia.is:6697 +accept = 127.0.0.1:6667 diff --git a/security/stunnel/tar b/security/stunnel/tar @@ -0,0 +1 @@ +http://www.stunnel.org/downloads/stunnel-5.42.tar.gz diff --git a/setup.sh b/setup.sh @@ -1,45 +0,0 @@ -HOST=git@github.com:josuah - -mkdir -p "$HOME/var/irc" # ii(1) -mkdir -p "$HOME/var/tox" # ratox(1) -mkdir -p "$HOME/var/log" # serve(1) -mkdir -p "$HOME/var/torrent" # gbt -mkdir -p "$HOME/var/cache" -mkdir -p "$HOME/var/pid" -mkdir -p "$HOME/var/tmp" - -mkdir -p "$HOME/srv/git" -git clone --bare $HOST/alphabet.git "$HOME/srv/git/alphabet.git" -git clone --bare $HOST/artisanat.git "$HOME/srv/git/artisanat.git" -git clone --bare $HOST/cgr.git "$HOME/srv/git/cgr.git" -git clone --bare $HOST/drawille.git "$HOME/srv/git/drawille.git" -git clone --bare $HOST/fungus-pathogen.git "$HOME/srv/git/fungus-pathogen.git" -git clone --bare $HOST/http.git "$HOME/srv/git/http.git" -git clone --bare $HOST/hud.git "$HOME/srv/git/hud.git" -git clone --bare $HOST/iode.git "$HOME/srv/git/iode.git" -git clone --bare $HOST/iomenu.git "$HOME/srv/git/iomenu.git" -git clone --bare $HOST/miniwi.git "$HOME/srv/git/miniwi.git" -git clone --bare $HOST/notes.git "$HOME/srv/git/notes.git" -git clone --bare $HOST/pkg.git "$HOME/srv/git/pkg.git" -git clone --bare $HOST/puissance-4.git "$HOME/srv/git/puissance-4.git" -git clone --bare $HOST/serve.git "$HOME/srv/git/serve.git" -git clone --bare $HOST/shannon.git "$HOME/srv/git/shannon.git" - -git clone "$HOME/srv/git/http.git" "$HOME/srv/http" # quark(1) -mkdir -p "$HOME/srv/torrent" # gbt - -mkdir -p "$HOME/src" -git clone "$HOME/srv/git/alphabet.git" "$HOME/src/alphabet" -git clone "$HOME/srv/git/cgr.git" "$HOME/src/cgr" -git clone "$HOME/srv/git/drawille.git" "$HOME/src/drawille" -git clone "$HOME/srv/git/iode.git" "$HOME/src/iode" -git clone "$HOME/srv/git/iomenu.git" "$HOME/src/iomenu" -git clone "$HOME/srv/git/miniwi.git" "$HOME/src/miniwi" -git clone "$HOME/srv/git/serve.git" "$HOME/src/serve" - -mkdir -p "$HOME/opt" - -mkdir -p "$HOME/srv/media/image" -mkdir -p "$HOME/srv/media/music" -mkdir -p "$HOME/srv/media/video" -git clone "$HOME/srv/git/notes.git" "$HOME/srv/media/notes" diff --git a/shell/.bashrc b/shell/.bashrc @@ -1 +0,0 @@ -profile- \ No newline at end of file diff --git a/shell/.mkshrc b/shell/.mkshrc @@ -1 +0,0 @@ -profile- \ No newline at end of file diff --git a/shell/.profile b/shell/.profile @@ -1 +0,0 @@ -. "$HOME/pkg/rc" diff --git a/shell/.zshrc b/shell/.zshrc @@ -1 +0,0 @@ -profile- \ No newline at end of file diff --git a/shell/bin/80 b/shell/bin/80 @@ -1,13 +0,0 @@ -awk ' - -BEGIN { ARGC = 1 } - -{ - sub(" *\\" ARGV[2] "*$", " ", $0) - line = $0 - for (i = 80 - length($0); i > 0; i--) - line = line ARGV[2] - print line -} - -' - "${1:--}" diff --git a/shell/bin/adagio b/shell/bin/adagio @@ -1,237 +0,0 @@ -# Albinoni, Adagio fog G minor adapted to 'beep' - - -# notes frequencies - -C0=16 Cd0=17 Db0=17 D0=18 Dd0=19 Eb0=19 E0=21 F0=22 Fd0=23 -Gb0=23 G0=25 Gd0=26 Ab0=26 A0=28 Ad0=29 Bb0=29 B0=31 -C1=33 Cd1=35 Db1=35 D1=37 Dd1=39 Eb1=39 E1=41 F1=44 Fd1=46 -Gb1=46 G1=49 Gd1=52 Ab1=52 A1=55 Ad1=58 Bb1=58 B1=62 -C2=65 Cd2=69 Db2=69 D2=73 Dd2=78 Eb2=78 E2=82 F2=87 Fd2=93 -Gb2=93 G2=98 Gd2=104 Ab2=104 A2=110 Ad2=117 Bb2=117 B2=123 -C3=131 Cd3=139 Db3=139 D3=147 Dd3=156 Eb3=156 E3=165 F3=175 Fd3=185 -Gb3=185 G3=196 Gd3=208 Ab3=208 A3=220 Ad3=233 Bb3=233 B3=247 -C4=262 Cd4=277 Db4=277 D4=294 Dd4=311 Eb4=311 E4=330 F4=349 Fd4=370 -Gb4=370 G4=392 Gd4=415 Ab4=415 A4=440 Ad4=466 Bb4=466 B4=494 -C5=523 Cd5=554 Db5=554 D5=587 Dd5=622 Eb5=622 E5=659 F5=698 Fd5=740 -Gb5=740 G5=784 Gd5=831 Ab5=831 A5=880 Ad5=932 Bb5=932 B5=988 -C6=1047 Cd6=1109 Db6=1109 D6=1175 Dd6=1245 Eb6=1245 E6=1319 F6=1397 Fd6=1480 -Gb6=1480 G6=1568 Gd6=1661 Ab6=1661 A6=1760 Ad6=1865 Bb6=1865 B6=1976 -C7=2093 Cd7=2217 Db7=2217 D7=2349 Dd7=2489 Eb7=2489 E7=2637 F7=2794 Fd7=2960 -Gb7=2960 G7=3136 Gd7=3322 Ab7=3322 A7=3520 Ad7=3729 Bb7=3729 B7=3951 -C8=4186 Cd8=4435 Db8=4435 D8=4699 Dd8=4978 Eb8=4978 E8=5274 F8=5588 Fd8=5920 -Gb8=5920 G8=6272 Gd8=6645 Ab8=6645 A8=7040 Ad8=7459 Bb8=7459 B8=7902 - - -# music score - -# with $n the note from above, and $d the duration in millisecond. -# Use '1' for silent note. - -# 4:3 in the original score, but here, full mesure is 12. 6 mesure per line. -# In addition, some "interpretation" are added, as in a performance. - -# | | | | | | -n="$n $G3 $G3 $A3 $Ad3 $G3 " -d="$d 36 2 2 26 6 " -# | | | | | | -n="$n $G3 $A3 $Ad3 $C4 " -d="$d 36 2 2 56 " -# | | | | | | -n="$n $G3 $A3 $Ad3 $A3 $Ad3 " -d="$d 6 6 2 2 38 " -# | | | | | | -n="$n $G3 $A3 $G3 $A3 $G3 $Fd3 $G3 " -d="$d 6 2 2 12 4 4 36 " -# | | | | | | - -# | | | | | | -n="$n $D4 $C4 $Ad3 $A3 $G3 $G3 $Fd3 " -d="$d 12 8 4 8 4 24 12 " -# | | | | | | -n="$n $Dd4 $D4 $C4 $Ad3 $A3 $A3 $G3 " -d="$d 12 8 4 8 4 24 12 " -# | | | | | | -n="$n $G4 $F4 $G4 $Dd4 $F4 $D4 $Dd4 " -d="$d 12 6 6 4 4 4 36 " -# | | | | | | -n="$n $F4 $Dd4 $F4 $D4 $Dd4 $C4 $D4 " -d="$d 12 6 6 4 4 4 36 " -# | | | | | | -n="$n $Dd4 $D4 $Dd4 $C4 $D4 $Ad4 $C4 " -d="$d 12 6 6 4 4 4 36 " -# | | | | | | -n="$n $D4 $Dd4 1 $D4 1 " -d="$d 30 6 12 24 12 " -# | | | | | | - -# | | | | | | -n="$n $G4 $A4 $Ad4 $A4 $G4 $Fd4 $G4 1 $F4 " -d="$d 6 6 7 5 5 6 6 12 24 " -# | | | | | | -n="$n $F4 $G4 $Gd4 1 $G4 $F4 $Dd4 $C4 $Dd4 $G4 $D4 $Ad3" -d="$d 1 1 4 4 1 2 18 5 8 4 24 5 " -# | | | | | | -n="$n $D4 $G4 $C4 $C4 $D4 $Dd4 1 $D4 $C4 $Ad3 " -d="$d 8 4 24 1 1 4 4 1 2 24 " -# | | | | | | -n="$n $Ad3 $C4 $D4 1 $C4 $Ad3 $A3 $A3 $Ad3 $C4 1 $Ad3 $A3 $G3 " -d="$d 1 1 4 4 1 2 24 1 1 4 4 1 3 24 " -# | | | | | | - -# -n="$n 1 $G3 $Gd3 $G3 $Fd3 $G3 $F3 $Dd3 $D3 $Dd3 $F3 $Dd3 $D3 $Dd3 $D3 $C3 $B3 $C3 $D3 1" -d="$d 4 8 7 6 5 4 3 3 3 3 4 4 3 4 5 6 7 8 16 4" -# -n="$n 1 $G3 $Gd3 $G3 $Fd3 $G3 $F3 $Dd3 $D3 $Dd3 $F3 $Dd3 $D3 $Dd3 $D3 $D3 $C3 $B3 $C3 1" -d="$d 4 8 7 6 5 4 3 3 3 3 4 4 3 4 5 6 7 8 16 4" -# -n="$n 1 $G3 $C4 $Dd4 $G4 $C5 $Dd5 $C5 $G4 $Dd4 $G4 $C5 $Dd5 $G5 $C6 $G5 $Dd5 $C5 $Dd5 $G5 $C6 $Dd6 $C6 $G5 $Dd5 $C5 $Dd5 $G5 $C6 $Dd6 1" -d="$d 4 7 6 5 4 3 3 2 2 2 2 2 2 2 2 2 2 2 3 3 2 2 2 3 4 5 6 7 9 12 7" -# -n="$n 1 $G4 $Gd4 $G4 $Fd4 $G4 $F4 $Dd4 $D4 $Dd4 $F4 $Dd4 $D4 $Dd4 $D4 $C4 $B3 $C4 $D4 1" -d="$d 4 8 7 6 5 4 3 3 3 3 4 4 3 4 5 6 7 8 16 4" -# -n="$n 1 $G4 $Gd4 $G4 $Fd4 $G4 $F4 $Dd4 $D4 $Dd4 $F4 $Dd4 $D4 $Dd4 $D4 $D4 $C4 $B3 $C4 1" -d="$d 4 8 7 6 5 4 3 3 3 3 4 4 3 4 5 6 7 8 16 4" -# -n="$n 1 $G3 $C4 $Dd4 $G4 $C5 $Dd5 $C5 $G4 $Dd4 $G4 $C5 $Dd5 $G5 $C6 $G5 $Dd5 $C5 $Dd5 $G5 $C6 $Dd6 $C6 $G5 $Dd5 $C5 $Dd5 $G5 $C6 $Dd6 1" -d="$d 4 8 7 6 5 4 3 3 2 2 2 2 2 2 2 2 2 2 3 3 2 2 2 3 4 5 6 7 10 9 7" -# | | | | | | | -n="$n $C4 $D4 $Dd4 $Dd4 $D4 $F4 $Dd4 $Dd4 $D4 $D4 $C4 $B3 $C4 $B3 $C4 $D4 $C4 $C4 1" -d="$d 6 6 4 5 4 4 4 4 4 4 5 6 6 2 2 16 4 24 12" -# | | | | | | | - -# | | | | | | -n="$n $C4 $C4 $D4 $Dd4 $C4 " -d="$d 36 2 2 26 6 " -# | | | | | | -n="$n $C4 $D4 $Dd4 $F4 " -d="$d 36 2 2 56 " -# | | | | | | -n="$n $C4 $D4 $Dd4 $D4 $Dd4 " -d="$d 6 6 2 2 38 " -# | | | | | | -n="$n $C4 $D4 $C4 $D4 $C4 $B3 $C4 " -d="$d 6 2 2 12 4 4 36 " -# | | | | | | - -# | | | | | | -n="$n $G4 $F4 $Dd4 $D4 $C4 $C4 $B3 " -d="$d 12 8 4 8 4 24 12 " -# | | | | | | -n="$n $Gd4 $G4 $F4 $Dd4 $D4 $D4 $C4 " -d="$d 12 8 4 8 4 24 12 " -# | | | | | | -n="$n $C6 $Ad4 $C6 $Gd4 $Ad4 $G4 $Gd4 " -d="$d 12 6 6 4 4 4 36 " -# | | | | | | -n="$n $Ad4 $Gd4 $Ad4 $G4 $Gd4 $F4 $G4 " -d="$d 12 6 6 4 4 4 36 " -# | | | | | | - -# | | | | | | -n="$n $F4 $A3 $Ad3 $C4 $Ad3 $F4 $D4 $Ad3 " -d="$d 20 4 10 2 20 4 10 2 " -# | | | | | | -n="$n $Ad3 $A3 $Ad3 $C4 $Ad3 " -d="$d 20 4 10 2 32 " -# | | | | | | -n="$n $Ad4 $A4 $G4 $F4 $Dd4 $D4 $C4 $Ad3 $G3 $G4 " -d="$d 20 3 3 3 3 3 3 6 12 12 " -# | | | | | | -n="$n $Dd4 $C4 $Ad3 $Gd3 $F4 $D4 $Ad3 $Gd3 $Gd3 $G3 " -d="$d 4 4 20 16 12 4 4 4 12 12 " -# | | | | | | -n="$n 1 $Dd4 $Ad3 $G3 $F3 $G3 $Gd3 1 " -d="$d 8 4 11 3 24 11 5 22 " -# | | | | | | -n="$n $G3 1 $G3" -d="$d 36 30 6 " -# | | | | | | -n="$n $Fd4 $G4 $Gd4 1 $Gd4 $Ad4 $C5 1 $Ad4 $Gd4 $G4 1 $G4" -d="$d 6 6 12 12 2 2 4 8 2 3 21 1 6" -# | | | | | | -n="$n $Fd4 $G4 $Gd4 1 $Gd4 $Ad4 $C5 1 $Ad4 $Gd4 $G4 1" -d="$d 6 6 12 12 2 2 4 8 2 3 21 6" -# | | | | | | - -# | | | | | | -n="$n $C5 $D5 $Dd5 $D5 $C5 $B4 $C5 1 $Ad4 " -d="$d 6 6 7 5 5 6 6 13 24 " -# | | | | | | -n="$n $Ad4 $C5 $Cd5 1 $C5 $Ad4 $Gd4 $F4 $Gd4 $C5 $G4 $Dd4" -d="$d 1 1 4 4 1 2 18 6 8 4 24 6 " -# | | | | | | -n="$n $G4 $C5 $F4 $F4 $G4 $Gd4 1 $G4 $F4 $Dd4 " -d="$d 8 4 24 1 1 4 4 1 2 24 " -# | | | | | | -n="$n $Dd4 $F4 $G4 1 $F4 $Dd4 $D4 $D4 $Dd4 $F4 1 $Dd4 $D4 $C4 " -d="$d 1 1 4 4 1 2 24 1 1 4 4 1 3 24 " -# | | | | | | - -# This passage has 5 mesure per hypermeasure, hence the sum should be near 48. -# -n="$n $C5 $D5 $Dd5 " -d="$d 1 1 46 " -# | | | | | | -n="$n $C5 $D5 $Dd5 " -d="$d 1 1 46 " -# | | | | | | -n="$n $C5 $D5 $Dd5 1 $Dd5 $D5 $D5 " -d="$d 1 1 10 8 4 12 24 " -# | | | | | | | -n="$n $F5 1 $F5 $Dd5 $D5 $C5 " -d="$d 12 8 4 1 11 24 " -# | | | | | | | -n="$n $G5 1 $G5 $G5 $F5 " -d="$d 12 8 4 12 24 " -# | | | | | | | -n="$n $Dd5 1 $Dd5 $Dd5 $Cd5 " -d="$d 12 8 4 12 24 " -# | | | | | | | -n="$n $D5 " -d="$d 36 " -# | | | | | | | -n="$n $A5 1 $A5 $A5 $G5 " -d="$d 12 8 4 12 24 " -# | | | | | | | -n="$n $F5 1 $F5 $F5 $Dd5 " -d="$d 12 8 4 12 24 " -# | | | | | | | -n="$n $Ad4 1 $Ad4 $Ad4 $Ad4 " -d="$d 12 8 4 32 4 " -# | | | | | | | -n="$n $A4 $Ad4 $C5 " -d="$d 2 2 44 " -# | | | | | | | -n="$n $Ad4 $A4 $Ad4 " -d="$d 2 2 44 " -# | | | | | | -n="$n $A4 $G4 $A4 " -d="$d 2 2 38 " -# | | | | | | -n="$n $G4 $Fd4 $G4 " -d="$d 5 6 44 " -# | | | | | | - -# -n="$n $G4 $Ad4 $D5 $G5 $Ad5 $G5 $D5 $Ad4 $D5 $G5 $Ad5 $G5 $Ad5 $D6 $G6 " -d="$d 8 7 6 5 4 4 4 4 5 6 7 7 8 10 24 " -# - - -main() -{ - printf '%s' "$d" | sed -re 's/^ *//' -e 's/ *$//' -e 's/ +/\n/g' | - for note in $n - do - read duration - kill -9 "$pid" - speaker-test -t sine -f $note & pid="$!" - sleep "$(busybox dc "$duration" 10 / f)" - done -} - - -main "$@" diff --git a/shell/bin/color b/shell/bin/color @@ -1,5 +0,0 @@ -[ "$DISPLAY" ] || exit - -xsetroot -solid "#$( - od -A n -h /dev/urandom | tr -cd 0-9a-f | dd bs=1 count=6 2> /dev/null -)" diff --git a/shell/bin/dns-used-tld b/shell/bin/dns-used-tld @@ -1,41 +0,0 @@ -# list all used TLD for a given SLD - -: ${1:?Usage: ${0##*/} segond-level-domain} - - -# get the list of the domains - -[ -f /tmp/tlds-alpha-by-domain.txt ] || -wget -O- http://data.iana.org/TLD/tlds-alpha-by-domain.txt 2> /dev/null | -sed 1d > /tmp/tlds-alpha-by-domain.txt - - -# remove the false positive by checking a long random domain name -# though, we cannot check for these domains now - -if [ ! -f /tmp/tlds-false-positive.txt ] -then - touch /tmp/tlds-false-positive.txt - $0 "$( - tr -cd 0-9a-z < /dev/urandom | dd bs=32 count=1 2> /dev/null - )" > /tmp/tlds-false-positive.txt -fi - - -# check every domain, up to 5 at once - -i=0 -while read tld -do - i=$((i + 1)) - dig -t NS "$1.$tld" | awk '/^[^;]/ && $3 == "IN" { - gsub("[^.]", "", $1) - if (length($1) <= 1) exit 0 - exit 1 - }' || echo "$tld" & - [ "$i" = 5 ] && wait -done << EOF -$(grep -vFf /tmp/tlds-false-positive.txt /tmp/tlds-alpha-by-domain.txt) -EOF - -wait diff --git a/shell/bin/doc-rfc b/shell/bin/doc-rfc @@ -1,5 +0,0 @@ -# download and print an RFC from ietf.org - -wget -q -O- http://www.ietf.org/rfc/rfc"$1".txt | -awk -v RS='\n*[^\n]*\n\f\n[^\n]*\n*' '{ print $0 }' | -$MANPAGER diff --git a/shell/bin/doc-wiki b/shell/bin/doc-wiki @@ -1,49 +0,0 @@ -# search for a wikipedia article and display it in a pager - -E=$(printf '\033') -N=' -' - -# download the raw wiki text -wget -qO- "$1?action=raw" | - -# format and display the page -awk -v RS='' ' -{ - while (sub("'\'\'\''", "{")) - sub("'\'\'\''", "}") - - sub("\[\[[^]|]*\|", "[") - sub("\{\{[^}|]*\|", "{") - sub("\[\[", "[") - sub("\]\]", "]") - sub("\{\{", "[") - sub("\}\}", "]") - - - sub("<[^>]*/ *>", "") - sub("<!--[^>]*-->", "") - sub("<[^>]*>[^<]*</[^>]*>", "") - sub("&[^;]*;", " ") - -' | awk -v RS='<ref[^<]*</ref>' '{ printf("%s*", $0) }' | fold -w 72 -s | sed -r ' - - /^[^=;]/ s/^/ / - - s/^== *([^=].*) *==$/'$N'{\1}'$N'/g - s/^==(=*) *(.*[^=]) *(=*)==$/'$N'{\1 \2 \3}'$N'/g - - s/^; *(.*)/'$N' {\1}'$N'/g - - s/\[/'$E[4m'/g - s/\]/'$E[m'/g - - s/\{/'$E[1m'/g - s/\}/'$E[m'/g - -' | sed ' - - # double empty lines - N; s/^'$N'$//; P; D - -' | $PAGER diff --git a/shell/bin/extract b/shell/bin/extract @@ -1,16 +0,0 @@ -# extract an archive file given its extension - -case "$1" in -( *.tar.gz | *.tgz ) tar -xzf "$1" ;; -( *.tar.bz2 | *.tbz2 ) tar -xjf "$1" ;; -( *.tar ) tar -xf "$1" ;; -( *.bz2 ) bunzip2 "$1" ;; -( *.gz ) gunzip "$1" ;; -( *.rar ) unrar x "$1" ;; -( *.zip ) unzip "$1" ;; -( *.Z ) uncompress "$1" ;; -( *.7z ) 7z x "$1" ;; -( *.xz ) xz -d "$1" ;; -( *.deb ) ar vx "$1" ;; -( * ) exit 1 ;; -esac diff --git a/shell/bin/fig b/shell/bin/fig @@ -1,30 +0,0 @@ -# figlet without all the bells and fanciness. - -IFS=' -' - -set -- $(printf '%s ' "$@" | fold -w 1) - -for character -do - set -- $( - while IFS='' read -r line - do - [ "$print" = 1 ] && [ "$line" = '' ] && break - [ "$print" = 1 ] && printf '%s\n' "$line" - [ "$line" = "$character" ] && print=1 - done < "$ROOT/pkg/fig/${FONT:-1}" | sed 's/;$//' - ) - - l1="$l1$1 " - l2="$l2$2 " - l3="$l3$3 " - l4="$l4$4 " - l5="$l5$5 " - l6="$l6$6 " - l7="$l7$7 " - l8="$l8$8 " -done - -printf '%s\n' "$l1" "$l2" "$l3" "$l4" "$l5" "$l6" "$l7" "$l8" | -sed -r 's/ *$//; /^$/ d' diff --git a/shell/bin/fig-blawk b/shell/bin/fig-blawk @@ -1,61 +0,0 @@ -# draw an image using block characters - -# USAGE: -# blawk [columns lines] file [imagemagick_arguments] - -BEGIN { - if (ARGC < 4) { - convert = "convert "ARGV[1]" -compress none "ARGV[2]" pbm:- "; - } else { - convert = "convert "ARGV[3]" -compress none "ARGV[4] \ - " -resize "ARGV[1]"x"ARGV[2]" pbm:- "; - } - - # Parse the header - for (i = 0; i < 2; ) { - convert | getline; - if (! match($0, "^ *#.*") && ! match($0, "^ *$")) { - i++ - if (i > 0) { - x = $1; - y = $2; - } - } - } - - # Concatenate all lines - while ((convert | getline) > 0) { - lines = lines $0; - } - - # Remove spaces - gsub(" ", "", lines); - - # Split lines according to the image width 'x' - for (j = 0; j * x < length(lines); j++) { - line[j] = substr(lines, j * x, x); - } - - # Character number in a binary pattern from top left to bottom right - chmap[0] = 0x0020; chmap[1] = 0x2598; - chmap[2] = 0x259d; chmap[3] = 0x2580; - chmap[4] = 0x2596; chmap[5] = 0x258c; - chmap[6] = 0x259e; chmap[7] = 0x259b; - chmap[8] = 0x2597; chmap[9] = 0x259a; - chmap[10] = 0x2590; chmap[11] = 0x259c; - chmap[12] = 0x2584; chmap[13] = 0x2599; - chmap[14] = 0x259f; chmap[15] = 0x2588; - - for (i = 0; i <= j - 1; i = i + 4) { - for (k = 0; 2 * k < x; k++) { - printf("%c", chmap[ \ - 1 * substr(line[i], 2 * k , 1) \ - + 2 * substr(line[i], 2 * k + 1, 1) \ - + 4 * substr(line[i + 2], 2 * k , 1) \ - + 8 * substr(line[i + 2], 2 * k + 1, 1) \ - ]); - } - print "" - } - close(cmd) -} diff --git a/shell/bin/fig-drawk b/shell/bin/fig-drawk @@ -1,56 +0,0 @@ -awk ' -# Drawille implementation in awk -# -# USAGE: drawk [columns lines] file [imagemagick_arguments] - -BEGIN { - if (ARGC < 4) { - convert = "convert "ARGV[1]" -compress none "ARGV[2]" pbm:- "; - } else { - convert = "convert "ARGV[3]" -compress none "ARGV[4] \ - " -resize "ARGV[1]"x"ARGV[2]" pbm:- "; - } - - # Parse the header - for (i = 0; i < 2; ) { - convert | getline; - if (! match($0, "^ *#.*") && ! match($0, "^ *$")) { - i++ - if (i > 0) { - x = $1; - y = $2; - } - } - } - - # Concatenate all lines - while ((convert | getline) > 0) { - lines = lines $0; - } - - # Remove spaces - gsub(" ", "", lines); - - # Split lines according to the image width x - for (j = 0; j * x < length(lines); j++) { - line[j] = substr(lines, j * x, x); - } - - for (i = 0; i <= j; i = i + 4) { - # For each character to be drawn for this line - for (k = 0; 2 * k < x; k++) { - # Char code number = initial offset + - # Sum of characters offsets * 0 or 1 on the grid - printf("%c", 10240 \ - + 1 * substr(line[i + 0], 2 * k , 1) \ - + 8 * substr(line[i + 0], 2 * k + 1, 1) \ - + 2 * substr(line[i + 1], 2 * k , 1) \ - + 16 * substr(line[i + 1], 2 * k + 1, 1) \ - + 4 * substr(line[i + 2], 2 * k , 1) \ - + 32 * substr(line[i + 2], 2 * k + 1, 1) \ - + 64 * substr(line[i + 3], 2 * k , 1) \ - + 128 * substr(line[i + 3], 2 * k + 1, 1)); - } - print "" - } -}' diff --git a/shell/bin/fig-fullwidth b/shell/bin/fig-fullwidth @@ -1,10 +0,0 @@ -# Fullwidth letters - -printf '%s\n' "$*" | -sed ' - y/!"#$%&'\''()*+,-.\/0123456789:;<=>?/!"#$%&'()*+,-./0123456789:;<=>?/ - y/@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_/@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_/ - y/`abcdefghijklmnopqrstuvwxyz{|}~/`abcdefghijklmnopqrstuvwxyz{|}~/ - s/ / /g -' - diff --git a/shell/bin/fig-mirror b/shell/bin/fig-mirror @@ -1 +0,0 @@ -sed 'y/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/ɒdɔbɘᎸǫʜiꞁʞ|mᴎoqpɿꙅƚuvwxʏƹAᙠƆᗡƎꟻᎮHIႱ⋊⅃MͶOꟼỌЯꙄTUVWXYƸ/' | rev diff --git a/shell/bin/fig-reverse b/shell/bin/fig-reverse @@ -1,19 +0,0 @@ -# print a text with every line upside down - -while IFS='' read -r line -do - printf '%s\n' "$line" | rev | sed ' - - # lowercase - y/abcdefghijklmnopqrstuvwxyz/ɐqɔpǝɟƃɥᴉɾʞjɯuodbɹsʇnʌʍxʎz/ - - # uppercase - y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/∀BƆDƎℲפHIſK˥WNOԀQRS┴∩ΛMX⅄Z/ - - # digits - y/0123456789/0ƖᄅƐㄣϛ9ㄥ86/ - - # special characters - y/&_/⅋‾/ - ' -done diff --git a/shell/bin/fmt b/shell/bin/fmt @@ -1 +0,0 @@ -tr '\n' ' ' | fold -w 80 -s | sed 's/ *$//' diff --git a/shell/bin/fun-dna b/shell/bin/fun-dna @@ -1,105 +0,0 @@ -# prints nucleotides with full structure, sequentially - -# Usage: dna [ATCG]... - - -R='' B='' -f1=''; f2=''; f3=''; f4=''; f5=''; f6=''; f7='' - -A="\ - ${f1}O${R} ${f1}O${R} *---* - \\\\ / / \\ - ${f3}P${R} ${f4}N${R}. ${f4}N${R}H2 ${f6}|||||||${R} ${f1}O${R} * * - / \\ // \`. / \\\\ / \`. ,'| - ${f1}O${R}- ${f1}O${R} * *---* *---${f4}N${R} \`${f1}O${R}' * - / \\ // \\\\ / \\ / - * ,${f1}O${R}. ${f4}N${R}---* ${f4}N${R} ${f6}||||||||${R} H${f4}N${R} * ${f1}O${R} ${f1}O${R}- - |,' \`. / \\ / \\ // \\ / - * * ${f4}N${R}===* *---* ${f3}P${R} - \\ / // \\ / \\\\ - *---* Adenine ${f1}O${R} * ${f1}O${R} ${f1}O${R} - | | -" - -G="\ - ${f1}O${R} ${f1}O${R} *---* - \\\\ / / \\ - ${f3}P${R} ${f4}N${R}. ${f1}O${R} ${f6}|||||||${R} H2${f4}N${R} * * - / \\ // \`. // \\ / \`. ,'| - ${f1}O${R}- ${f1}O${R} * *---* *---${f4}N${R} \`${f1}O${R}' * - / \\ // \\ / \\ / - * ,${f1}O${R}. ${f4}N${R}---* ${f4}N${R}H ${f6}||||||||${R} ${f4}N${R} * ${f1}O${R} ${f1}O${R}- - |,' \`. / \\ / \\\\ // \\ / - * * ${f4}N${R}===* *---* ${f3}P${R} - \\ / \\ // / \\\\ - *---* Guanine ${f4}N${R}H2 ${f6}|||||||${R} ${f1}O${R} ${f1}O${R} ${f1}O${R} - | | -" - -C="\ - ${f1}O${R} ${f1}O${R} ${f1}O${R} ${f6}|||||||${R} H2${f4}N${R} *---* - \\\\ / // \\ / \\ - ${f3}P${R} *---* *===${f4}N${R} * * - / \\ // \\\\ / \\ / \`. ,'| - ${f1}O${R}- ${f1}O${R} * ${f4}N${R} ${f6}||||||||${R} H${f4}N${R} *---${f4}N${R} \`${f1}O${R}' * - / \\ / \\ // \\ / - * ,${f1}O${R}. ${f4}N${R}---* *---* * ${f1}O${R} ${f1}O${R}- - |,' \`. / \\ // \`. // \\ / - * * ${f4}N${R}H2 ${f6}|||||||${R} ${f1}O${R} \`${f4}N${R} ${f3}P${R} - \\ / / \\\\ - *---* Cytosine ${f1}O${R} ${f1}O${R} - | | -" - -T="\ - ${f1}O${R} ${f1}O${R} * ${f1}O${R} *---* - \\\\ / \\ // / \\ - ${f3}P${R} *---* *===${f4}N${R} * * - / \\ // \\ / \\ / \`. ,'| - ${f1}O${R}- ${f1}O${R} * ${f4}N${R}H ${f6}||||||||${R} ${f4}N${R} *---${f4}N${R} \`${f1}O${R}' * - / \\ / \\\\ // \\ / - * ,${f1}O${R}. ${f4}N${R}---* *---* * ${f1}O${R} ${f1}O${R}- - |,' \`. / \\\\ / \`. // \\ / - * * ${f1}O${R} ${f6}|||||||${R} H2${f4}N${R} \`${f4}N${R} ${f3}P${R} - \\ / / \\\\ - *---* Thymine ${f1}O${R} ${f1}O${R} - | | -" - - -nucleotide() -{ - case "$1" in - ( A* ) printf %s "$A" ;; ( T* ) printf %s "$T" ;; - ( C* ) printf %s "$C" ;; ( G* ) printf %s "$G" ;; - esac -} - - -random() -{ - while date +%s | md5sum | tr -cd '0-9a-f\n' | - tr 0-9a-f ATCGATCGATCGATCG | fold -w 1 - do - sleep 4 - done | while read -r n - do - nucleotide "$n" - sleep 1 - done -} - - -main() -{ - [ -z "$1" ] && random - - while [ "$1" ] - do - nucleotide "$1" - set -- "${1#?}" - done -} - - -main "$@" diff --git a/shell/bin/fun-dump b/shell/bin/fun-dump @@ -1,16 +0,0 @@ -hexdump -C /dev/urandom | awk ' - - /eb/ { - printf("\033[1;32m"); - } - - /da/ { - printf("\033[1;7m"); - } - - { - gsub(/31/, "\033[1;31m##\033[m"); - gsub(/41/, "\033[1;7;31m**\033[m"); - printf("%s\033[m\n", $0); - } -' diff --git a/shell/bin/fun-piano b/shell/bin/fun-piano @@ -1,138 +0,0 @@ -#!/bin/awk -f -# console piano using speaker-test - -BEGIN { - -# qwerty -# ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ______ -# |Esc |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10 |F11 |F12 |Del | -# |____|____|____|____|____|____|____|____|____|____|____|____|____|______| -# |` ~ |1 ! |2 @ |3 # |4 $ |5 % |6 ^ |7 & |8 * |9 ( |0 ) |- _ |= + |Bkspc | -# |____|____|____|____|____|____|____|____|____|____|____|____|____|______| -# |Tab |Q |W |E |R |T |Y |U |I |O |P |[ { |] } | | -# |_____|____|____|____|____|____|____|____|____|____|____|____|____| <-' | -# |Caps |A |S |D |F |G |H |J |K |L |; : |' " |\ | | | -# |______|____|____|____|____|____|____|____|____|____|____|____|____|____| -# |Shift |Z |X |C |V |B |N |M |, < |. > |/ ? |Shift | -# |_______|____|____|____|____|____|____|____|____|____|____|_____________| -# |Ctrl |Super |Alt |Space |Alt Gr|Opt |Ctrl | -# |______|______|______|_______________________________|______|_____|_____| - - # Bottom two rows Top two rows - qwerty = "zsxdcvgbhnjm,l.;/" "q2w3er5t6y7ui9o0p[=]"; # Without shift - QWERTY = "ZSXDCVGBHNJM<L>:/" "Q@W#ER%T^Y&UI(O)P{+}"; # With shift - qwerty = qwerty QWERTY; - -# dvorak -# ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ______ -# |Esc |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10 |F11 |F12 |Del | -# |____|____|____|____|____|____|____|____|____|____|____|____|____|______| -# |` ~ |1 ! |2 @ |3 # |4 $ |5 % |6 ^ |7 & |8 * |9 ( |0 ) |[ { |] } |Bkspc | -# |____|____|____|____|____|____|____|____|____|____|____|____|____|______| -# |Tab |' " |, < |. > |P |Y |F |G |C |R |L |/ ? |= + | | -# |_____|____|____|____|____|____|____|____|____|____|____|____|____| <-' | -# |Caps |A |O |E |U |I |D |H |T |N |S |- _ |\ | | | -# |______|____|____|____|____|____|____|____|____|____|____|____|____|____| -# |Shift |; : |Q |J |K |X |B |M |W |V |Z |Shift | -# |_______|____|____|____|____|____|____|____|____|____|____|_____________| -# |Ctrl |Super |Alt |Space |Alt Gr|Opt |Ctrl | -# |______|______|______|_______________________________|______|_____|_____| - - # map the keys to row positions - - # bottom two rows top two rows - dvorak = ";oqejkixdbhmwnvsz" "'2,3.p5y6f7gc9r0l/]="; # Without shift - DVORAK = ":OQEJKIXDBHMWNVSZ" "\"@<#>P%Y^F&GC(R)L?}+"; # With shift - dvorak = dvorak DVORAK; - - layout = qwerty; - - # notes frequencies - - C0 = 16 " "; Cd0 = 17 " "; D0 = 18 " "; Dd0 = 19 " "; - E0 = 21 " "; F0 = 22 " "; Fd0 = 23 " "; G0 = 25 " "; - Gd0 = 26 " "; A0 = 28 " "; Ad0 = 29 " "; B0 = 31 " "; - C1 = 33 " "; Cd1 = 35 " "; D1 = 37 " "; Dd1 = 39 " "; - E1 = 41 " "; F1 = 44 " "; Fd1 = 46 " "; G1 = 49 " "; - Gd1 = 52 " "; A1 = 55 " "; Ad1 = 58 " "; B1 = 62 " "; - C2 = 65 " "; Cd2 = 69 " "; D2 = 73 " "; Dd2 = 78 " "; - E2 = 82 " "; F2 = 87 " "; Fd2 = 93 " "; G2 = 98 " "; - Gd2 = 104 " "; A2 = 110 " "; Ad2 = 117 " "; B2 = 123 " "; - C3 = 131 " "; Cd3 = 139 " "; D3 = 147 " "; Dd3 = 156 " "; - E3 = 165 " "; F3 = 175 " "; Fd3 = 185 " "; G3 = 196 " "; - Gd3 = 208 " "; A3 = 220 " "; Ad3 = 233 " "; B3 = 247 " "; - C4 = 262 " "; Cd4 = 277 " "; D4 = 294 " "; Dd4 = 311 " "; - E4 = 330 " "; F4 = 349 " "; Fd4 = 370 " "; G4 = 392 " "; - Gd4 = 415 " "; A4 = 440 " "; Ad4 = 466 " "; B4 = 494 " "; - C5 = 523 " "; Cd5 = 554 " "; D5 = 587 " "; Dd5 = 622 " "; - E5 = 659 " "; F5 = 698 " "; Fd5 = 740 " "; G5 = 784 " "; - Gd5 = 831 " "; A5 = 880 " "; Ad5 = 932 " "; B5 = 988 " "; - C6 = 1047 " "; Cd6 = 1109 " "; D6 = 1175 " "; Dd6 = 1245 " "; - E6 = 1319 " "; F6 = 1397 " "; Fd6 = 1480 " "; G6 = 1568 " "; - Gd6 = 1661 " "; A6 = 1760 " "; Ad6 = 1865 " "; B6 = 1976 " "; - C7 = 2093 " "; Cd7 = 2217 " "; D7 = 2349 " "; Dd7 = 2489 " "; - E7 = 2637 " "; F7 = 2794 " "; Fd7 = 2960 " "; G7 = 3136 " "; - Gd7 = 3322 " "; A7 = 3520 " "; Ad7 = 3729 " "; B7 = 3951 " "; - C8 = 4186 " "; Cd8 = 4435 " "; D8 = 4699 " "; Dd8 = 4978 " "; - E8 = 5274 " "; F8 = 5588 " "; Fd8 = 5920 " "; G8 = 6272 " "; - Gd8 = 6645 " "; A8 = 7040 " "; Ad8 = 7459 " "; B8 = 7902 " "; - - # notes selection - - print "\ - _________________________________________________________________________\n\ - | | | | | | | | | | | | | | | | | | | | | | | | |\n\ - | |Db| |Eb| | |Gb| |Ab| |Bb| | |Db| |Eb| | |Gb| |Ab| |Bb| |\n\ - | |C#| |D#| | |F#| |G#| |A#| | |C#| |D#| | |F#| |G#| |A#| |\n\ - | |__| |__| | |__| |__| |__| | |__| |__| | |__| |__| |__| |\n\ - | | | | | | | | | | | | | | |\n\ - | C | D | E | F | G | A | B | C | D | E | F | G | A | B |\n\ - |____|____|____|____|_____|____|____|____|____|____|____|_____|____|____|\n\ -\n\ - ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ______ \n\ - |Esc |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10 |F11 |F12 |Del |\n\ - |____|____|____|____|____|____|____|____|____|____|____|____|____|______|\n\ - | | |C#Eb|D#Eb| |F#Gb|G#Ab|A#Bb| |C#Db|D#Ab| |F#Gb|Bkspc |\n\ - |____|____|____|____|____|____|____|____|____|____|____|____|____|______|\n\ - |Tab |C |D |E |F |G |A |B |C |D |E |F |G | |\n\ - |_____|____|____|____|____|____|____|____|____|____|____|____|____| <-' |\n\ - |Caps | |C#Eb|D#Eb| |F#Gb|G#Ab|A#Bb| |C#Db|D#Eb| | | |\n\ - |______|____|____|____|____|____|____|____|____|____|____|____|____|____|\n\ - |Shift |C |D |E |F |G |A |B |C |D |E |Shift |\n\ - |_______|____|____|____|____|____|____|____|____|____|____|_____________|\n\ - |Ctrl |Super |Alt |Space |Alt Gr|Opt |Ctrl |\n\ - |______|______|______|_______________________________|______|_____|_____|\n" - - # map the notes to rows positions - - row1 = C3 Cd3 D3 Dd3 E3 F3 Fd3 G3 Gd3 A3 Ad3 B3 C4 Cd4 D4 Dd4 E4; - row2 = C4 Cd4 D4 Dd4 E4 F4 Fd4 G4 Gd4 A4 Ad4 B4 C5 Cd5 D5 Dd5 E5 F5 Fd5 G5; - - # convert the text line of frequencies into an array of frequencies - split(row1 row2, frequencies, " "); - - system("stty raw -echo"); - - # main execution loop - while (1) { - # get one character at a time from stdin (keyboard) - cmd = "dd bs=1 count=1 2>/dev/null" - cmd | getline key - close(cmd); - - # which key check it is, and play corresponding note - - # if Ctrl + C, quit - if (key == "") { - break; - - # else, get the note from the array using key position in layout - } else if (note = frequencies[index(layout, key)]) { - # play the note with this frequency with some command - system("speaker-test -Dsysdefault:Generic -t sine -f " note " 1>&2 > /dev/null &" \ - "(sleep 0.5 && kill -9 $!) &"); - } - } - - system("stty -raw echo"); -} diff --git a/shell/bin/fun-psyche b/shell/bin/fun-psyche @@ -1,420 +0,0 @@ -pause() -{ - dd if=/dev/zero of=/dev/null bs=1 count=32768 2> /dev/null -} - -set -- ` - printf '%s\n' "$*" | fold -w 1 | sed 's/[ ]/_/; /^$/ s/^/_/' - seq 10 | sed 's/.*/_/' -` - -b=`printf '\033[31;1m'` -e=`printf '\033[0m'` -r=`printf '\033[7m'` - -printf '\033[2J' - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ \___ - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ || || || || || || || || || || || - ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:=._ \\_/--/--/--/--/--/--/--/--/--/--" - ::=:| ___ |:=._\ \___/ / / _/ / / / / / - ::=;| _____________ |:=._\\______/ / / __/ / / / / - _/ |_______________| \\________/ / / ___/ / / / - (_)__//|||||||\\\\\\_____ \_________/ / (_)___/ _/ _/ - |\__/ ||""""" |||\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ \___ - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _||||'$b'|||'$e'||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ || || || || || || || || || || || - ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:=._ \\_/--/--/--/--/--/--/--/--/--/--" - ::=:| ___ |:=._\ \___/ / / _/ / / / / / - ::=;| _____________ |:=._\\______/ / / __/ / / / / - _/ |_______________| \\________/ / / ___/ / / / - (_)__//||'$b'|||||'$e'\\\\\\_____ \_________/ / (_)___/ _/ _/ - |\__/ ||""""" |||\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ \___ - __/ __ \\\'$b'\\o|||'$e'|//______/ \ \_____/ .__\_____:__ - ___/ _||'$b'||||||||'$e'|||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ || || || || || || || || || || || - ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:=._ \\_/--/--/--/--/--/--/--/--/--/--" - ::=:| ___ |:=._\ \___/ / / _/ / / / / / - ::=;| _____________ |:=._\\______/ / / __/ / / / / - _/ |_______________| \\________/ / / ___/ / / / - (_)__//|'$b'||||||\\'$e'\\\\_____ \_________/ / (_)___/ _/ _/ - |\__/ ||"'$b'""""'$e' |||\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ '$b'/// '$e'/_____,(_X_) ____ \___ - __/ __ '$b'\\\\\o||||//'$e'______/ \ \_____/ .__\_____:__ - ___/ _'$b'|||||||||||||'$e'_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ || || || || || || || || || || || - ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:=._ \\_/--/--/--/--/--/--/--/--/--/--" - ::=:| ___ |:=._\ \___/ / / _/ / / / / / - ::=;| _____________ |:=._\\______/ / / __/ / / / / - _/ |_______________| \\________/ / / ___/ / / / - (_)__'$b'//|||||||\\\\\\'$e'_____ \_________/ / (_)___/ _/ _/ - |\__/ '$b'||""""" |||'$e'\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ '$b' _'$e' ___ ___,--._________ - _/ __'$b'__\ ||/ /// /_____'$e',(_X_) ____ \___ - __/ '$b'__ \\\\\'$e'o'$b'||||//______/'$e' \ \_____/ .__\_____:__ - ___/ _'$b'|||||'$e'|||||'$b'|||'$e'_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ || || || || || || || || || || || - ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:=._ \\_/--/--/--/--/--/--/--/--/--/--" - ::=:| ___ |:=._\ \___/ / / _/ / / / / / - ::=;| _____________ |:=._\\______/ / / __/ / / / / - '$b'_'$e'/ |_______________| \\________/ / / ___/ / / / - '$b'(_)__//||'$e'|||||'$b'\\\\\\_____'$e' \_________/ / (_)___/ _/ _/ - |\__/ '$b'||""""" |||\\____'$e' \___________/ _______/ / - | '$b'|'$e'-|TTTT|'$b'//" \___ \'$e'______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - '$b'_____'$e' _ '$b'___'$e' ___,--._________ - '$b'_/ __'$e'__'$b'\'$e' ||/ '$b'/// /'$e'_____'$b','$e'(_X_) ____ \___ - '$b'__/'$e' __ \'$b'\'$e'\\\o||||//___'$b'___/'$e' \ \_____/ .__\_____:__ - '$b'___/'$e' _||'$b'|'$e'||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - '$b'::'$e'=:| ___ |:=:__ || || || || || || || || || || || - '$b'::'$e'=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - '$b'::'$e'=:| P S Y C H E |:=._ \\_/--/--/--/--/--/--/--/--/--/--" - '$b'::'$e'=:| ___ |:=._\ \___/ / / _/ / / / / / - '$b'::'$e'=;| _____________ |:=._\\______/ / / __/ / / / / - _/ |_______________| \\________/ / / ___/ / / / - '$b'(_)__/'$e'/|||||||\\\\\\'$b'_____'$e' \_________/ / (_)___/ _/ _/ - '$b'|\__/'$e' ||'$b'"""""'$e' '$b'|||\\____ \_'$e'__________/ _______/ / - | '$b'|-'$e'|TTTT|'$b'//" \___ \_______'$e'_______/ ________/ - (_) '$b'`-'$e'|____|'$b'/'$e'_______'$b'\___'$e'_____________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - '$b'_'$e'/ ____\ ||/ /// /_____,(_'$b'X'$e'_) ____ \___ - '$b'_'$e'_/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - '$b'_'$e'__/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - :'$b':='$e':| ___ |:=:__ || || || || || || || || || || || - :'$b':='$e':| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - :'$b':='$e':| P S Y C H E |:=._ \\_/--/--/--/--/--/--/--/--/--/--" - :'$b':='$e':| ___ |:=._\ \___/ / / _/ / / / / / - :'$b':='$e';| _____________ |:=._\\______/ / / __/ / / / / - '$b' _/'$e' |_______________| \\________/ / / ___/ / / / - '$b'(_)'$e'__//|||||||\\\\\\_____ \_________/ / (_)___/ _/ _/ - '$b'|'$e'\__/ ||""""" |||\\____ '$b'\_____'$e'______/ _______/ / - '$b'|'$e' |-|'$b'TTTT'$e'|//" '$b'\___ \______________'$e'/ ________/ - '$b'(_)'$e' `-|____|/_______'$b'\________________/'$e' -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ \___ - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::'$b'=:'$e'| ___ |:=:__ || || || || || || || || || || || - ::'$b'=:'$e'| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::'$b'=:'$e'| P S Y C H E |:=._ \\_/--/--/--/--/--/--/--/--/--/--" - ::'$b'=:'$e'| ___ |:=._\ \___/ / / _/ / / / / / - ::'$b'=;'$e'| _____________ |:=._\\______/ / / __/ / / / / - _/ |_______________| \\________/ / / ___/ / / / - (_)__//|||||||\\\\\\_____ \_________/ / (_)___/ _/ _/ - |\__/ ||""""" |||\\____ \____'$b'_______/'$e' _______/ / - | |-|'$b'TTTT'$e'|//" \___ \________'$b'______/ ________/'$e' - (_) `-|____|/_______\_____'$b'___________/'$e' -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_'$b'X'$e'_) ____ \___ - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::='$b':'$e'| ___ |:=:__ || || || || || || || || || || || - ::='$b':'$e'| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::='$b':'$e'| P S Y C H E |:=._ \\_/--/--/--/--/--/--/--/--/--/--" - ::='$b':'$e'| ___ |:=._\ \___/ / / _/ / / / / / - ::='$b';'$e'| _____________ |:=._\\______/ / / __/ / / / / - _/ |_______________| \\________/ / '$b'/'$e' ___/ / / '$b'/'$e' - (_)__//|||||||\\\\\\_____ \_________/ '$b'/'$e' (_)___/ '$b'_/ _/'$e' - |\__/ ||""""" |||\\____ \___________'$b'/'$e' '$b'_______/ /'$e' - | |-|'$b'TTTT'$e'|//" \___ \______________/ '$b'________/'$e' - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___'$b',--._________'$e' - _/ ____\ ||/ /// /_____,(_X_) ____ '$b'\___'$e' - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |'$b':'$e'=:__ || || || || || || || || || || || - ::=:| |'$b':'$e'=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |'$b':'$e'=._ \\_/--/--/--/--/--/--/--/--/--/--" - ::=:| ___ |'$b':'$e'=._\ \___/ / / _/ / / / '$b'/ /'$e' - ::=;| _____________ |'$b':'$e'=._\\______/ / / '$b'__/'$e' / / '$b'/ /'$e' - _/ |_______________| \\________/ / '$b'/'$e' ___/ / '$b'/ /'$e' - (_)__//|||||||\\\\\\_____ \_________/ '$b'/'$e' (_)___/ '$b'_/ _/'$e' - |\__/ ||""""" |||\\____ \___________/ _______/ / - | |-|'$b'TTTT'$e'|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ '$b'\___'$e' - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____'$b':'$e'__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |'$b':='$e':__ || || || || || || || || || || || - ::=:| |'$b':='$e':__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |'$b':='$e'._ \\_/--/--/--/--/--'$b'/'$e'--/--/--'$b'/'$e'--'$b'/'$e'--" - ::=:| ___ |'$b':='$e'._\ \___/ / / _/ '$b'/'$e' / / '$b'/ /'$e' - ::=;| _____________ |'$b':='$e'._\\______/ / / '$b'__/'$e' / / / / - _/ |_______________| \\________/ / / '$b'__'$e'_/ / / / - (_)__//|||||||\\\\\\_____ \_________/ / '$b'(_)'$e'___/ _/ _/ - |\__/ ||""""" |||\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ \___ - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:'$b'=:'$e'__ || || || || || ||'$r$6$e'|| || ||'$r$9$e'||'$r${10}$e'|| - ::=:| |:'$b'=:'$e'__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:'$b'=.'$e'_ \\_/--/--/--/--/--'$b'/'$e'--/--/--'$b'/'$e'--'$b'/'$e'--" - ::=:| ___ |:'$b'=.'$e'_\ \___/ / / _/ / '$b'/'$e' / / / - ::=;| _____________ |:'$b'=.'$e'_\\______/ / / __/ '$b'/'$e' / / / - _/ |_______________| \\________/ / / '$b'___/ /'$e' / / - (_)__//|||||||\\\\\\_____ \_________/ / (_)'$b'___/'$e' _/ _/ - |\__/ ||""""" |||\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ \___ - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:'$b'__'$e' || || || || || ||'$r$6$e'|| || ||'$r$9$e'||'$r${10}$e'|| - ::=:| |:=:'$b'__'$e'\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:=.'$b'_ '$e'\\_/--/--/--/--/--/--'$b'/'$e'--'$b'/'$e'--/--/--" - ::=:| ___ |:=.'$b'_\'$e' \___/ / / _/ / '$b'/ /'$e' / / - ::=;| _____________ |:=.'$b'_\'$e'\______/ / / __/ / / / / - _/ |_______________| '$b'\\'$e'________/ / / ___/ / / / - (_)__//|||||||\\\\\\_____ '$b'\__'$e'_______/ / (_)___/ _/ _/ - |\__/ ||""""" |||\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ \___ - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:_'$b'_'$e' || || || || || ||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| - ::=:| |:=:_'$b'_\'$e' |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:=._'$b' \\_/'$e'--'$b'/'$e'--/--/--/--/--'$b'/'$e'--'$b'/'$e'--/--/--" - ::=:| ___ |:=._'$b'\ \___/'$e' / / _/ / / / / / - ::=;| _____________ |:=._'$b'\\____'$e'__/ / / __/ / / / / - _/ |_______________| \'$b'\____'$e'____/ / / ___/ / / / - (_)__//|||||||\\\\\\_____ '$b'\______'$e'___/ / (_)___/ _/ _/ - |\__/ ||""""" |||\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ \___ - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ ||'$r$1$e'||'$r$2$e'|| || || ||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| - ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:=._ \\_'$b'/'$e'--'$b'/'$e'--/--/--/--/--/--/--/--/--" - ::=:| ___ |:=._\ \___/ '$b'/'$e' / _/ / / / / / - ::=;| _____________ |:=._\\___'$b'___/'$e' / / __/ / / / / - _/ |_______________| \\____'$b'____/ /'$e' / ___/ / / / - (_)__//|||||||\\\\\\_____ \_'$b'________/'$e' / (_)___/ _/ _/ - |\__/ ||""""" |||\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ \___ - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ ||'$r$1$e'||'$r$2$e'|| || || ||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| - ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:=._ \\_/--/--'$b'/'$e'--'$b'/'$e'--/--/--/--/--/--/--" - ::=:| ___ |:=._\ \___/ '$b'/ / _/'$e' / / / / / - ::=;| _____________ |:=._\\______'$b'/ / /'$e' __/ / / / / - _/ |_______________| \\________/ '$b'/'$e' / ___/ / / / - (_)__//|||||||\\\\\\_____ \_________/ / (_)___/ _/ _/ - |\__/ ||""""" |||\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ \___ - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ ||'$r$1$e'||'$r$2$e'||'$r$3$e'||'$r$4$e'|| ||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| - ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:=._ \\_/--/--'$b'/'$e'--'$b'/'$e'--'$b'/'$e'--/--/--/--/--/--" - ::=:| ___ |:=._\ \___/ / / '$b'_/'$e' / / / / / - ::=;| _____________ |:=._\\______/ / /'$e' __/ / / / / - _/ |_______________| \\________/ / / ___/ / / / - (_)__//|||||||\\\\\\_____ \_________/ / (_)___/ _/ _/ - |\__/ ||""""" |||\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ \___ - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ ||'$r$1$e'||'$r$2$e'||'$r$3$e'||'$r$4$e'||'$r$5$e'||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| - ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:=._ \\_/--/--/--/--/--'$b'/'$e'--/--/--/--/--" - ::=:| ___ |:=._\ \___/ / / _/ / / / / / - ::=;| _____________ |:=._\\______/ / / __/ / / / / - _/ |_______________| \\________/ / / ___/ / / / - (_)__//|||||||\\\\\\_____ \_________/ / (_)___/ _/ _/ - |\__/ ||""""" |||\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -pause - -printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ \___ - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ ||'$r$1$e'||'$r$2$e'||'$r$3$e'||'$r$4$e'||'$r$5$e'||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| - ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:=._ \\_/--/--/--/--/--/--/--/--/--/--" - ::=:| ___ |:=._\ \___/ / / _/ / / / / / - ::=;| _____________ |:=._\\______/ / / __/ / / / / - _/ |_______________| \\________/ / / ___/ / / / - (_)__//|||||||\\\\\\_____ \_________/ / (_)___/ _/ _/ - |\__/ ||""""" |||\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' - -[ "$#" -gt 10 ] && sleep 1 - -while [ "$#" -gt 10 ] -do - shift - - pause - - printf '\033[H%s' ' - _____ _ ___ ___,--._________ - _/ ____\ ||/ /// /_____,(_X_) ____ \___ - __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ - ___/ _|||||||||||||_ \________|___________|_________ - | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ ||'$r$1$e'||'$r$2$e'||'$r$3$e'||'$r$4$e'||'$r$5$e'||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| - ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| - ::=:| P S Y C H E |:=._ \\_/--/--/--/--/--/--/--/--/--/--" - ::=:| ___ |:=._\ \___/ / / _/ / / / / / - ::=;| _____________ |:=._\\______/ / / __/ / / / / - _/ |_______________| \\________/ / / ___/ / / / - (_)__//|||||||\\\\\\_____ \_________/ / (_)___/ _/ _/ - |\__/ ||""""" |||\\____ \___________/ _______/ / - | |-|TTTT|//" \___ \______________/ ________/ - (_) `-|____|/_______\________________/ -' -done diff --git a/shell/bin/fun-saber b/shell/bin/fun-saber @@ -1,171 +0,0 @@ -# Author: L. S., a long time ago - -# Thank you to jansen.price@gmail.com for the original idea. - - -help() -{ - printf 'Usage: %s COLOR WIDTH - -COLOR - ' "${0##*/}" - - for i in `seq 7` - do - printf '\033[3%sm%s\033[0m ' "$i" "$i" - done - - printf ' - -WIDTH - Integer from 0 to 100 - -CONTROLS - Enter to start - - Ctrl + C to stop -' - exit 1 -} - - -# -# This clears the screen, print the handle set cursor position at the middle of -# the blade and saves it -# -print_handle() -{ - local h1='._________,_' - local h2='\033[47;30;1mIIIIIIIIIII\033[0mH' - local h3='""""""""\033[31m'"$1"'\033[0m""^' - local width=12 - - # reset the screen: handle is first thing we draw - printf '\033[2J\033[10;30H' - - for line in "$h1" "$h2" "$h3" - do - printf "$line\033[0m\v\033[%sD" "$width" - done - - printf '\033[%sC\033[2A\033[s' "$width" -} - - -print_blade() -{ - local color="$1" length="$2" - - for i in `seq "$length"` - do - sleep 0.003 - printf '\033[1;4%s;3%sm_\033[m' "$color" "$color" - done - - # Put cursor at the beginning of the blade - printf '\033[%sD' "$i" -} - - -wait_button() -{ - printf ' ' - read -r unused - printf '\033[u' - - # reset the previous state - print_handle '-' -} - - -blink_blade() -{ - local color="$1" length="$2" - local top top_char='.' - local bot bot_char="'" - local end1="'" end2='.' - - # set color - printf '\033[3%sm' "$color" - - # save cursor location - printf '\033[s' - - # generate the blinks from the blink chars - for i in `seq $((length / 2))` - do - top="$top_char $top" - bot="$bot_char $bot" - done - - # Blink the blade - while true - do - printf '\033[%sC%s\033[u' "$length" "$end1" - printf '\033[A\033[K%s%s\033[u' '' "$top" - printf '\033[B\033[K%s%s\033[u' '' "$bot" - - printf '\033[%sC%s\033[u' "$length" "$end2" - printf '\033[A\033[K%s%s\033[u' ' ' "$top" - printf '\033[B\033[K%s%s\033[u' ' ' "$bot" - - done -} - - -close_saber() -{ - local length="$1" - - # ensure we are at the right position - printf '\033[u' - - for i in `seq $((length + 3)) -1 1` - do - printf '\033[%sC\033[A' "$i" - for j in 1 2 3 - do - printf ' \v\033[D' - done - printf '\033[u' - - sleep 0.001 - done - - printf ' \033[0m' - - print_handle '=' - - printf '\n\n\n\033[?25h' - exit 0 -} - - -main() -{ - local color="${1:-1}" length="${2:-50}" - - case "$1" in - [1-7] | '' ) : ;; - * ) help ;; - esac - - case "$2" in - [0-9] | [0-9][0-9] | 1[0-9][0-9] | '' ) : ;; - * ) help ;; - esac - - # close the saber while script stops - trap 'close_saber "$length" 4' INT - - { - printf '\n\n\n\033[?25l' - print_handle '=' - wait_button 4 - print_blade "$color" "$length" - blink_blade "$color" "$length" - } 2>/dev/null -} - - -main "$@" diff --git a/shell/bin/fun-troll b/shell/bin/fun-troll @@ -1,20 +0,0 @@ -#!/bin/sh - - -size=`stty size` - -hd -o /dev/random | tr -dc '0-9' | fold -w 4 | -sed -r 's/^(..)(..)/\1 \2/' | while read row col -do - printf '\033[%s;%sH' "$row" "$col" - - printf '\033[10C\v%s' ',--------.' - printf '\033[11D\v%s' '/ ,===-=== `.' - printf '\033[14D\v%s' '//__(*= (*-.\\' - printf '\033[16D\v%s' '(((,__` ,c-).~~))' - printf '\033[16D\v%s' '\ \ `------'\''||' - printf '\033[14D\v%s' '\ `-.______, |' - printf '\033[18D\v%s' ' `-._ ------ |' - printf '\033[9D\v%s' '`-.____/' - -done diff --git a/shell/bin/fun-type b/shell/bin/fun-type @@ -1,11 +0,0 @@ -# print a text line by line, with a delaye between every charactery - -while IFS='' read -r line -do - while [ "$line" ] - do - printf %s "$line" | cut -b 1 - line="${line#?}" - done - printf '\n' -done diff --git a/shell/bin/http-ix b/shell/bin/http-ix @@ -1 +0,0 @@ -curl -F f:1=@- ix.io diff --git a/shell/bin/http-myip b/shell/bin/http-myip @@ -1 +0,0 @@ -wget -qO- icanhazip.com diff --git a/shell/bin/http-w1r3 b/shell/bin/http-w1r3 @@ -1 +0,0 @@ -curl -F upload=@- w1r3.net diff --git a/shell/bin/http-wttr b/shell/bin/http-wttr @@ -1 +0,0 @@ -wget -qO- wttr.in diff --git a/shell/bin/ipconv b/shell/bin/ipconv @@ -1,32 +0,0 @@ - -if [ -z "$1" ] || [ $# -ne 1 ] -then - exit 1 - -elif [ -z "$(printf %s "$1" | tr -d 0-9)" ] -then - int=$1 ip= - - while [ "$int" -gt 0 ] - do - byte=$((int & 255)) - int=$((int / 256)) - [ -z "$ip" ] && ip="$byte" || ip="$byte.$ip" - done - - printf '%s\n' "$ip" - -elif [ -z "$(printf %s "$1" | tr -d 0-9.)" ] -then - ip=$1 int=0 IFS=. - - for byte in $ip - do - int=$((int * 256 + byte)) - done - - printf '%s\n' "$int" - -else - exit 1 -fi diff --git a/shell/bin/l b/shell/bin/l @@ -1,8 +0,0 @@ -cd "${1:-.}" || exit 1 - -git status -s --branch 2> /dev/null - -{ - ls -p | grep '/$' - ls -F | grep -v '/$' -} | column diff --git a/shell/bin/lines b/shell/bin/lines @@ -1 +0,0 @@ -find "${1:-.}" -name "*.[ch]" | xargs wc -l | sort -n diff --git a/shell/bin/madown b/shell/bin/madown @@ -1,118 +0,0 @@ -awk ' - -BEGIN { - RS = "\n\n+"; pre = 0; -} - - -# pre - litteral - -pre && /```/ { - print("</pre>"); - pre = 0; RS = "\n\n+"; - next; -} - -pre { - print; - next; -} - -/^```.*\n```$/ { - sub(/^```/, "\n<pre>"); sub(/```$/, "</pre>") - print; - next; -} - -/^```/ { - print("\n<pre>"); - pre = 1; RS = "\n"; - next; -} - - -# h1 - headings - -!tag && /^[\t ]*~.*~$/ { - sub(/^[\t ]*~ */, ""); sub(/^ *~$/, ""); - tag = "h1"; -} - - -# h2 - headings - -!tag && /\n_+$/ { - sub(/\n_+_/, ""); - tag = "h2"; -} - - -# h3 - subheadings - -!tag && /^\| / { - sub(/^\| /, ""); - tag = "h3"; -} - - -# h4 - tags - -!tag && /^\{.*\}$/ { - sub(/^\{ */, ""); sub(/ *\}$/, ""); - tag = "h4"; -} - - -# ul - unordered lists - -!tag && /^- / && previous != "li" { - print "<ul>"; -} - -!tag && /^- / { - sub(/^- /, ""); - tag = "li"; -} - -tag != "li" && previous == "li" { - print "</ul>"; -} - - -# p - paragraphs - -!tag { - tag = "p"; -} - - -# inline markup - -{ - # strip remaining newlines - gsub(/[\t ]*\n/, " "); - - # escape html sequences - gsub(/&/, "&amp;"); - gsub(/</, "&lt;"); - gsub(/>/, "&gt;"); - - # literal - while (sub(/`/, "<code>")) - sub(/`/, "</code>"); - - # bold - while (sub(/*/, "<strong>")) - sub(/*/, "</strong>"); - - # links - while (sub(/\[/, "<a href=\"")) - sub(/]/, "\">@</a>"); - - if (tag ~ /h[1-6]/) print(""); - printf("\n<%s>%s</%s>\n", tag, $0, tag); - - previous = tag; - tag = ""; -} -' "$@" diff --git a/shell/bin/pgrep b/shell/bin/pgrep @@ -1,3 +0,0 @@ -find /proc/ -mindepth 2 -maxdepth 2 -name cmdline | -xargs grep -El "$1" 2> /dev/null | -sed -rn 's|^/proc/([0-9]*)/cmdline|\1| p' diff --git a/shell/bin/phaste b/shell/bin/phaste @@ -1,41 +0,0 @@ -#!/bin/sh - -# generate an upload url for pastebin.corp.gandi.net from standard input - - -PHABRICATOR='https://phabricator.corp.gandi.net/paste/edit/form/default' - - -#1 text string to encode - -encode() -{ - text= - - while [ "$1" ] - do - case "$1" in - [A-Za-z0-9_.~-]* ) - text=$text$( - printf %s "$1" | - dd bs=1 count=1 2> /dev/null - ) - ;; - * ) - text=$text%$( - printf %s "$1" | - dd bs=1 count=1 2> /dev/null | - od -A n -t x1 | - tr -d ' ' - ) - ;; - esac - - set -- "${1#?}" - done - - printf %s "$text" -} - - -printf "$PHABRICATOR?text=%s\n" "$(encode "$(tee)")"- \ No newline at end of file diff --git a/shell/bin/printree b/shell/bin/printree @@ -1,37 +0,0 @@ -awk '{ - gsub("&", "&amp;"); gsub("<", "&lt;") - do { print } while (sub("/[^/]*$", "")) -}' | sort -u | awk '{ - count = split($0, line, "/") - for (i = 1; i <= count; i++) { - lines[NR"]["0] = $0 - lines[NR"]["i] = "| " - prev[i] = line[i] - } - lines[NR"]["i - 1] = "|-- " - prev[i] = "" -} END { - for (i = 1; !stop; i++) { - stop = tail = 1 - for (l = NR - 1; l > 0; l--) { - if (lines[l"]["i] == "| " && tail) { - lines[l"]["i] = " " - stop = 0 - - } else if (lines[l"]["i] == "|-- " && tail) { - lines[l"]["i] = "`-- " - tail = stop = 0 - - } else if (!lines[l"]["i]) { - tail = 1 - } - } - } - - for (l = 1; l < NR; l++) { - for (i = 1; lines[l"]["i]; i++) - printf "%s", lines[l"]["i] - sub(".*/", "", lines[l"]["0]) - print lines[l"]["0] - } -}' diff --git a/shell/bin/sane-name b/shell/bin/sane-name @@ -1,10 +0,0 @@ -# only keep '[:alnum:]', ',' and '.' and convert everyting else to '-' - -find . -depth | while IFS='' read -r path -do - dir=$(dirname "$path") - old=$(basename "$path") - new=$(printf %s "$old" | tr -c '[:alnum:],.' '-' | sed -r 's/-+/-/g') - - [ "$dir/$old" != "$dir/$new" ] && mv -- "$dir/$old" "$dir/$new" -done diff --git a/shell/bin/screen-brightness b/shell/bin/screen-brightness @@ -1 +0,0 @@ -printf '%s\n' "$1" | sudo tee -a /sys/class/backlight/*/brightness diff --git a/shell/bin/screen-cast b/shell/bin/screen-cast @@ -1,7 +0,0 @@ -# record screen content to a video using ffmpeg - -ffmpeg -framerate 25 -f x11grab -i :0.0 -video_size "$( - sed 's/,.*//' /sys/class/graphics/fb0/virtual_size -)x$( - sed 's/.*,//' /sys/class/graphics/fb0/virtual_size -)" "$HOME/${1:-screencast}.mp4" diff --git a/shell/bin/screen-rotate b/shell/bin/screen-rotate @@ -1,15 +0,0 @@ -# rotate the screen in TTY or GUI - -if [ "$DISPLAY" ] -then - xrandr --output "$( - xrandr -q | grep -w connected | cut -d ' ' -f 1 - )" --rotate "$1" -else - case "$1" in - ( u | up ) printf 0 ;; - ( r | right ) printf 1 ;; - ( d | down ) printf 2 ;; - ( l | left ) printf 3 ;; - esac | sudo tee /sys/class/graphics/fbcon/rotate_all > /dev/null -fi diff --git a/shell/bin/term-inv b/shell/bin/term-inv @@ -1 +0,0 @@ -[ $# = 0 ] && printf '\033[?5%s' h || printf '\033[?5%s' l diff --git a/shell/bin/term-name b/shell/bin/term-name @@ -1 +0,0 @@ -printf '\033]0;%s\007' "$*" diff --git a/shell/bin/tty-theme b/shell/bin/tty-theme @@ -1,372 +0,0 @@ -# set the theme for the tty from a simple file format - - -# normal bold -# 0 8 black -# 1 9 red -# 2 A green -# 3 B orange -# 4 C blue -# 5 D magenta -# 6 E cyan -# 7 F white - -THEMES=' - -lolidaisuki - -0 1d1d1d -1 b52839 -2 246734 -3 fa9043 -4 4a5cdb -5 99267b -6 15c9c9 -7 dcdcbb -8 333333 -9 fa564b -A 06a535 -B ffaf2b -C 9ca4eb -D ed4db3 -E 62f2f2 -F bc9977 - - -alien - -0 000910 -1 ccccbb -2 aaddbb -3 aaddaa -4 aacccc -5 bbbbcc -6 aaddcc -7 cceedd -8 aaccbb -9 ddddcc -A bbeecc -B cceebb -C bbdddd -D ccccdd -E bbeedd -F fff0f8 - - -coal - -0 000000 -1 ee3333 -2 88ff44 -3 ffcc55 -4 77aaaa -5 85678f -6 55ee99 -7 eeddbb -8 555555 -9 ff6666 -A aaff66 -B ffff99 -C aaddff -D b294bb -E 99ffbb -F ffffff - - -drakula - -0 282a36 -1 cc4343 -2 42c763 -3 ffb86c -4 6272a4 -5 bd93f9 -6 6fb9c9 -7 e6e6d5 -8 888db4 -9 ff5555 -A 50fa7b -B f1fa8c -C 8196d6 -D ff79c6 -E 8be9fd -F ffffff - - -exo - -0 350600 -1 e62828 -2 77b23e -3 d6722e -4 689db3 -5 936599 -6 30c87e -7 acf88d -8 9b6963 -9 ff5454 -A a0d669 -B ff9e5d -C 94dfff -D 9b78ce -E 77ffbd -F ffffff - - -ghost - -0 000000 -1 91265C -2 439a64 -3 ccdd66 -4 55aaaa -5 516583 -6 4a8f86 -7 99bbbb -8 334444 -9 E71E5B -A 72f4a0 -B f5ff8B -C 99bbff -D 676cb0 -E 00ffff -F ffffff - - -gotham - -0 0a0f14 -1 c33027 -2 26a98b -3 edb54c -4 195465 -5 4e5165 -6 33859d -7 98d1ce -8 406068 -9 d26939 -A 30dbb3 -B ffd280 -C 268099 -D 888ba5 -E 599caa -F d3ebe9 - - -gruvbox - -0 282828 -1 cc241d -2 98971a -3 d79921 -4 458588 -5 b16286 -6 689d6a -7 d5c4a1 -8 928374 -9 fb4934 -A b8bb26 -B fabd2f -C 83a598 -D d2869b -E 8ec07c -F ffffff - - -matrix - -0 000000 -1 883300 -2 00aa55 -3 55aa33 -4 339977 -5 668877 -6 119977 -7 99ffaa -8 338844 -9 aa7733 -A 00ff88 -B 88ee66 -C 33dd88 -D 77bb99 -E 66ddbb -F ffffff - - -monokai - -0 48483e -1 dc2566 -2 8fc029 -3 d4c96e -4 55bcce -5 9358fe -6 56b7a5 -7 acada1 -8 76715e -9 fa2772 -A a7e22e -B e7db75 -C 66d9ee -D ae82ff -E 66efd5 -F dfe1d3 - - -pink - -0 090a0f -1 f44444 -2 28684f -3 c8907e -4 422d52 -5 710130 -6 2a7e86 -7 bbbbbb -8 3e4053 -9 f44444 -A 43c291 -B f49a7e -C 542a52 -D 9e0f37 -E 688e95 -F ffffff - - -solarized-dark - -0 002b36 -1 dc322f -2 859900 -3 b58900 -4 268bd2 -5 6c71c4 -6 2aa198 -7 93a1a1 -8 657b83 -9 dc322f -A 859900 -B b58900 -C 268bd2 -D 6c71c4 -E 2aa198 -F fdf6e3 - - -solarized-light - -0 ffddbb -1 d0154b -2 779900 -3 ffa700 -4 096daf -5 dd6699 -6 00aa88 -7 000000 -8 bb9988 -9 d0154b -A 779900 -B ffa700 -C 096daf -D 897f74 -E 00aa88 -F 222222 - - -zenburn - -0 191d1b -1 9C6363 -2 60b48a -3 dfaf8f -4 506070 -5 dc8cc3 -6 8cd0d3 -7 dcdccc -8 709080 -9 dca3a3 -A bfebbf -B f0dfaf -C 94bff3 -D ec93d3 -E 93e0e3 -F ffffff - - -datahill - -0 080011 -1 cc1122 -2 22cc66 -3 edb54c -4 195465 -5 4e5165 -6 33a08d -7 aaccbb -8 407060 -9 ff6644 -A 44ff99 -B ffdd88 -C 337799 -D 888ba5 -E 66ffee -F eeffff -' - - -# 1: chosen theme number - -theme() -{ - show=0 i=0 - - printf '\033[H\033[J' - - while read -r color hex - do - if [ "$hex" ] - then - printf '\033]P%s%s' "$color" "$hex" - show=1 - elif [ "$color" ] - then - name="$color" - elif [ "$show" -eq 1 ] - then - i=$((i + 1)) - - printf '\033[K%3s %-20s' "$i" "$name" - for c in 0 1 2 3 4 5 6 7 - do - printf ' \033[3%sm___\033[1m___\033[m' "$c" - done - printf '\n\033[K\n' - - show=0 - fi - - [ "$1" ] && [ "$i" -ge "$1" ] && return 0 - done << EOF -$THEMES -EOF -} - - -main() -{ - if [ -z "$1" ] - then - theme - printf '\033]P0000000\033]P7aaaaaa\033[J\n Theme number: ' - read -r number - else - number="$1" - fi - - - theme "$number" - printf '\033[J' -} - - -main "$@" diff --git a/shell/bin/tty-video b/shell/bin/tty-video @@ -1,7 +0,0 @@ -# play a video in current TTY using mplayer - -mplayer -vm -vo fbdev2 "$1" -vf scale -zoom -x "$( - sed 's/,.*//' /sys/class/graphics/fb0/virtual_size -)" -y "$( - sed 's/.*,//' /sys/class/graphics/fb0/virtual_size -)" diff --git a/shell/bin/txt b/shell/bin/txt @@ -1,93 +0,0 @@ -awk -F '\0' ' - -# title - -FNR == 1 { - print - for (i = 0; i < 80; i++) - printf "-" - print "" - - if (getline && $0 ~ "^-+$" || $0 ~ "^[ \t]*$") - next -} - -# litterals - -/^\t/ { - print "" - do { - print - } while (getline && $0 ~ "^\t") - next -} - -# blanks - -/^[\t ]*$/ { - next -} - -# heading - -sub("^--- +", "", $0) { - d = 0 - - # parse - while (sub("[0-9#]+\\.", "", $0)) d++ - if (sub("[0-9#]+ ", "", $0)) d++ - for (; d < depth; depth--) - levels[depth] = 0 - depth = d - sub("^[-. ]*", "", $0) - sub(" *-* *$", "", $0) - - # print - row = "--- " - for (d = 1; d < depth; d++) - row = row levels[d] "." - row = row "" ++levels[d] " -- " $0 " " - for (i = length(row); i < 80; i++) - row = row "-" - - print "\n" row - next -} - -# links - -/^[0-9]+: / { - print "" - do { - print - } while (getline && $0 ~ "^[0-9]+: ") - next -} - -# paragraph - -{ - do { - block = block " " $0 - } while (getline && $0 !~ "^[ \t]*$") - - sub("^[\t ]*", "", block) - gsub("[\t ]+", " ", block) - gsub("\\. ", ". ", block) - gsub("\\? ", "? ", block) - gsub("\\! ", "! ", block) - - width = 80 - margin[block] - - print "" - while (length(block) > 0) { - row = substr(block, 1, width) - if (length(row) >= width) - sub(" [^ ]*$", "", row) - - block = substr(block, length(row) + 1) - sub(" *", "", block) - - print row - } -}' "$@" diff --git a/shell/bin/txt-html b/shell/bin/txt-html @@ -1,69 +0,0 @@ -awk ' - -BEGIN { - RS="\n\n+" -} - -{ - gsub("&", "\\&amp;") - gsub("<", "\\&lt;") - gsub(">", "\\&gt;") -} - - -# litterals - -/^---\n.*\n---$/ { - sub("^---\n", "\n<pre>\n") - sub("\n---$", "\n</pre>") - print - next -} - -/^---\n/ { - block = "pre" - sub("^---\n", "\n<pre>\n") - print - next -} - -/\n---$/ { - block = "" - sub("\n---$", "\n</pre>") - print - next -} - -block == "pre" { - print "\n" $0 - next -} - - -# title - -NR == 1 { - sub("\n-+", "") - print "\n<h1>" $0 "</h1>" - next -} - - -# heading - -sub("^--- +", "") { - level = 1 - - while (sub("[0-9#]+\\.", "")) level++ - if (sub("[0-9#]+ ", "")) level++ - - sub("^[-. ]*", "") - sub(" *-* *$", "") - - print "\n<h" level ">" $0 "</h" level ">" - next -} - -{ - print "\n<p>" $0 "</p>" -}' "$@" diff --git a/shell/bin/uri b/shell/bin/uri @@ -1,36 +0,0 @@ -# open a uri with appropriate programe -set -x - -case "$1" in -( http://* | https://* ) - exec ${BROWSER:-x-www-browser} "$1" - ;; -( ssh://* ) - exec ssh "${1#ssh://}" - ;; -( gopher://* ) - exec cgo "$1" - ;; -( irc://* ) - if [ -z "${1##irc://*:*}" ] - then pkg-service start ii "${1#*://}" "${1##*:}" - else pkg-service start ii "${1#*://}" 6667 - fi - exec irc-client "${1#*://}" - ;; -( file://* ) - exec $EDITOR "${1#*://}" - ;; -( git://* ) - mkdir -p "$ROOT/git" - cd "$ROOT/git" || exit 1 - git clone "$1" - ;; -( wiki://* ) - exec doc-wiki "${1#*://}" - ;; -( tox://* ) - pkg-service start tox - printf '' - ;; -esac diff --git a/shell/bin/version b/shell/bin/version @@ -1,145 +0,0 @@ -#!/bin/sh -# version control storing files using their hashes as name - - -NL=' -' - - -die() -{ - printf '%s\n' "$1" 1>&2 - exit 1 -} - - -usage() -{ - die 'version [-i] [-n msg] [-d rev1 rev2] [-r rev] [-p dir]\n' -} - - -init() -{ - pwd="$PWD/" - while pwd="${pwd%/*}" && [ "$pwd" ] || break - do - [ -d "$pwd/v" ] && die 'already in a version tree' - done - - mkdir -p v/obj v/rev - touch v/log -} - - -#1 - commit message - -new() -{ - printf 'new revision\n' - - find . -type f ! -path './v/*' | sort | xargs md5sum | tee v/tmp | - while read -r hash path - do - [ -f "v/obj/$hash" ] || cp "$path" "v/obj/$hash" - done - - old="$(tail -n 1 v/log | cut -d ' ' -f 1)" - new="$(md5sum v/tmp | cut -d ' ' -f 1)" - - mv -f v/tmp "v/rev/$new" - - [ "$old" = "$new" ] || printf '%s %s\n' "$new" "$1" | tee -a v/log - - chmod -w v/obj/* v/rev/* -} - - -#1 - old revision to diff -#2 - new revision to diff - -difftree() -{ - printf -- '--- %s\n+++ %s\n\n' "$1" "$2" - - sort -o v/tmp1 "v/rev/$1" - sort -o v/tmp2 "v/rev/$2" - - comm -3 v/tmp1 v/tmp2 | sed 's/^[^\t]/- &/; s/^\t/+ /' - - rm -f v/tmp1 v/tmp2 -} - - -#1 - revision to apply to the current tree - -revision() -{ - new - - printf 'applying revision %s\n' "$1" - - difftree "$(tail -n 1 v/log | cut -d ' ' -f 1)" "$1" | - while read -r f hash path - do - case "$f" in - ( + ) mkdir -p "${path%/*}" && cp "v/obj/$hash" "$path" ;; - ( - ) rm "$path" ;; - esac - done - - printf '%s applying revision\n' "$1" >> v/log -} - - -#1 - foreign tree to import in local tree - -pull() -{ - printf 'importing all objects from "%s" to "%s"\n' "$1" "$PWD" - - find "$1/v/obj" -type f | while IFS='' read -r path - do - [ -f "${path#$1/}" ] || cp "$path" "${path#$1/}" || exit 1 - done - - new="$(tail -n 1 "$1/v/log" | cut -d ' ' -f 1)" - cp "$1/v/rev/$new" "v/rev/$new" - - revision "$new" -} - - -main() -{ - case "$1" in ( -d | -r | -m | -p | -n ) - [ -d v ] || die "no v/ in $PWD" - esac - - case "$1" in ( -d | -r | -m | -p ) - [ "$(wc -l < v/log)" = 0 ] && die "no revision in $PWD" - esac - - case "$1" in - ( -i ) [ $# = 1 ] || usage - init - ;; - ( -n ) [ $# = 2 ] || usage - new "$2" - ;; - ( -d ) [ $# = 3 ] && [ -f "v/rev/$2" ] && [ -f "v/rev/$3" ] || usage - difftree "$2" "$3" - ;; - ( -r ) [ $# = 2 ] || [ -f "v/rev/$2" ] || usage - revision "$2" - ;; - ( -p ) [ $# = 2 ] && [ -d "$2/v" ] && [ -f "$2/v/log" ] || usage - pull "$(cd "$2" && pwd)" - ;; - ( * | '' ) usage - ;; - esac -} - - -main "$@" diff --git a/shell/bin/www b/shell/bin/www @@ -1,61 +0,0 @@ -# fast static website generator using POSIX sh, cat, printf, find, and sed - - -LAYOUT=$(cat layout.html) || exit 1 - - -#1 directory processed -#2 content of the layout to parse - -parse() -{ - printf %s "${2%%{{*}" - - [ "${2##*{{*}" ] && return 0 - - set -- "$1" "${2#*{{}" - - case "${2%%\}\}*}" in - (*content*) [ -f "$1/index" ] && cat "$1/index" ;; - (*title* ) printf %s "${1##*/}" ;; - (*root* ) root "$1" ;; - (*nav* ) nav "$1" ;; - (*list* ) list "$1" ;; - esac - - parse "$1" "${2#*\}\}}" -} - - -root() -{ - printf %s/ "$1" | sed 's|[^/]||g; s|.|../|g; s|/$||; s|^$|.|' -} - - -nav() -{ - find -L . -mindepth 1 -maxdepth 1 -type d ! -name '.*' | sort | - sed 's|..||' | while IFS='' read -r path - do printf ' <a href="%s">%s</a>' "$(root "$1")/$path" "$path" - done -} - - -list() -{ - [ "$1" != . ] && find -L "$1" -mindepth 1 -maxdepth 1 ! -name 'index*' | - sort | sed 's|.*/||' | while IFS='' read -r path - do - printf -- '<li><a href="%s">%s%s</a></li>\n' "$path" "$path" "$( - [ -f "$path/index" ] && sed 's|^| - | q' "$path/index" - )" - done -} - - -for dir in "$@" -do parse "$dir" "$LAYOUT" > "$dir/index.html" -done - -parse . "$LAYOUT" > index.html diff --git a/shell/bin/x-www-browser b/shell/bin/x-www-browser @@ -1 +0,0 @@ -chromium --force-device-scale-factor=1 diff --git a/ssh/.ssh/config b/ssh/.ssh/config @@ -1,8 +0,0 @@ -host git.nixers.net - identityfile /mnt/ssh/git.nixers.net.key - -host repo.or.cz - identityfile /mnt/ssh/repo.or.cz.key - -host github.com - identityfile /mnt/ssh/github.com.key diff --git a/st/build b/st/build @@ -1,5 +0,0 @@ -find "$ROOT/pkg/st" -name '*.diff' -exec patch -N -p 1 -i {} ';' - -sed 's/gray90/#eeeeee/; s/black/#000000/; s/white/#ffffff/' config.def.h > config.h - -make PREFIX="$PREFIX" install diff --git a/st/config.mk b/st/config.mk @@ -1,26 +0,0 @@ -# st version -VERSION = 0.7 - -# Customize below to fit your system - -# paths -PREFIX = /usr/local -MANPREFIX = ${PREFIX}/share/man - -X11INC = /usr/include -X11LIB = /usr/lib64 - -# freetype -FREETYPEINC = /usr/include/freetype2 - -# includes and libs -INCS = -I. -I/usr/include -I${X11INC} -I${FREETYPEINC} -LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXft - -# flags -CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600 -CFLAGS += -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os ${INCS} ${CPPFLAGS} -LDFLAGS += -g ${LIBS} - -# compiler and linker -# CC = cc diff --git a/st/st-scrollback-0.7.diff b/st/st-scrollback-0.7.diff @@ -1,387 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index b41747f..eae969e 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -7,6 +7,7 @@ - */ - static char font[] = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; - static int borderpx = 2; -+#define histsize 2000 - - /* - * What program is execed by st depends of these precedence rules: -@@ -172,6 +173,8 @@ static Shortcut shortcuts[] = { - { MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} }, - { MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} }, - { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, -+ { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, -+ { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, - }; - - /* -diff --git a/st.c b/st.c -index 2594c65..233d301 100644 ---- a/st.c -+++ b/st.c -@@ -86,6 +86,8 @@ char *argv0; - #define TRUERED(x) (((x) & 0xff0000) >> 8) - #define TRUEGREEN(x) (((x) & 0xff00)) - #define TRUEBLUE(x) (((x) & 0xff) << 8) -+#define TLINE(y) ((y) < term.scr ? term.hist[((y) + term.histi - term.scr \ -+ + histsize + 1) % histsize] : term.line[(y) - term.scr]) - - - enum glyph_attribute { -@@ -228,26 +230,6 @@ typedef struct { - int narg; /* nb of args */ - } STREscape; - --/* Internal representation of the screen */ --typedef struct { -- int row; /* nb row */ -- int col; /* nb col */ -- Line *line; /* screen */ -- Line *alt; /* alternate screen */ -- int *dirty; /* dirtyness of lines */ -- XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */ -- TCursor c; /* cursor */ -- int top; /* top scroll limit */ -- int bot; /* bottom scroll limit */ -- int mode; /* terminal mode flags */ -- int esc; /* escape state flags */ -- char trantbl[4]; /* charset table translation */ -- int charset; /* current charset */ -- int icharset; /* selected charset for sequence */ -- int numlock; /* lock numbers in keyboard */ -- int *tabs; --} Term; -- - /* Purely graphic info */ - typedef struct { - Display *dpy; -@@ -327,6 +309,8 @@ typedef struct { - /* function definitions used in config.h */ - static void clipcopy(const Arg *); - static void clippaste(const Arg *); -+static void kscrolldown(const Arg *); -+static void kscrollup(const Arg *); - static void numlock(const Arg *); - static void selpaste(const Arg *); - static void xzoom(const Arg *); -@@ -340,6 +324,29 @@ static void sendbreak(const Arg *); - /* Config.h for applying patches and the configuration. */ - #include "config.h" - -+/* Internal representation of the screen */ -+typedef struct { -+ int row; /* nb row */ -+ int col; /* nb col */ -+ Line *line; /* screen */ -+ Line *alt; /* alternate screen */ -+ Line hist[histsize]; /* history buffer */ -+ int histi; /* history index */ -+ int scr; /* scroll back */ -+ int *dirty; /* dirtyness of lines */ -+ XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */ -+ TCursor c; /* cursor */ -+ int top; /* top scroll limit */ -+ int bot; /* bottom scroll limit */ -+ int mode; /* terminal mode flags */ -+ int esc; /* escape state flags */ -+ char trantbl[4]; /* charset table translation */ -+ int charset; /* current charset */ -+ int icharset; /* selected charset for sequence */ -+ int numlock; /* lock numbers in keyboard */ -+ int *tabs; -+} Term; -+ - /* Font structure */ - typedef struct { - int height; -@@ -399,8 +406,8 @@ static void tputtab(int); - static void tputc(Rune); - static void treset(void); - static void tresize(int, int); --static void tscrollup(int, int); --static void tscrolldown(int, int); -+static void tscrollup(int, int, int); -+static void tscrolldown(int, int, int); - static void tsetattr(int *, int); - static void tsetchar(Rune, Glyph *, int, int); - static void tsetscroll(int, int); -@@ -731,10 +738,10 @@ tlinelen(int y) - { - int i = term.col; - -- if (term.line[y][i - 1].mode & ATTR_WRAP) -+ if (TLINE(y)[i - 1].mode & ATTR_WRAP) - return i; - -- while (i > 0 && term.line[y][i - 1].u == ' ') -+ while (i > 0 && TLINE(y)[i - 1].u == ' ') - --i; - - return i; -@@ -796,7 +803,7 @@ selsnap(int *x, int *y, int direction) - * Snap around if the word wraps around at the end or - * beginning of a line. - */ -- prevgp = &term.line[*y][*x]; -+ prevgp = &TLINE(*y)[*x]; - prevdelim = ISDELIM(prevgp->u); - for (;;) { - newx = *x + direction; -@@ -811,14 +818,14 @@ selsnap(int *x, int *y, int direction) - yt = *y, xt = *x; - else - yt = newy, xt = newx; -- if (!(term.line[yt][xt].mode & ATTR_WRAP)) -+ if (!(TLINE(yt)[xt].mode & ATTR_WRAP)) - break; - } - - if (newx >= tlinelen(newy)) - break; - -- gp = &term.line[newy][newx]; -+ gp = &TLINE(newy)[newx]; - delim = ISDELIM(gp->u); - if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim - || (delim && gp->u != prevgp->u))) -@@ -839,14 +846,14 @@ selsnap(int *x, int *y, int direction) - *x = (direction < 0) ? 0 : term.col - 1; - if (direction < 0) { - for (; *y > 0; *y += direction) { -- if (!(term.line[*y-1][term.col-1].mode -+ if (!(TLINE(*y-1)[term.col-1].mode - & ATTR_WRAP)) { - break; - } - } - } else if (direction > 0) { - for (; *y < term.row-1; *y += direction) { -- if (!(term.line[*y][term.col-1].mode -+ if (!(TLINE(*y)[term.col-1].mode - & ATTR_WRAP)) { - break; - } -@@ -1012,13 +1019,13 @@ getsel(void) - } - - if (sel.type == SEL_RECTANGULAR) { -- gp = &term.line[y][sel.nb.x]; -+ gp = &TLINE(y)[sel.nb.x]; - lastx = sel.ne.x; - } else { -- gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0]; -+ gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0]; - lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1; - } -- last = &term.line[y][MIN(lastx, linelen-1)]; -+ last = &TLINE(y)[MIN(lastx, linelen-1)]; - while (last >= gp && last->u == ' ') - --last; - -@@ -1490,6 +1497,9 @@ ttyread(void) - /* keep any uncomplete utf8 char for the next call */ - memmove(buf, ptr, buflen); - -+ if (term.scr > 0 && term.scr < histsize-1) -+ term.scr++; -+ - return ret; - } - -@@ -1499,6 +1509,9 @@ ttywrite(const char *s, size_t n) - fd_set wfd, rfd; - ssize_t r; - size_t lim = 256; -+ Arg arg = (Arg){ .i = term.scr }; -+ -+ kscrolldown(&arg); - - /* - * Remember that we are using a pty, which might be a modem line. -@@ -1690,13 +1703,53 @@ tswapscreen(void) - } - - void --tscrolldown(int orig, int n) -+kscrolldown(const Arg* a) -+{ -+ int n = a->i; -+ -+ if (n < 0) -+ n = term.row + n; -+ -+ if (n > term.scr) -+ n = term.scr; -+ -+ if (term.scr > 0) { -+ term.scr -= n; -+ selscroll(0, -n); -+ tfulldirt(); -+ } -+} -+ -+void -+kscrollup(const Arg* a) -+{ -+ int n = a->i; -+ -+ if (n < 0) -+ n = term.row + n; -+ -+ if (term.scr <= histsize - n) { -+ term.scr += n; -+ selscroll(0, n); -+ tfulldirt(); -+ } -+} -+ -+void -+tscrolldown(int orig, int n, int copyhist) - { - int i; - Line temp; - - LIMIT(n, 0, term.bot-orig+1); - -+ if (copyhist) { -+ term.histi = (term.histi - 1 + histsize) % histsize; -+ temp = term.hist[term.histi]; -+ term.hist[term.histi] = term.line[term.bot]; -+ term.line[term.bot] = temp; -+ } -+ - tsetdirt(orig, term.bot-n); - tclearregion(0, term.bot-n+1, term.col-1, term.bot); - -@@ -1710,13 +1763,20 @@ tscrolldown(int orig, int n) - } - - void --tscrollup(int orig, int n) -+tscrollup(int orig, int n, int copyhist) - { - int i; - Line temp; - - LIMIT(n, 0, term.bot-orig+1); - -+ if (copyhist) { -+ term.histi = (term.histi + 1) % histsize; -+ temp = term.hist[term.histi]; -+ term.hist[term.histi] = term.line[orig]; -+ term.line[orig] = temp; -+ } -+ - tclearregion(0, orig, term.col-1, orig+n-1); - tsetdirt(orig+n, term.bot); - -@@ -1765,7 +1825,7 @@ tnewline(int first_col) - int y = term.c.y; - - if (y == term.bot) { -- tscrollup(term.top, 1); -+ tscrollup(term.top, 1, 1); - } else { - y++; - } -@@ -1930,14 +1990,14 @@ void - tinsertblankline(int n) - { - if (BETWEEN(term.c.y, term.top, term.bot)) -- tscrolldown(term.c.y, n); -+ tscrolldown(term.c.y, n, 0); - } - - void - tdeleteline(int n) - { - if (BETWEEN(term.c.y, term.top, term.bot)) -- tscrollup(term.c.y, n); -+ tscrollup(term.c.y, n, 0); - } - - int32_t -@@ -2371,11 +2431,11 @@ csihandle(void) - break; - case 'S': /* SU -- Scroll <n> line up */ - DEFAULT(csiescseq.arg[0], 1); -- tscrollup(term.top, csiescseq.arg[0]); -+ tscrollup(term.top, csiescseq.arg[0], 0); - break; - case 'T': /* SD -- Scroll <n> line down */ - DEFAULT(csiescseq.arg[0], 1); -- tscrolldown(term.top, csiescseq.arg[0]); -+ tscrolldown(term.top, csiescseq.arg[0], 0); - break; - case 'L': /* IL -- Insert <n> blank lines */ - DEFAULT(csiescseq.arg[0], 1); -@@ -2871,7 +2931,7 @@ eschandle(uchar ascii) - return 0; - case 'D': /* IND -- Linefeed */ - if (term.c.y == term.bot) { -- tscrollup(term.top, 1); -+ tscrollup(term.top, 1, 1); - } else { - tmoveto(term.c.x, term.c.y+1); - } -@@ -2884,7 +2944,7 @@ eschandle(uchar ascii) - break; - case 'M': /* RI -- Reverse index */ - if (term.c.y == term.top) { -- tscrolldown(term.top, 1); -+ tscrolldown(term.top, 1, 1); - } else { - tmoveto(term.c.x, term.c.y-1); - } -@@ -3047,7 +3107,7 @@ tputc(Rune u) - void - tresize(int col, int row) - { -- int i; -+ int i, j; - int minrow = MIN(row, term.row); - int mincol = MIN(col, term.col); - int *bp; -@@ -3087,6 +3147,14 @@ tresize(int col, int row) - term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty)); - term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs)); - -+ for (i = 0; i < histsize; i++) { -+ term.hist[i] = xrealloc(term.hist[i], col * sizeof(Glyph)); -+ for (j = mincol; j < col; j++) { -+ term.hist[i][j] = term.c.attr; -+ term.hist[i][j].u = ' '; -+ } -+ } -+ - /* resize each row to new width, zero-pad if needed */ - for (i = 0; i < minrow; i++) { - term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph)); -@@ -3976,11 +4044,11 @@ drawregion(int x1, int y1, int x2, int y2) - term.dirty[y] = 0; - - specs = term.specbuf; -- numspecs = xmakeglyphfontspecs(specs, &term.line[y][x1], x2 - x1, x1, y); -+ numspecs = xmakeglyphfontspecs(specs, &TLINE(y)[x1], x2 - x1, x1, y); - - i = ox = 0; - for (x = x1; x < x2 && i < numspecs; x++) { -- new = term.line[y][x]; -+ new = TLINE(y)[x]; - if (new.mode == ATTR_WDUMMY) - continue; - if (ena_sel && selected(x, y)) -@@ -4000,7 +4068,8 @@ drawregion(int x1, int y1, int x2, int y2) - if (i > 0) - xdrawglyphfontspecs(specs, base, i, ox, y); - } -- xdrawcursor(); -+ if (term.scr == 0) -+ xdrawcursor(); - } - - void diff --git a/st/tar b/st/tar @@ -1 +0,0 @@ -http://dl.suckless.org/st/st-0.7.tar.gz diff --git a/stunnel/build b/stunnel/build @@ -1,3 +0,0 @@ -./configure --prefix="$PREIFX" --with-ssl="$ROOT/libopenssl" && - -make && make prefix="$PREFIX" install cert diff --git a/stunnel/stunnel.conf b/stunnel/stunnel.conf @@ -1,11 +0,0 @@ -client = yes - -options = NO_SSLv2 -options = NO_SSLv3 - - -[cyberia] - -sslVersion = TLSv1 -connect = irc.cyberia.is:6697 -accept = 127.0.0.1:6667 diff --git a/stunnel/tar b/stunnel/tar @@ -1 +0,0 @@ -http://www.stunnel.org/downloads/stunnel-5.42.tar.gz diff --git a/syslinux/build.sh b/syslinux/build.sh @@ -1,13 +0,0 @@ -#!/bin/sh -set -e - -# Syslinux really sucks at cross-compiling, its very likely not gonna work - -# Syslinux's make starts behaving non-deterministic on -j > 1 -MAKEFLAGS="$(printf "%s\n" "$MAKEFLAGS"|sed 's/-j[0-9]*//')" - -export CC="$CC -L$SYSROOT/lib -isystem $SYSROOT/include" -PREFIXED_PATHS="BINDIR='/bin' SBINDIR='/bin' LIBDIR='/lib' DATADIR='/share' MANDIR='/share/man' INCDIR='/include'" - -make $MAKEFLAGS $PREFIXED_PATHS CC="$CC" OPTFLAGS="$CFLAGS" AUXDIR="$PREFIX/share/syslinux" INSTALLROOT="$DESTDIR" bios installer -make $MAKEFLAGS $PREFIXED_PATHS CC="$CC" OPTFLAGS="$CFLAGS" AUXDIR="$PREFIX/share/syslinux" INSTALLROOT="$DESTDIR" bios install diff --git a/syslinux/lastversion.sh b/syslinux/lastversion.sh @@ -1,2 +0,0 @@ -#!/bin/sh -curl -s "https://www.kernel.org/pub/linux/utils/boot/syslinux/"|grep -oE 'syslinux-[0-9\.]*[0-9]'|cut '-d-' -f2|sort -Vu|tail -n 1 diff --git a/syslinux/patch.sh b/syslinux/patch.sh @@ -1,55 +0,0 @@ -#!/bin -# We dont use sbin -sed -i 's,/sbin,/bin,' syslinux.spec mk/syslinux.mk - -# Exclude windows stuff and mtools and others -sed 's|INSTALLSUBDIRS = com32 utils dosutil|INSTALLSUBDIRS = com32 utils|g' -i Makefile -sed '/DIAGDIR/d' -i Makefile - -# Throw Windooze stuff out -sed 's|diag libinstaller dos win32 win64 dosutil txt|libinstaller txt|g' -i Makefile -sed 's|win32/syslinux.exe win64/syslinux64.exe||g' -i Makefile -sed 's|dosutil/\*.com dosutil/\*.sys||g' -i Makefile -sed 's|dos/syslinux.com||g' -i Makefile -sed 's|gpxe/gpxelinuxk*\.0||g' -i Makefile - -# We dont want the perl-based utils -# They also pull in the isohybrid mbrs -sed "s|utils/[a-z]*||g" -i Makefile - -# Skip parts of isolinux that we dont need -sed "s,core/isolinux-debug.bin,," -i Makefile -sed "s,mbr/\*.bin,mbr/\*mbr.bin mbr/isohdpfx.bin," -i Makefile - -# We dont need Memdisk -sed "s,memdisk/memdisk,," -i Makefile -sed "s,memdump/memdump.com,," -i Makefile - -# rarely used COM32 Modules -sed "s,com32/modules/\*.c32,," -i Makefile -sed "s,com32/hdt/\*.c32,," -i Makefile -sed "s,com32/rosh/\*.c32,," -i Makefile -sed "s,com32/gfxboot/\*.c32,," -i Makefile -sed "s,com32/sysdump/\*.c32,," -i Makefile -sed "s,com32/lua/src/\*.c32,," -i Makefile -sed "s,com32/gpllib/\*.c32,," -i Makefile -sed "s,com32/cmenu/libmenu/\*.c32,," -i Makefile - -# Exclude perl utils from being installed -sed '/DIRS/ s/utils//' -i Makefile - -sed -i 's,#include <getkey.h>,#include "include/getkey.h",' com32/libutil/keyname.c -sed -i 's,#include <libutil.h>,#include "include/libutil.h",' com32/libutil/keyname.c -sed -i 's,#include "sha1.h",#include "include/sha1.h",' com32/libutil/sha1hash.c -sed -i 's,#include <base64.h>,#include "include/base64.h",' com32/libutil/unbase64.c -sed -i 's,#include <md5.h>,#include "include/md5.h",' com32/libutil/md5.c -sed -i 's,#include <md5.h>,#include "include/md5.h",' com32/libutil/crypt-md5.c -sed -i 's,#include <minmax.h>,#include "include/minmax.h",' com32/libutil/sha256crypt.c -sed -i 's,#include "xcrypt.h",#include "include/xcrypt.h",' com32/libutil/sha256crypt.c -sed -i 's,#include <minmax.h>,#include "include/minmax.h",' com32/libutil/sha512crypt.c -sed -i 's,#include "xcrypt.h",#include "include/xcrypt.h",' com32/libutil/sha512crypt.c -sed -i 's,#include <base64.h>,#include "include/base64.h",' com32/libutil/base64.c -sed -i '/herror.*/d' utils/gethostip.c -sed -ri 's,__uint([0-9]+)_t,uint\1_t,g' efi/wrapper.c -sed -ri 's,__uint([0-9]+)_t,uint\1_t,g' efi/wrapper.h - diff --git a/syslinux/source.sh b/syslinux/source.sh @@ -1,2 +0,0 @@ -#!/bin/sh -echo "https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-$VERSION.tar.xz" diff --git a/syslinux/version b/syslinux/version @@ -1 +0,0 @@ -6.03 diff --git a/busybox/build b/system/busybox/build diff --git a/busybox/build.sh b/system/busybox/build.sh diff --git a/e2fsprogs/deps b/system/busybox/deps diff --git a/busybox/kconfig.default b/system/busybox/kconfig.default diff --git a/busybox/lastversion.sh b/system/busybox/lastversion.sh diff --git a/busybox/patch.sh b/system/busybox/patch.sh diff --git a/busybox/source.sh b/system/busybox/source.sh diff --git a/busybox/tar b/system/busybox/tar diff --git a/busybox/version b/system/busybox/version diff --git a/e2fsprogs/build.sh b/system/e2fsprogs/build.sh diff --git a/libressl/deps b/system/e2fsprogs/deps diff --git a/e2fsprogs/lastversion.sh b/system/e2fsprogs/lastversion.sh diff --git a/e2fsprogs/patch.sh b/system/e2fsprogs/patch.sh diff --git a/e2fsprogs/source.sh b/system/e2fsprogs/source.sh diff --git a/e2fsprogs/version b/system/e2fsprogs/version diff --git a/libixp/tar b/system/libixp/tar diff --git a/system/linux-headers b/system/linux-headers @@ -0,0 +1 @@ +linux+ \ No newline at end of file diff --git a/linux/build.sh b/system/linux/build.sh diff --git a/linux/crusoe-nopl-emu.patch b/system/linux/crusoe-nopl-emu.patch diff --git a/linux/kconfig.sabotage b/system/linux/kconfig.sabotage diff --git a/linux/lastversion.sh b/system/linux/lastversion.sh diff --git a/linux/patch.sh b/system/linux/patch.sh diff --git a/linux/source.sh b/system/linux/source.sh diff --git a/linux/version b/system/linux/version diff --git a/monitor/bin/monitor b/system/monitor/bin/monitor diff --git a/monitor/bin/monitor-plot b/system/monitor/bin/monitor-plot diff --git a/monitor/bin/monitor-send b/system/monitor/bin/monitor-send diff --git a/monitor/bin/monitor-step b/system/monitor/bin/monitor-step diff --git a/monitor/bin/plot b/system/monitor/bin/plot diff --git a/monitor/cron b/system/monitor/cron diff --git a/monitor/run b/system/monitor/run diff --git a/musl/build.sh b/system/musl/build.sh diff --git a/musl/deps b/system/musl/deps diff --git a/musl/lastversion.sh b/system/musl/lastversion.sh diff --git a/libc/tar b/system/musl/libmusll/tar diff --git a/musl/source.sh b/system/musl/source.sh diff --git a/musl/version b/system/musl/version diff --git a/newsyslog/tar b/system/newsyslog/tar diff --git a/sbase/git b/system/sbase/git diff --git a/scron/crash b/system/scron/crash diff --git a/scron/git b/system/scron/git diff --git a/scron/run b/system/scron/run diff --git a/scron/tar b/system/scron/tar diff --git a/system/syslinux/build.sh b/system/syslinux/build.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -e + +# Syslinux really sucks at cross-compiling, its very likely not gonna work + +# Syslinux's make starts behaving non-deterministic on -j > 1 +MAKEFLAGS="$(printf "%s\n" "$MAKEFLAGS"|sed 's/-j[0-9]*//')" + +export CC="$CC -L$SYSROOT/lib -isystem $SYSROOT/include" +PREFIXED_PATHS="BINDIR='/bin' SBINDIR='/bin' LIBDIR='/lib' DATADIR='/share' MANDIR='/share/man' INCDIR='/include'" + +make $MAKEFLAGS $PREFIXED_PATHS CC="$CC" OPTFLAGS="$CFLAGS" AUXDIR="$PREFIX/share/syslinux" INSTALLROOT="$DESTDIR" bios installer +make $MAKEFLAGS $PREFIXED_PATHS CC="$CC" OPTFLAGS="$CFLAGS" AUXDIR="$PREFIX/share/syslinux" INSTALLROOT="$DESTDIR" bios install diff --git a/system/syslinux/lastversion.sh b/system/syslinux/lastversion.sh @@ -0,0 +1,2 @@ +#!/bin/sh +curl -s "https://www.kernel.org/pub/linux/utils/boot/syslinux/"|grep -oE 'syslinux-[0-9\.]*[0-9]'|cut '-d-' -f2|sort -Vu|tail -n 1 diff --git a/system/syslinux/patch.sh b/system/syslinux/patch.sh @@ -0,0 +1,55 @@ +#!/bin +# We dont use sbin +sed -i 's,/sbin,/bin,' syslinux.spec mk/syslinux.mk + +# Exclude windows stuff and mtools and others +sed 's|INSTALLSUBDIRS = com32 utils dosutil|INSTALLSUBDIRS = com32 utils|g' -i Makefile +sed '/DIAGDIR/d' -i Makefile + +# Throw Windooze stuff out +sed 's|diag libinstaller dos win32 win64 dosutil txt|libinstaller txt|g' -i Makefile +sed 's|win32/syslinux.exe win64/syslinux64.exe||g' -i Makefile +sed 's|dosutil/\*.com dosutil/\*.sys||g' -i Makefile +sed 's|dos/syslinux.com||g' -i Makefile +sed 's|gpxe/gpxelinuxk*\.0||g' -i Makefile + +# We dont want the perl-based utils +# They also pull in the isohybrid mbrs +sed "s|utils/[a-z]*||g" -i Makefile + +# Skip parts of isolinux that we dont need +sed "s,core/isolinux-debug.bin,," -i Makefile +sed "s,mbr/\*.bin,mbr/\*mbr.bin mbr/isohdpfx.bin," -i Makefile + +# We dont need Memdisk +sed "s,memdisk/memdisk,," -i Makefile +sed "s,memdump/memdump.com,," -i Makefile + +# rarely used COM32 Modules +sed "s,com32/modules/\*.c32,," -i Makefile +sed "s,com32/hdt/\*.c32,," -i Makefile +sed "s,com32/rosh/\*.c32,," -i Makefile +sed "s,com32/gfxboot/\*.c32,," -i Makefile +sed "s,com32/sysdump/\*.c32,," -i Makefile +sed "s,com32/lua/src/\*.c32,," -i Makefile +sed "s,com32/gpllib/\*.c32,," -i Makefile +sed "s,com32/cmenu/libmenu/\*.c32,," -i Makefile + +# Exclude perl utils from being installed +sed '/DIRS/ s/utils//' -i Makefile + +sed -i 's,#include <getkey.h>,#include "include/getkey.h",' com32/libutil/keyname.c +sed -i 's,#include <libutil.h>,#include "include/libutil.h",' com32/libutil/keyname.c +sed -i 's,#include "sha1.h",#include "include/sha1.h",' com32/libutil/sha1hash.c +sed -i 's,#include <base64.h>,#include "include/base64.h",' com32/libutil/unbase64.c +sed -i 's,#include <md5.h>,#include "include/md5.h",' com32/libutil/md5.c +sed -i 's,#include <md5.h>,#include "include/md5.h",' com32/libutil/crypt-md5.c +sed -i 's,#include <minmax.h>,#include "include/minmax.h",' com32/libutil/sha256crypt.c +sed -i 's,#include "xcrypt.h",#include "include/xcrypt.h",' com32/libutil/sha256crypt.c +sed -i 's,#include <minmax.h>,#include "include/minmax.h",' com32/libutil/sha512crypt.c +sed -i 's,#include "xcrypt.h",#include "include/xcrypt.h",' com32/libutil/sha512crypt.c +sed -i 's,#include <base64.h>,#include "include/base64.h",' com32/libutil/base64.c +sed -i '/herror.*/d' utils/gethostip.c +sed -ri 's,__uint([0-9]+)_t,uint\1_t,g' efi/wrapper.c +sed -ri 's,__uint([0-9]+)_t,uint\1_t,g' efi/wrapper.h + diff --git a/system/syslinux/source.sh b/system/syslinux/source.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo "https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-$VERSION.tar.xz" diff --git a/system/syslinux/version b/system/syslinux/version @@ -0,0 +1 @@ +6.03 diff --git a/system/tonic-init/build.sh b/system/tonic-init/build.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e +set -x + +$CC -L$SYSROOT/lib -isystem $SYSROOT/include $CFLAGS $LDFLAGS -o init "$PKGDIR"/init.c +cp -f init "$DESTDIR$PREFIX"/bin/init +cp -f "$PKGDIR"/linuxrc "$DESTDIR$PREFIX"/linuxrc +cp -f "$PKGDIR"/rc.init "$DESTDIR$PREFIX"/bin/rc.init +cp -f "$PKGDIR"/rc.shutdown "$DESTDIR$PREFIX"/bin/rc.shutdown diff --git a/system/tonic-init/init.c b/system/tonic-init/init.c @@ -0,0 +1,83 @@ +/* This is a modified version of suckless's sinit, which is MIT-licensed. + * See http://git.suckless.org/sinit/tree/LICENSE + */ +#include <sys/types.h> +#include <sys/wait.h> + +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +#define LEN(x) (sizeof (x) / sizeof *(x)) + +static void sigpoweroff(void); +static void sigreap(void); +static void sigreboot(void); +static void replace(char *const []); + +static struct { + int sig; + void (*handler)(void); +} sigmap[] = { + { SIGUSR1, sigpoweroff }, // busybox halt + { SIGUSR2, sigpoweroff }, // busybox poweroff + { SIGINT, sigpoweroff }, // PID namespace poweroff/halt, ctrl+alt+del + { SIGCHLD, sigreap }, + { SIGTERM, sigreboot }, // busybox reboot + { SIGHUP, sigreboot }, // PID namespace reboot +}; + +static char *const rcinitcmd[] = { "/bin/rc.init", NULL }; +static char *const rcrebootcmd[] = { "/bin/rc.shutdown", "reboot", NULL }; +static char *const rcpoweroffcmd[] = { "/bin/rc.shutdown", "poweroff", NULL }; + +static sigset_t set; + +void replace(char *const argv[]) { + sigprocmask(SIG_UNBLOCK, &set, NULL); + setsid(); + execvp(argv[0], argv); + perror("execvp"); + _exit(1); +} + +int main(int argc, char *argv[]) { + int sig; + size_t i; + + chdir("/"); + sigfillset(&set); + sigprocmask(SIG_BLOCK, &set, NULL); + + switch (fork()) { + case 0: + replace(rcinitcmd); + case -1: + perror("fork"); + } + + while (1) { + sigwait(&set, &sig); + for (i = 0; i < LEN(sigmap); i++) { + if (sigmap[i].sig == sig) { + sigmap[i].handler(); + break; + } + } + } + /* not reachable */ + return 0; +} + +static void sigpoweroff(void) { + replace(rcpoweroffcmd); +} + +static void sigreap(void) { + while (waitpid(-1, NULL, WNOHANG) > 0); +} + +static void sigreboot(void) { + replace(rcrebootcmd); +} diff --git a/system/tonic-init/linuxrc b/system/tonic-init/linuxrc @@ -0,0 +1,42 @@ +#!/bin/busybox sh +echo "Entering initrd" +export PATH=/bin + +# Those two will fail if already mounted +mount -o nosuid,noexec -t devtmpfs devtmpfs /dev 2>/dev/null +mount -o nosuid,nodev,noexec -t proc proc /proc 2>/dev/null + +# Cleaning up leftover mounts +for i in 1 2 3; do + mount|awk '{print($3)}'|grep '/mnt'|tac|while read p; do + pretty="$(printf "%s\n" "$p"|sed 's|^/mnt||;s|^$|/|')" + echo "Umounting $pretty" + umount "$p" + done +done + +if [ "$1" = "poweroff" ] || [ "$1" = "reboot" ]; then + "$1" -f + # The above will return if we are in a PID namespace + # and we are likely the last process. bye. + exit 1337 +fi + +echo "Mounting root partition" +mount -t ramfs -o noexec ramfs /mnt + +echo "Preparing root file system" +cd /mnt +mkdir -p rom dev proc +# Note that this doesn't overwrite potentiall existing directories +# allowing to use other distros (void? anyone?) +ln -s rom/bin bin +ln -s rom/lib lib +ln -s rom/share share + +mount --move /dev dev +mount --move /proc proc +pivot_root . rom + +echo "Exiting initrd" +exec chroot . init <dev/console >dev/console 2>&1 diff --git a/system/tonic-init/rc.init b/system/tonic-init/rc.init @@ -0,0 +1,42 @@ +#!/bin/sh +PATH="/bin" + +type ctrlaltdel >/dev/null 2>&1 && ctrlaltdel -s + +mkdir -p /sys /tmp /run /etc +mount -n -t sysfs -o nosuid,noexec,nodev sysfs /sys + +mkdir -p /dev/pts +mount -n -t devpts -o nosuid,noexec devpts /dev/pts + +echo "Setting up default config" +[ -e /etc/resolv.conf ] || ln -s /run/resolv.conf /etc/resolv.conf +[ -e /run/resolv.conf ] || echo "nameserver 208.67.222.222" > /run/resolv.conf + +if ! [ -e /etc/passwd ]; then + touch /etc/passwd /etc/group /etc/shadow + adduser -h / -u 0 -D root +fi + +if ! [ -e /etc/hosts ]; then + cat > /etc/hosts <<EOF +127.0.0.1 localhost.localdomain localhost +::1 localhost.localdomain localhost +EOF +fi + +echo "Starting device manager" +mdev -s +echo mdev > /proc/sys/kernel/hotplug + +if [ -e /etc/fstab ]; then + echo "Mounting filesystems" + mount -a +fi + +echo ' _____ ___ _ _ ___ ___ ' +echo ' |_ _/ _ \| \| |_ _/ __| ' +echo ' | || (_) | .` || | (__ ' +echo ' |_| \___/|_|\_|___\___| ' + +exec getty 115200 console -n -l /bin/sh diff --git a/system/tonic-init/rc.shutdown b/system/tonic-init/rc.shutdown @@ -0,0 +1,22 @@ +#!/bin/sh +# TODO: Can we rely on PATH being set? +PATH="/bin" + +# Stop service supervisor +# TODO: this was just copied from morpheus. does it work with busybox? +#echo "Stop service supervisor" +#svc -k +#sleep 1 + +# Kill all processes +echo "Kill all processes" +killall5 -s TERM +sleep 3 +killall5 -s KILL + +cd /rom +echo "Move /dev and /proc back to initrd" +mount --move /dev dev +mount --move /proc proc +pivot_root . mnt +exec chroot . ./linuxrc "$@" <dev/console >dev/console 2>&1 diff --git a/tcpdump/tar b/tcpdump/tar @@ -1 +0,0 @@ -http://www.tcpdump.org/release/tcpdump-4.9.1.tar.gz diff --git a/iomenu/bin/io b/text/iomenu/bin/io diff --git a/iomenu/bin/io-agenda b/text/iomenu/bin/io-agenda diff --git a/iomenu/bin/io-cache b/text/iomenu/bin/io-cache diff --git a/iomenu/bin/io-jobs b/text/iomenu/bin/io-jobs diff --git a/iomenu/bin/io-mail b/text/iomenu/bin/io-mail diff --git a/iomenu/bin/io-music b/text/iomenu/bin/io-music diff --git a/iomenu/bin/io-ps b/text/iomenu/bin/io-ps diff --git a/iomenu/bin/io-search b/text/iomenu/bin/io-search diff --git a/iomenu/bin/io-unicode b/text/iomenu/bin/io-unicode diff --git a/iomenu/man/io.1 b/text/iomenu/man/io.1 diff --git a/iomenu/tar b/text/iomenu/tar diff --git a/jq/tar b/text/jq/tar diff --git a/mandoc/build b/text/mandoc/build diff --git a/mandoc/tar b/text/mandoc/tar diff --git a/mupdf/build b/text/mupdf/build diff --git a/mupdf/tar b/text/mupdf/tar diff --git a/tonic-init/build.sh b/tonic-init/build.sh @@ -1,9 +0,0 @@ -#!/bin/sh -set -e -set -x - -$CC -L$SYSROOT/lib -isystem $SYSROOT/include $CFLAGS $LDFLAGS -o init "$PKGDIR"/init.c -cp -f init "$DESTDIR$PREFIX"/bin/init -cp -f "$PKGDIR"/linuxrc "$DESTDIR$PREFIX"/linuxrc -cp -f "$PKGDIR"/rc.init "$DESTDIR$PREFIX"/bin/rc.init -cp -f "$PKGDIR"/rc.shutdown "$DESTDIR$PREFIX"/bin/rc.shutdown diff --git a/tonic-init/init.c b/tonic-init/init.c @@ -1,83 +0,0 @@ -/* This is a modified version of suckless's sinit, which is MIT-licensed. - * See http://git.suckless.org/sinit/tree/LICENSE - */ -#include <sys/types.h> -#include <sys/wait.h> - -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> - -#define LEN(x) (sizeof (x) / sizeof *(x)) - -static void sigpoweroff(void); -static void sigreap(void); -static void sigreboot(void); -static void replace(char *const []); - -static struct { - int sig; - void (*handler)(void); -} sigmap[] = { - { SIGUSR1, sigpoweroff }, // busybox halt - { SIGUSR2, sigpoweroff }, // busybox poweroff - { SIGINT, sigpoweroff }, // PID namespace poweroff/halt, ctrl+alt+del - { SIGCHLD, sigreap }, - { SIGTERM, sigreboot }, // busybox reboot - { SIGHUP, sigreboot }, // PID namespace reboot -}; - -static char *const rcinitcmd[] = { "/bin/rc.init", NULL }; -static char *const rcrebootcmd[] = { "/bin/rc.shutdown", "reboot", NULL }; -static char *const rcpoweroffcmd[] = { "/bin/rc.shutdown", "poweroff", NULL }; - -static sigset_t set; - -void replace(char *const argv[]) { - sigprocmask(SIG_UNBLOCK, &set, NULL); - setsid(); - execvp(argv[0], argv); - perror("execvp"); - _exit(1); -} - -int main(int argc, char *argv[]) { - int sig; - size_t i; - - chdir("/"); - sigfillset(&set); - sigprocmask(SIG_BLOCK, &set, NULL); - - switch (fork()) { - case 0: - replace(rcinitcmd); - case -1: - perror("fork"); - } - - while (1) { - sigwait(&set, &sig); - for (i = 0; i < LEN(sigmap); i++) { - if (sigmap[i].sig == sig) { - sigmap[i].handler(); - break; - } - } - } - /* not reachable */ - return 0; -} - -static void sigpoweroff(void) { - replace(rcpoweroffcmd); -} - -static void sigreap(void) { - while (waitpid(-1, NULL, WNOHANG) > 0); -} - -static void sigreboot(void) { - replace(rcrebootcmd); -} diff --git a/tonic-init/linuxrc b/tonic-init/linuxrc @@ -1,42 +0,0 @@ -#!/bin/busybox sh -echo "Entering initrd" -export PATH=/bin - -# Those two will fail if already mounted -mount -o nosuid,noexec -t devtmpfs devtmpfs /dev 2>/dev/null -mount -o nosuid,nodev,noexec -t proc proc /proc 2>/dev/null - -# Cleaning up leftover mounts -for i in 1 2 3; do - mount|awk '{print($3)}'|grep '/mnt'|tac|while read p; do - pretty="$(printf "%s\n" "$p"|sed 's|^/mnt||;s|^$|/|')" - echo "Umounting $pretty" - umount "$p" - done -done - -if [ "$1" = "poweroff" ] || [ "$1" = "reboot" ]; then - "$1" -f - # The above will return if we are in a PID namespace - # and we are likely the last process. bye. - exit 1337 -fi - -echo "Mounting root partition" -mount -t ramfs -o noexec ramfs /mnt - -echo "Preparing root file system" -cd /mnt -mkdir -p rom dev proc -# Note that this doesn't overwrite potentiall existing directories -# allowing to use other distros (void? anyone?) -ln -s rom/bin bin -ln -s rom/lib lib -ln -s rom/share share - -mount --move /dev dev -mount --move /proc proc -pivot_root . rom - -echo "Exiting initrd" -exec chroot . init <dev/console >dev/console 2>&1 diff --git a/tonic-init/rc.init b/tonic-init/rc.init @@ -1,42 +0,0 @@ -#!/bin/sh -PATH="/bin" - -type ctrlaltdel >/dev/null 2>&1 && ctrlaltdel -s - -mkdir -p /sys /tmp /run /etc -mount -n -t sysfs -o nosuid,noexec,nodev sysfs /sys - -mkdir -p /dev/pts -mount -n -t devpts -o nosuid,noexec devpts /dev/pts - -echo "Setting up default config" -[ -e /etc/resolv.conf ] || ln -s /run/resolv.conf /etc/resolv.conf -[ -e /run/resolv.conf ] || echo "nameserver 208.67.222.222" > /run/resolv.conf - -if ! [ -e /etc/passwd ]; then - touch /etc/passwd /etc/group /etc/shadow - adduser -h / -u 0 -D root -fi - -if ! [ -e /etc/hosts ]; then - cat > /etc/hosts <<EOF -127.0.0.1 localhost.localdomain localhost -::1 localhost.localdomain localhost -EOF -fi - -echo "Starting device manager" -mdev -s -echo mdev > /proc/sys/kernel/hotplug - -if [ -e /etc/fstab ]; then - echo "Mounting filesystems" - mount -a -fi - -echo ' _____ ___ _ _ ___ ___ ' -echo ' |_ _/ _ \| \| |_ _/ __| ' -echo ' | || (_) | .` || | (__ ' -echo ' |_| \___/|_|\_|___\___| ' - -exec getty 115200 console -n -l /bin/sh diff --git a/tonic-init/rc.shutdown b/tonic-init/rc.shutdown @@ -1,22 +0,0 @@ -#!/bin/sh -# TODO: Can we rely on PATH being set? -PATH="/bin" - -# Stop service supervisor -# TODO: this was just copied from morpheus. does it work with busybox? -#echo "Stop service supervisor" -#svc -k -#sleep 1 - -# Kill all processes -echo "Kill all processes" -killall5 -s TERM -sleep 3 -killall5 -s KILL - -cd /rom -echo "Move /dev and /proc back to initrd" -mount --move /dev dev -mount --move /proc proc -pivot_root . mnt -exec chroot . ./linuxrc "$@" <dev/console >dev/console 2>&1 diff --git a/unbound/tar b/unbound/tar @@ -1 +0,0 @@ -http://unbound.net/downloads/unbound-latest.tar.gz diff --git a/abduco/tar b/utils/abduco/tar diff --git a/utils/ag/tar b/utils/ag/tar @@ -0,0 +1 @@ +http://geoff.greer.fm/ag/releases/the_silver_searcher-2.0.0.tar.gz diff --git a/utils/entr/tar b/utils/entr/tar @@ -0,0 +1 @@ +http://entrproject.org/code/entr-3.8.tar.gz diff --git a/less/profile b/utils/less/profile diff --git a/less/tar b/utils/less/tar diff --git a/utils/wendy/tar b/utils/wendy/tar @@ -0,0 +1 @@ +http://dl.z3bra.org/releases/wendy-1.0.tar.bz2 diff --git a/vim/.vimrc b/vim/.vimrc @@ -1,16 +0,0 @@ -syntax off - -set encoding=utf8 -set listchars=tab:\|\ ,trail:%,extends:>,precedes:<,nbsp:_ -set list -set scrolloff=3 -set colorcolumn=81,82,83,84,85,86,87,88,89,90 -set incsearch - -highlight colorcolumn ctermbg=0 ctermfg=1 -highlight search ctermbg=3 ctermfg=0 -highlight visual ctermbg=7 ctermfg=0 - -nmap coh :set hlsearch!<cr>:set hlsearch?<cr> -nmap col :set list !<cr>:set list ?<cr> -nmap cop :set paste !<cr>:set paste ?<cr> diff --git a/wendy/tar b/wendy/tar @@ -1 +0,0 @@ -http://dl.z3bra.org/releases/wendy-1.0.tar.bz2 diff --git a/x11/.xinitrc b/x11/.xinitrc @@ -1,11 +0,0 @@ -setxkbmap us -option compose:ralt -xsetroot -solid '#000000' -xset +fp "$CONFIG/fonts" - -while xsetroot -name "$(date)" -do sleep 1 -done & - -ssh-agent - -exec dwm diff --git a/dmenu/build b/x11/dmenu/build diff --git a/dmenu/tar b/x11/dmenu/tar diff --git a/dwm/config.h b/x11/dwm/config.h diff --git a/dwm/config.mk b/x11/dwm/config.mk diff --git a/dwm/tar b/x11/dwm/tar diff --git a/sent/tar b/x11/sent/tar diff --git a/x11/st/build b/x11/st/build @@ -0,0 +1,5 @@ +find "$ROOT/pkg/st" -name '*.diff' -exec patch -N -p 1 -i {} ';' + +sed 's/gray90/#eeeeee/; s/black/#000000/; s/white/#ffffff/' config.def.h > config.h + +make PREFIX="$PREFIX" install diff --git a/x11/st/config.mk b/x11/st/config.mk @@ -0,0 +1,26 @@ +# st version +VERSION = 0.7 + +# Customize below to fit your system + +# paths +PREFIX = /usr/local +MANPREFIX = ${PREFIX}/share/man + +X11INC = /usr/include +X11LIB = /usr/lib64 + +# freetype +FREETYPEINC = /usr/include/freetype2 + +# includes and libs +INCS = -I. -I/usr/include -I${X11INC} -I${FREETYPEINC} +LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXft + +# flags +CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600 +CFLAGS += -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os ${INCS} ${CPPFLAGS} +LDFLAGS += -g ${LIBS} + +# compiler and linker +# CC = cc diff --git a/x11/st/st-scrollback-0.7.diff b/x11/st/st-scrollback-0.7.diff @@ -0,0 +1,387 @@ +diff --git a/config.def.h b/config.def.h +index b41747f..eae969e 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -7,6 +7,7 @@ + */ + static char font[] = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; + static int borderpx = 2; ++#define histsize 2000 + + /* + * What program is execed by st depends of these precedence rules: +@@ -172,6 +173,8 @@ static Shortcut shortcuts[] = { + { MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} }, + { MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} }, + { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, ++ { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, ++ { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, + }; + + /* +diff --git a/st.c b/st.c +index 2594c65..233d301 100644 +--- a/st.c ++++ b/st.c +@@ -86,6 +86,8 @@ char *argv0; + #define TRUERED(x) (((x) & 0xff0000) >> 8) + #define TRUEGREEN(x) (((x) & 0xff00)) + #define TRUEBLUE(x) (((x) & 0xff) << 8) ++#define TLINE(y) ((y) < term.scr ? term.hist[((y) + term.histi - term.scr \ ++ + histsize + 1) % histsize] : term.line[(y) - term.scr]) + + + enum glyph_attribute { +@@ -228,26 +230,6 @@ typedef struct { + int narg; /* nb of args */ + } STREscape; + +-/* Internal representation of the screen */ +-typedef struct { +- int row; /* nb row */ +- int col; /* nb col */ +- Line *line; /* screen */ +- Line *alt; /* alternate screen */ +- int *dirty; /* dirtyness of lines */ +- XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */ +- TCursor c; /* cursor */ +- int top; /* top scroll limit */ +- int bot; /* bottom scroll limit */ +- int mode; /* terminal mode flags */ +- int esc; /* escape state flags */ +- char trantbl[4]; /* charset table translation */ +- int charset; /* current charset */ +- int icharset; /* selected charset for sequence */ +- int numlock; /* lock numbers in keyboard */ +- int *tabs; +-} Term; +- + /* Purely graphic info */ + typedef struct { + Display *dpy; +@@ -327,6 +309,8 @@ typedef struct { + /* function definitions used in config.h */ + static void clipcopy(const Arg *); + static void clippaste(const Arg *); ++static void kscrolldown(const Arg *); ++static void kscrollup(const Arg *); + static void numlock(const Arg *); + static void selpaste(const Arg *); + static void xzoom(const Arg *); +@@ -340,6 +324,29 @@ static void sendbreak(const Arg *); + /* Config.h for applying patches and the configuration. */ + #include "config.h" + ++/* Internal representation of the screen */ ++typedef struct { ++ int row; /* nb row */ ++ int col; /* nb col */ ++ Line *line; /* screen */ ++ Line *alt; /* alternate screen */ ++ Line hist[histsize]; /* history buffer */ ++ int histi; /* history index */ ++ int scr; /* scroll back */ ++ int *dirty; /* dirtyness of lines */ ++ XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */ ++ TCursor c; /* cursor */ ++ int top; /* top scroll limit */ ++ int bot; /* bottom scroll limit */ ++ int mode; /* terminal mode flags */ ++ int esc; /* escape state flags */ ++ char trantbl[4]; /* charset table translation */ ++ int charset; /* current charset */ ++ int icharset; /* selected charset for sequence */ ++ int numlock; /* lock numbers in keyboard */ ++ int *tabs; ++} Term; ++ + /* Font structure */ + typedef struct { + int height; +@@ -399,8 +406,8 @@ static void tputtab(int); + static void tputc(Rune); + static void treset(void); + static void tresize(int, int); +-static void tscrollup(int, int); +-static void tscrolldown(int, int); ++static void tscrollup(int, int, int); ++static void tscrolldown(int, int, int); + static void tsetattr(int *, int); + static void tsetchar(Rune, Glyph *, int, int); + static void tsetscroll(int, int); +@@ -731,10 +738,10 @@ tlinelen(int y) + { + int i = term.col; + +- if (term.line[y][i - 1].mode & ATTR_WRAP) ++ if (TLINE(y)[i - 1].mode & ATTR_WRAP) + return i; + +- while (i > 0 && term.line[y][i - 1].u == ' ') ++ while (i > 0 && TLINE(y)[i - 1].u == ' ') + --i; + + return i; +@@ -796,7 +803,7 @@ selsnap(int *x, int *y, int direction) + * Snap around if the word wraps around at the end or + * beginning of a line. + */ +- prevgp = &term.line[*y][*x]; ++ prevgp = &TLINE(*y)[*x]; + prevdelim = ISDELIM(prevgp->u); + for (;;) { + newx = *x + direction; +@@ -811,14 +818,14 @@ selsnap(int *x, int *y, int direction) + yt = *y, xt = *x; + else + yt = newy, xt = newx; +- if (!(term.line[yt][xt].mode & ATTR_WRAP)) ++ if (!(TLINE(yt)[xt].mode & ATTR_WRAP)) + break; + } + + if (newx >= tlinelen(newy)) + break; + +- gp = &term.line[newy][newx]; ++ gp = &TLINE(newy)[newx]; + delim = ISDELIM(gp->u); + if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim + || (delim && gp->u != prevgp->u))) +@@ -839,14 +846,14 @@ selsnap(int *x, int *y, int direction) + *x = (direction < 0) ? 0 : term.col - 1; + if (direction < 0) { + for (; *y > 0; *y += direction) { +- if (!(term.line[*y-1][term.col-1].mode ++ if (!(TLINE(*y-1)[term.col-1].mode + & ATTR_WRAP)) { + break; + } + } + } else if (direction > 0) { + for (; *y < term.row-1; *y += direction) { +- if (!(term.line[*y][term.col-1].mode ++ if (!(TLINE(*y)[term.col-1].mode + & ATTR_WRAP)) { + break; + } +@@ -1012,13 +1019,13 @@ getsel(void) + } + + if (sel.type == SEL_RECTANGULAR) { +- gp = &term.line[y][sel.nb.x]; ++ gp = &TLINE(y)[sel.nb.x]; + lastx = sel.ne.x; + } else { +- gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0]; ++ gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0]; + lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1; + } +- last = &term.line[y][MIN(lastx, linelen-1)]; ++ last = &TLINE(y)[MIN(lastx, linelen-1)]; + while (last >= gp && last->u == ' ') + --last; + +@@ -1490,6 +1497,9 @@ ttyread(void) + /* keep any uncomplete utf8 char for the next call */ + memmove(buf, ptr, buflen); + ++ if (term.scr > 0 && term.scr < histsize-1) ++ term.scr++; ++ + return ret; + } + +@@ -1499,6 +1509,9 @@ ttywrite(const char *s, size_t n) + fd_set wfd, rfd; + ssize_t r; + size_t lim = 256; ++ Arg arg = (Arg){ .i = term.scr }; ++ ++ kscrolldown(&arg); + + /* + * Remember that we are using a pty, which might be a modem line. +@@ -1690,13 +1703,53 @@ tswapscreen(void) + } + + void +-tscrolldown(int orig, int n) ++kscrolldown(const Arg* a) ++{ ++ int n = a->i; ++ ++ if (n < 0) ++ n = term.row + n; ++ ++ if (n > term.scr) ++ n = term.scr; ++ ++ if (term.scr > 0) { ++ term.scr -= n; ++ selscroll(0, -n); ++ tfulldirt(); ++ } ++} ++ ++void ++kscrollup(const Arg* a) ++{ ++ int n = a->i; ++ ++ if (n < 0) ++ n = term.row + n; ++ ++ if (term.scr <= histsize - n) { ++ term.scr += n; ++ selscroll(0, n); ++ tfulldirt(); ++ } ++} ++ ++void ++tscrolldown(int orig, int n, int copyhist) + { + int i; + Line temp; + + LIMIT(n, 0, term.bot-orig+1); + ++ if (copyhist) { ++ term.histi = (term.histi - 1 + histsize) % histsize; ++ temp = term.hist[term.histi]; ++ term.hist[term.histi] = term.line[term.bot]; ++ term.line[term.bot] = temp; ++ } ++ + tsetdirt(orig, term.bot-n); + tclearregion(0, term.bot-n+1, term.col-1, term.bot); + +@@ -1710,13 +1763,20 @@ tscrolldown(int orig, int n) + } + + void +-tscrollup(int orig, int n) ++tscrollup(int orig, int n, int copyhist) + { + int i; + Line temp; + + LIMIT(n, 0, term.bot-orig+1); + ++ if (copyhist) { ++ term.histi = (term.histi + 1) % histsize; ++ temp = term.hist[term.histi]; ++ term.hist[term.histi] = term.line[orig]; ++ term.line[orig] = temp; ++ } ++ + tclearregion(0, orig, term.col-1, orig+n-1); + tsetdirt(orig+n, term.bot); + +@@ -1765,7 +1825,7 @@ tnewline(int first_col) + int y = term.c.y; + + if (y == term.bot) { +- tscrollup(term.top, 1); ++ tscrollup(term.top, 1, 1); + } else { + y++; + } +@@ -1930,14 +1990,14 @@ void + tinsertblankline(int n) + { + if (BETWEEN(term.c.y, term.top, term.bot)) +- tscrolldown(term.c.y, n); ++ tscrolldown(term.c.y, n, 0); + } + + void + tdeleteline(int n) + { + if (BETWEEN(term.c.y, term.top, term.bot)) +- tscrollup(term.c.y, n); ++ tscrollup(term.c.y, n, 0); + } + + int32_t +@@ -2371,11 +2431,11 @@ csihandle(void) + break; + case 'S': /* SU -- Scroll <n> line up */ + DEFAULT(csiescseq.arg[0], 1); +- tscrollup(term.top, csiescseq.arg[0]); ++ tscrollup(term.top, csiescseq.arg[0], 0); + break; + case 'T': /* SD -- Scroll <n> line down */ + DEFAULT(csiescseq.arg[0], 1); +- tscrolldown(term.top, csiescseq.arg[0]); ++ tscrolldown(term.top, csiescseq.arg[0], 0); + break; + case 'L': /* IL -- Insert <n> blank lines */ + DEFAULT(csiescseq.arg[0], 1); +@@ -2871,7 +2931,7 @@ eschandle(uchar ascii) + return 0; + case 'D': /* IND -- Linefeed */ + if (term.c.y == term.bot) { +- tscrollup(term.top, 1); ++ tscrollup(term.top, 1, 1); + } else { + tmoveto(term.c.x, term.c.y+1); + } +@@ -2884,7 +2944,7 @@ eschandle(uchar ascii) + break; + case 'M': /* RI -- Reverse index */ + if (term.c.y == term.top) { +- tscrolldown(term.top, 1); ++ tscrolldown(term.top, 1, 1); + } else { + tmoveto(term.c.x, term.c.y-1); + } +@@ -3047,7 +3107,7 @@ tputc(Rune u) + void + tresize(int col, int row) + { +- int i; ++ int i, j; + int minrow = MIN(row, term.row); + int mincol = MIN(col, term.col); + int *bp; +@@ -3087,6 +3147,14 @@ tresize(int col, int row) + term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty)); + term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs)); + ++ for (i = 0; i < histsize; i++) { ++ term.hist[i] = xrealloc(term.hist[i], col * sizeof(Glyph)); ++ for (j = mincol; j < col; j++) { ++ term.hist[i][j] = term.c.attr; ++ term.hist[i][j].u = ' '; ++ } ++ } ++ + /* resize each row to new width, zero-pad if needed */ + for (i = 0; i < minrow; i++) { + term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph)); +@@ -3976,11 +4044,11 @@ drawregion(int x1, int y1, int x2, int y2) + term.dirty[y] = 0; + + specs = term.specbuf; +- numspecs = xmakeglyphfontspecs(specs, &term.line[y][x1], x2 - x1, x1, y); ++ numspecs = xmakeglyphfontspecs(specs, &TLINE(y)[x1], x2 - x1, x1, y); + + i = ox = 0; + for (x = x1; x < x2 && i < numspecs; x++) { +- new = term.line[y][x]; ++ new = TLINE(y)[x]; + if (new.mode == ATTR_WDUMMY) + continue; + if (ena_sel && selected(x, y)) +@@ -4000,7 +4068,8 @@ drawregion(int x1, int y1, int x2, int y2) + if (i > 0) + xdrawglyphfontspecs(specs, base, i, ox, y); + } +- xdrawcursor(); ++ if (term.scr == 0) ++ xdrawcursor(); + } + + void diff --git a/x11/st/tar b/x11/st/tar @@ -0,0 +1 @@ +http://dl.suckless.org/st/st-0.7.tar.gz diff --git a/x11/xdg/profile b/x11/xdg/profile @@ -0,0 +1,17 @@ +export XDG_DATA_HOME="$ROOT/share" +export XDG_DATA_DIRS="$ROOT/share" + +export XDG_CONFIG_HOME="$ROOT/etc" +export XDG_CONFIG_DIRS="$ROOT/etc" + +export XDG_CACHE_HOME="$ROOT/var/cache" +export XDG_DOWNLOAD_DIR="$ROOT/var/tmp" + +export XDG_MUSIC_DIR="$ROOT/lib/music" +export XDG_VIDEOS_DIR="$ROOT/lib/videos" +export XDG_PICTURES_DIR="$ROOT/lib/images" +export XDG_DOCUMENTS_DIR="$ROOT/lib/documents" + +export XDG_DESKTOP_DIR="/tmp" +export XDG_TEMPLATES_DIR="/tmp" +export XDG_PUBLICSHARE_DIR="/tmp" diff --git a/xdg/profile b/xdg/profile @@ -1,17 +0,0 @@ -export XDG_DATA_HOME="$ROOT/share" -export XDG_DATA_DIRS="$ROOT/share" - -export XDG_CONFIG_HOME="$ROOT/etc" -export XDG_CONFIG_DIRS="$ROOT/etc" - -export XDG_CACHE_HOME="$ROOT/var/cache" -export XDG_DOWNLOAD_DIR="$ROOT/var/tmp" - -export XDG_MUSIC_DIR="$ROOT/lib/music" -export XDG_VIDEOS_DIR="$ROOT/lib/videos" -export XDG_PICTURES_DIR="$ROOT/lib/images" -export XDG_DOCUMENTS_DIR="$ROOT/lib/documents" - -export XDG_DESKTOP_DIR="/tmp" -export XDG_TEMPLATES_DIR="/tmp" -export XDG_PUBLICSHARE_DIR="/tmp" diff --git a/yacc/tar b/yacc/tar @@ -1 +0,0 @@ -http://invisible-island.net/datafiles/release/byacc.tar.gz diff --git a/yasm/tar b/yasm/tar @@ -1 +0,0 @@ -http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz diff --git a/zlib/build.sh b/zlib/build.sh @@ -1,13 +0,0 @@ -#!/bin/sh -set -e - -export LDFLAGS="$LDFLAGS -Wl,-rpath-link=$SYSROOT$PREFIX/lib" -export CC="$CC -L$SYSROOT/lib -isystem $SYSROOT/include" -export CPPFLAGS="-D_GNU_SOURCE" - -./configure $CONFFLAGS \ - --prefix="$PREFIX" - -make $MAKEFLAGS -make $MAKEFLAGS DESTDIR="$DESTDIR" install - diff --git a/zlib/lastversion.sh b/zlib/lastversion.sh @@ -1,2 +0,0 @@ -#!/bin/sh -curl -s "http://zlib.net/"|grep -oE 'zlib-[0-9\.]*[0-9]'|cut '-d-' -f2|sort -Vu|tail -n 1 diff --git a/zlib/source.sh b/zlib/source.sh @@ -1,2 +0,0 @@ -#!/bin/sh -echo "http://zlib.net/zlib-$VERSION.tar.xz" diff --git a/zlib/version b/zlib/version @@ -1 +0,0 @@ -1.2.11