diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-12-06 23:03:44 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-12-07 09:41:16 -0700 |
commit | 13f08e9d36de02c54283993d2bd035adf13f0411 (patch) | |
tree | 8270a1dfe4916b9e70e173f4b2957d86e56e9e12 /archive | |
parent | e27b9fcc8e89e847a4c7f7f6a80cc15e991dd260 (diff) | |
download | dotfiles-13f08e9d36de02c54283993d2bd035adf13f0411.tar.gz |
bin/: some straightforward tidying up
Diffstat (limited to 'archive')
-rwxr-xr-x | archive/bin/debian-ftp-master-cut-note | 18 | ||||
-rwxr-xr-x | archive/bin/grml-live-git | 37 | ||||
-rwxr-xr-x | archive/bin/hexographer | 4 | ||||
-rwxr-xr-x | archive/bin/i3-rotate-wallpaper | 5 | ||||
-rwxr-xr-x | archive/bin/in-develacc | 17 | ||||
-rwxr-xr-x | archive/bin/philpapers-bib | 25 | ||||
-rwxr-xr-x | archive/bin/propellor_lines | 20 | ||||
-rwxr-xr-x | archive/bin/sblog | 12 |
8 files changed, 136 insertions, 2 deletions
diff --git a/archive/bin/debian-ftp-master-cut-note b/archive/bin/debian-ftp-master-cut-note new file mode 100755 index 00000000..435ba9c8 --- /dev/null +++ b/archive/bin/debian-ftp-master-cut-note @@ -0,0 +1,18 @@ +#!/bin/sh + +# note this script may not work if triggered using a keybinding that +# involves a modifier key, because the script will run before the +# modifier key has been released (the first 'sleep' ought to mitigate +# this problem at least somewhat) + +set -e + +emacsclient -eval '(with-current-buffer "*NEW notes*" + (gui-set-selection nil (buffer-string)) + (erase-buffer))' +# select this window ready for processing the next package +wmctrl -a "ftp-master GNU mc session" +sleep 0.2 +wmctrl -a "ftp-master dak command session" +sleep 0.2 +xdotool getactivewindow mousemove --window %1 --polar 0 0 click 2 diff --git a/archive/bin/grml-live-git b/archive/bin/grml-live-git new file mode 100755 index 00000000..dc2b051d --- /dev/null +++ b/archive/bin/grml-live-git @@ -0,0 +1,37 @@ +#!/bin/sh + +# usage e.g., as root: +# % cd ~/local/big +# % grml-live-git -s buster -a amd64 -c GRMLBASE,GRML_FULL,AMD64,SPWHITTON + +set -e + +us="$(basename $0)" + +if ! [ -e "$HOME/src/grml-live/.git" ]; then + echo >&2 "$us: grml-live not checked out" + exit 1 +fi + +cd "$HOME/src/grml-live" + +if ! [ -z "$(git status --porcelain)" ]; then + echo >&2 "$us: changes should be committed first" + exit 1 +fi + +if ! git verify-commit --raw HEAD 2>&1 \ + | grep "VALIDSIG .* 8DC2487E51ABDD90B5C4753F0F56D0553B6D411B"; then + echo >&2 "$us: grml-live branch commit not signed by Sean" + exit 1 +fi + +# standard env vars for running grml-live from git +export GRML_FAI_CONFIG="$HOME/src/grml-live/etc/grml/fai" +export SCRIPTS_DIRECTORY="$HOME/src/grml-live/scripts" +export LIVE_CONF="$HOME/src/grml-live/etc/grml/grml-live.conf" + +# use apt-cacher-ng +export APT_PROXY="http://localhost:3142/" + +./grml-live -t $HOME/src/grml-live/templates/ -S $HOME/src/grml-live/scripts/ $@ diff --git a/archive/bin/hexographer b/archive/bin/hexographer new file mode 100755 index 00000000..98843deb --- /dev/null +++ b/archive/bin/hexographer @@ -0,0 +1,4 @@ +#!/bin/sh + +firejail --profile=~/.config/firejail/hexographer.profile \ + java -jar -Xmx2000M ~/lib/annex/big/software/hexographer.jar diff --git a/archive/bin/i3-rotate-wallpaper b/archive/bin/i3-rotate-wallpaper index b31bf91f..43f84462 100755 --- a/archive/bin/i3-rotate-wallpaper +++ b/archive/bin/i3-rotate-wallpaper @@ -35,7 +35,8 @@ push @images, chomp @images; system "resize-wallpapers-for-outputs", @images; -system "i3-startup-always" if $ENV{DISPLAY}; +system "$ENV{HOME}/src/dotfiles/scripts/desktop/i3-startup-always" + if $ENV{DISPLAY}; # if [ -n "$img" ]; then # # this will just size up images with the correct aspect ratio. For @@ -51,7 +52,7 @@ system "i3-startup-always" if $ENV{DISPLAY}; # # $HOME/local/wallpaper.png # # this calls feh -# [ -n "$DISPLAY" ] && i3-startup-always +# [ -n "$DISPLAY" ] && ~/src/dotfiles/scripts/desktop/i3-startup-always # fi # # do develacc too, though we can't call i3-startup-always diff --git a/archive/bin/in-develacc b/archive/bin/in-develacc new file mode 100755 index 00000000..85369e93 --- /dev/null +++ b/archive/bin/in-develacc @@ -0,0 +1,17 @@ +#!/bin/sh + +# are we inside my develacc chroot? + +# # from /etc/bash.bashrc on Debian +# if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then +# debian_chroot=$(cat /etc/debian_chroot) +# fi + +# if [ "$debian_chroot" = "develacc" ] \ +# && [ "$(systemd-detect-virt)" = "systemd-nspawn" ]; then +# exit 0 +# else +# exit 1 +# fi + +test "$(hostname)" = "develacc" diff --git a/archive/bin/philpapers-bib b/archive/bin/philpapers-bib new file mode 100755 index 00000000..e5c575a9 --- /dev/null +++ b/archive/bin/philpapers-bib @@ -0,0 +1,25 @@ +#!/bin/sh + +# update copy of my collection of references from philpapers.org + +# I just keep them all in a single bibliography, #205586. +# Categorising them into separate bibliography files doesn't achieve +# much and makes downloading them to .bib files more complicated + +id="205586" +path="$HOME/doc/papers/philpapers.bib" +link="$HOME/doc/papers/${id}.bib" + +# this should include every entry in the bibliography, but it's +# possible that the site limits how many it will include. If I hit +# such a limit, I might have to split into two bibs (I'd only need to +# download one of them with this script, and the other could be +# frozen) +uri="http://philpapers.org/browse/${id}?categorizerOn=&langFilter=&showCategories=on&hideAbstracts=&newWindow=on&onlineOnly=&proOnly=on&filterByAreas=&publishedOnly=&freeOnly=&cId=${id}&sqc=&sort=&format=bib&start=&limit=&jlist=&ap_c1=&ap_c2=" +date=$(date) + +echo "@Comment{ PhilPapers bibliography #${id}, exported as of $date }\n" >$path + +wget -O- $uri >>$path + +test -L $link || ln -s $(basename $path) $link diff --git a/archive/bin/propellor_lines b/archive/bin/propellor_lines new file mode 100755 index 00000000..8bdd28e1 --- /dev/null +++ b/archive/bin/propellor_lines @@ -0,0 +1,20 @@ +#!/usr/bin/runhaskell + +main = interact $ unlines . propellorLines . lines + +propellorLines :: [String] -> [String] +propellorLines (x:xs) = ("[ " ++ wrapEscapeLine x) : propellorLines' xs + +propellorLines' :: [String] -> [String] +propellorLines' = foldr step ["]"] + where + step x xs = (", " ++ wrapEscapeLine x) : xs + +wrapEscapeLine :: String -> String +wrapEscapeLine line = "\"" ++ (foldr step "" line) ++ "\"" + where + step x xs + | x == '\t' = "\\t" ++ xs + | x == '\\' = x : x : xs + | x == '"' = '\\' : x : xs + | otherwise = x : xs diff --git a/archive/bin/sblog b/archive/bin/sblog new file mode 100755 index 00000000..cded87db --- /dev/null +++ b/archive/bin/sblog @@ -0,0 +1,12 @@ +#!/usr/bin/perl + +# try to view latest debuild/sbuild log + +use strict; +use warnings; + +chomp( my $version = `dpkg-parsechangelog -SVersion` ); +chomp( my $package = `dpkg-parsechangelog -SSource` ); +chomp( my $arch = `dpkg --print-architecture` ); + +system "less ../${package}_${version}_$arch.build"; |