Soy Sauce

Last Updated or created 2022-11-08

Fermentation day again .. today, Soy Sauce

  • Soybeans 1 kg
  • All-purpose flour 200 g
  • Koji Starter 8-10 g
  • Salt 1 kg
  • Water 2 litres

Best to lookup howto on the internet

Personal BWW music files search engine.

Last Updated or created 2024-03-07

I’ve a lot of bagpipe writer music files, many are the same tune but a little different.

find -type f | egrep -i "bww$|bmw$" | wc -l
34565

Most contain information about composers, complete title, arrangements and information about harmony and seconds/thirds/whatever.

So I made a PHP search script and a BASH indexer.
(This is NOT a safe script to use servers with internet access)

PHP

Strict Search: <form method="post" action="?"><input type="Text" name="words" size=40 value=""><input type="Submit" name="submit" value="search"></form>
Fuzzy Search: <form method="post" action="?"><input type="Text" name="words2" size=40 value=""><input type="Submit" name="submit" value="search">Fuzzy-ness<input type="Text" name="words2key" size=1 value="3"></form>
Parsons Search: <form method="post" action="?"><input type="Text" name="words3" size=40 value=""><input type="Submit" name="submit" value="search">Fuzzy-ness<input type="Text" name="words2key" size=1 value="3"></form>

<P><PRE>
<?PHP
if ($_POST['words']) {
$words = preg_replace("(\r\n|\n|\r)", "", $_POST['words']); 
$words = preg_replace("/[^0-9a-z]/i",'', $words);
$command = "/bin/cat /var/www/html/findbww/bww.list |/bin/grep -i $words | sed 's/*\w\+//' | sed 's/\\/private\\/Private\\/Henri\\/save\\/move\\/cds-uitzoeken\\///g' ";
$blah=shell_exec($command);
$blah=str_replace("$words", "<b><font color=red>$words</font></b>",$blah);
print $blah;
}
if ($_POST['words2']) {
$words=$_POST['words2'];
$words2key=$_POST['words2key'];
$words = preg_replace("(\r\n|\n|\r)", "", $words); 
$words = preg_replace("/[^0-9a-z]/i",'', $words);
$command = "/bin/cat /var/www/html/findbww/bww.list |/usr/bin/agrep -$words2key -i $words | sed 's/*\w\+//' |  sed 's/\\/private\\/Private\\/Henri\\/save\\/move\\/cds-uitzoeken\\///g'";
$blah=shell_exec($command);
$blah=str_replace("$words", "<b><font color=red>$words</font></b>",$blah);
print $blah;
}
if ($_POST['words3']) {
$words=$_POST['words3'];
$words2key=$_POST['words2key'];
$words = preg_replace("(\r\n|\n|\r)", "", $words); 
$words = preg_replace("/[^0-9a-z]/i",'', $words);
$command = "/bin/cat /var/www/html/findbww/bww.list.parsons |/usr/bin/agrep -$words2key -i $words | sed 's/*\w\+//' |  sed 's/\\/private\\/Private\\/Henri\\/save\\/move\\/cds-uitzoeken\\///g'";
$blah=shell_exec($command);
$blah=str_replace("$words", "<b><font color=red>$words</font></b>",$blah);
print $blah;
}
?>
</PRE>

Bash indexer (uses agrep)

#!/bin/bash
[ `find /FULLPATH/Music/Bagpipe-music-writer/ -type f  | wc -l` -eq 0 ] && exit
cd /var/www/html/findbww
: > bww.list
: > bww.list.parsons
locate -i bww |  egrep -i "\.bww$" |grep -v html.bww|  while read tunepath; do
tune=$(basename "$tunepath")
keywords=$(cat "$tunepath" |  egrep -vi "FontSizes|FrequencyMappings|GracenoteDurations|InstrumentMappings|MIDINoteMappings|TuneFormat|VariationTempo|TuneTempo|Bagpipe Reader" | awk -F',\\(' '{ print $1 }' 
| grep -v \"\" | grep -v ^! | grep -v "Converted from" | grep ^\" |tr '\n' ','| tr -d "\015")
parsons=$(./parsons "$tunepath")
echo "$tunepath,$tune,$keywords" >> bww.list
echo "$tunepath,$parsons" >> bww.list.parsons
done

locate -i bwm |  egrep -i "\.bwm$" |grep -v html.bwm|  while read tunepath; do
tune=$(basename "$tunepath")
keywords=$(cat "$tunepath" |  egrep -vi "FontSizes|FrequencyMappings|GracenoteDurations|InstrumentMappings|MIDINoteMappings|TuneFormat|VariationTempo|TuneTempo|Bagpipe Reader" | awk -F',\\(' '{ print $1 }' 
| grep -v \"\" | grep -v ^! | grep -v "Converted from" | grep ^\" |tr '\n' ','| tr -d "\015")
parsons=$(./parsons "$tunepath")
echo "$tunepath,$tune,$keywords" >> bww.list
echo "$tunepath,$parsons" >> bww.list.parsons
done
chown www-data bww.list*

Converting for parsons code.
See https://www.henriaanstoot.nl/2022/03/23/20-years-www-pipetunesearch-org/
and https://en.wikipedia.org/wiki/Parsons_code

#!/bin/bash
echo -n "\""
for f in `cat "$1"` ;do echo "$f" |  tr -cd "[A-HL]_[0-9]" ; echo  ; done | grep -v '^$' |grep _ > /tmp/parsons
let count=0
for f in `cat /tmp/parsons| tr -cd "[A-HL] \n"` ;do
  if [ "$f" = "LG" ] ; then g=0; fi
  if [ "$f" = "LA" ] ; then g=1; fi
  if [ "$f" = "B" ] ; then g=2; fi
  if [ "$f" = "C" ] ; then g=3; fi
  if [ "$f" = "D" ] ; then g=4; fi
  if [ "$f" = "E" ] ; then g=5; fi
  if [ "$f" = "F" ] ; then g=6; fi
  if [ "$f" = "HG" ] ; then g=7; fi
  if [ "$f" = "HA" ] ; then g=8; fi
 if [ $count -eq 0 ] ;then 
  echo -n "*"; 
  ((count++))
  last=$g
 else
 if [ "2$g" -eq "2$last" ] ; then echo -n "r" ; fi
 if [ "2$g" -lt "2$last" ] ; then echo -n "d" ; fi
 if [ "2$g" -gt "2$last" ] ; then echo -n "u" ; fi
 last=$g
fi
done
echo "\""

Just place all files in a directory on a php enabled webserver.
The bash script is being run daily.
(parsons bash script is called from this main script)
These will generate 2 files
One with the filename and all useful text like composers.
And a file with the filename and the parsons code.
Example:

11th of September, The.bww,"*udduddudduddudurrdudrrdudduddudrrduuuuududurrdudrrurrdududurrdudrrduddudurrduudduddudduddududdurdudrurdduddududr
urduuudrduddurdudrudrurduududdurdudrurdduddururdududduddudduddudruddudruddudduddudruddruududududududrudurddrududruddudrudduddudurddrudrrudrrudrrudrrudrrudrrudrrudrrudrrudrrudrrudrrudrrudrrudrrudrrudrrudrrud
rrudrrudrrudrrudrrudrrudrrudrrudrrudrruuduuduuduuduuduuudrduuduurduuduuurdrduuduuduuuduurduuduuduuduuduu"

Example screenshots

Fun with Xrandr

Last Updated or created 2023-02-15

xrandr is an official configuration utility to the RandR (Resize and Rotate) X Window System extension. It can be used to set the size, orientation or reflection of the outputs for a screen.

Someone broke my screen at a hackers event. The terminal was really hard to read with the black parts, so i tilted the screen

Quiet friday at work, playing with my little trusty 2530p.
I’m using xmonad, so i don’t need any fancy work laptop.

Another quiet friday at work, working from home, i turned all monitoring displays upside-down, sideways, or rotated them every so much seconds.

While this is a lot of fun to use, i used this to get my monitorsetups exactly the way i wanted, at home or at work.
Different screen sizes, height differences .. no problem.

A fun tool to use is:
https://github.com/qurn/xrandr-keystone-helper

Some scripts:

# VGA off
xrandr --output VGA1 --off

# examples
xrandr --output LVDS1 --mode 1280x800 --output VGA1 --mode 1280x1024 --pos 0x1280 --left-of LVDS1
xrandr --output LVDS-1 --mode 1280x800 --output SVIDEO-1 --mode 1920x1080 --pos 0x0 --left-of SVIDEO-1
xrandr --output LVDS-1 --mode 1280x800 --pos 0x1920 --output VGA-1 --mode 1920x1080 --pos 0x2200 --right-of LVDS-1 --output DVI-I-1-1 --mode 1920x1080 --pos 0x0 --left-of LVDS-1

# zoomthingy
xrandr --output VGA1 --mode 1920x1080 --panning 1920x1080
xrandr --output VGA1 --mode 640x480 --panning 1920x1080+2910+0 --scale 1x1

# fix detection
xrandr --setprovideroutputsource 1 0

# add mode
xrandr --addmode DP-1 1440x720

# transform (see also terminal picture above)
xrandr --output LVDS --mode 1366x768 --panning 1166x768 --transform 1,0,-200,0,1,0,0,0,1

# Funky stuff
for f in `seq 1 9` ;do echo xrandr --output LVDS1 --transform 0.5403,-0.8$(echo -n $f)41,0,0.841,0.5403,0,0,0,1.5 ; sleep 5; done ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
for f in `seq 1 9` ;do echo xrandr --output LVDS1 --transform 0.5403,-0.8$f41,0,0.841,0.5403,0,0,0,1.5 ; sleep 5; done ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
for f in `seq 1 9` ;do xrandr --output LVDS1 --transform 0.1$(echo -n $f)5403,-0.8$(echo -n $f)41,0,0.841,0.5403,0,0,0,1.5 ; sleep 2; done ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
for f in `seq 1 9` ;do xrandr --output LVDS1 --transform 0.4$(echo -n $f)5403,-0.8$(echo -n $f)41,0,0.5$(echo -n $f)841,0.5403,0,0,0,1.5 ; sleep 1; done ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
for f in `seq 1 9` ;do xrandr --output LVDS1 --transform 0.4$(echo -n $f)5403,-0.8$(echo -n $f)41,0,0.5$(echo -n $f)841,0.5$(echo -n $f)403,0,0,0,1.5 ; sleep 1; done ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
for f in `seq 1 9` ;do xrandr --output LVDS1 --transform 0.4$(echo -n $f)5403,-0.8$(echo -n $f)41,0,0.$(echo -n $f)841,0.5403,0,0,0,1.5 ; sleep 2; done ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
for f in `seq 1 9` ;do xrandr --output LVDS1 --transform 0.5403,-0.8$(echo -n $f)41,0,0.841,0.5403,0,0,0,1.5 ; sleep 5; done ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
for f in `seq 1 9` ;do xrandr --output LVDS1 --transform 0.5403,-0.8$f41,0,0.841,0.5403,0,0,0,1.5 ; sleep 5; done ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
for f in `seq 1 9` ;do xrandr --output LVDS1 --transform 0.5$(echo -n $f)403,-0.8$(echo -n $f)41,0,0.8$(echo -n $f)41,0.5$(echo -n $f)403,0,0,0,1.5 ; sleep 5; done ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
for f in `seq 1 9` ;do xrandr --output LVDS1 --transform 0.5$f403,-0.841,0,0.841,0.5403,0,0,0,1.5 ; sleep 5; done ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
for f in `seq 1 9` ;do xrandr --output LVDS1 --transform 0.5$f403,-0.841,0,0.841,0.5403,0,0,0,1.5 ; sleep 5; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1; done
for f in `seq 1 9` ;do xrandr --output LVDS1 --transform 0.$(echo -n $f)5403,-0.8$(echo -n $f)41,0,0.841,0.5403,0,0,0,1.5 ; sleep 2; done ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
for f in `seq 1 9` ;do xrandr --output LVDS1 --transform 0.$f403,-0.841,0,0.841,0.5403,0,0,0,1.5 ; sleep 5; done ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.1,0.1,0,0.1,1,0,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform -0.11038,0.993888,0,-0.99388,-0.11038,0,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform -0.11,0.99,0,-0.99,-0.11,0,0,0,1
xrandr --output LVDS1 --transform 0.15425,0.988,0,-0.988,0.15425,0,0,0,1
xrandr --output LVDS1 --transform 0.2,-0.2,0,0.2,0.2,0,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5,-0.5,0,0.5,0.5,0,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5,0.5,0,0.5,1,0,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.54030,-0.841,0.841,0.54030,0,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.54030,-0.841,0.841,0.5403,0,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0,0.841,0.5403,0,0,0,0.1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0,0.841,0.5403,0,0,0,1.1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0,0.841,0.5403,0,0,0.1,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform -0.5403,-0.841,0,0.841,0.5403,0,0,0,1.5 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0,-0.841,0.5403,0,0,0,1.5 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0,0.841,-0.5403,0,0,0,1.5 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0,0.841,0.5403,0,0,0,1.5 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,0.841,0,0.841,0.5403,0,0,0,1.5 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0,0.841,0.5403,0,0,0,1 --scale 2x2; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0,0.841,0.5403,0,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0,0.841,0.5403,0,0,0,2 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0,0.841,0.5403,0,0.1,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0,0.841,0.5403,0.1,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0.1,0.841,0.5403,0,0,0,1.5 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0.1,0.841,0.5403,0,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.5403,-0.841,0.841,0.5403,0,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.9,-0.1,30,0.1,0.9,-80,0,0,0.8 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.9,-0.9,0,0.9,0.9,0,0,0,1 --scale 1.1x1.1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.9,-0.9,0,0.9,0.9,0,0,0,1 --scale 1.5x1.5 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.9,-0.9,0,0.9,0.9,0,0,0,1 --scale 2x2 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.9,-0.9,0,0.9,0.9,0,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 0.9,-0.9,-0.1,30,0.1,0.9,-80,0,0,0.8 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 1.1,1.1,0,1.1,1,0,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1
xrandr --output LVDS1 --transform 2.1,2.1,0,2.1,1,0,0,0,1 ; sleep 5 ; xrandr --output LVDS1 --transform 0,0.10,-124,0,1.24,0,0,0.000316,1 --scale 1x1