A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

What "Wide character in print" means in Perl (hint: UTF8)

 It means there is a glitch in the matrix - agents are coming!

(further reading)

Hack your own MySQL to log in as root

$> sudo service mysql stop

$> mysqld --skip-grant-tables

$> mysql

mysql> FLUSH PRIVILEGES;

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';

mysql> SELECT host, user, plugin FROM mysql.user;

(source)

Note-taking apps for desktop, web and mobile

November 2021

Joplin

Tomboy

  • Tomboy appears very linux-centric, although it has clients for Windows and Mac too.
  • It has an Android app, TomDroid.
  • It has a WebDAV plugin for publishing to the web
  • No web actual app

Evernote

  • Proprietary software
  • Charges actual money
  • Irritating business practices
  • Free version only allows two devices, which isn't enough

Org mode

Colornote

  • Works brilliantly on Android
  • Super fast for short notes
  • No web app

Others

Delete all files except one on linux

Glob

  • shopt -s extglob
  • rm -v !("filename")
  • rm -v !("filename1"|"filename2")
  • rm -v !(*.zip|*.odt)
  • shopt -u extglob
Find
  • find /directory/ -type f -not -name 'PATTERN' -delete
  • find /directory/ -type f -not -name 'PATTERN' -print0 | xargs -0 -I {} rm {}
  • find /directory/ -type f -not -name 'PATTERN' -print0 | xargs -0 -I {} rm [options] {}
  • find . -type f -not \(-name '*gz' -or -name '*odt' -or -name '*.jpg' \) -delete
Glob ignore
  • cd test
  • GLOBIGNORE=*.odt:*.iso:*.txt
  • rm -v *
  • unset GLOBIGNORE

All the homebrew packages I've installed on Mac OSX

I've used `brew install ....` many times, but now I'm regretting it because:

  • `brew update` takes so incredibly long to run, and downloads lots of unnecessary git history
  • `/usr/local/Cellar` is 3.8Gb big and I'm short on disk space
List of brew installed apps, in date order:
  • redis@4.0
  • watch
  • tree
  • dnsmasq
  • libunistring
  • libxmlsec1
  • xmlsec1
  • ack
  • putty
  • cmatrix
  • the_silver_searcher
  • ag
  • youtube-dl
  • elasticsearch@6.7
  • vbindiff
  • libpng
  • ilmbase
  • oniguruma
  • jq
  • telnet
  • gifsicle
  • fontconfig
  • tidy-html5
  • minio
  • gcc@4.9
  • autoenv # bugged: breaks "cd -"
  • direnv
  • maven@3.6
  • htop-osx
  • htop
  • xvid
  • npm
  • node@14
  • lsd
  • id3v2
  • nghttp2
  • gnutls
  • sphinx-doc
  • protobuf@3.17
  • markdown
  • postgres@13
  • ruby
  • httrack
  • chafa
  • wget
  • python@3.7
  • python2
  • coreutils
  • ctags-exuberant
  • ctags