revert broken Fenix update 20.08.20 Firefox mobile

  1. Download the last APK version 68.11.0.
  2. Search the app in Google Play and disable auto-updates (three dots).

The update destroyed all your browser and plugin configurations. There is no sane way to get them back. Other than that, your browser will work again.

I am not aware that there is any fork of the old Firefox in the Play Store.

This page or post was last modified on 2022-09-15 .

my Notion keybindings

If you haven't tried Notion yet, you should. It is the only tiled and tabbed window manager that truly works well.

The default keyboard shortcuts aren't the best however, and they aren't easy to remember either. I have been using Notion for 15 years now, and I wouldn't know how to do it any better.

  • The mod key is the windows key.
  • F2 opens Urxvt, F3 any command. Middle mouse click the window frame for a menu, or press F12.
  • C closes the window, add shift to kill.
  • Z/X are for switching workspaces "left/right". Add shift and you switch monitors instead.
  • WASD are for frame navigation. Add shift to split the frame in that direction and the cursor is placed in the new frame.
  • Q to tag frame, E to attach the tagged frame.
  • Tab cycles through frame tabs, with shift backwards.
  • R to resize (with arrow keys). Hold shift before to shrink.
  • Return is fullscreen, space is float window, space shift nudge, grave ( ` ) is scratchpad.
  • F10 Go to window, F8 disables Notion keybindings, F1 suspend.

Most things can be done with only the left hand (for normal use) and all vital things even with only the mouse (for watching Youtube on couch while eating). Things are easy to remember as they work akin to known shortcut configurations, like WASD for directional keys, Mod + enter for fullscreen or Mod + tab to cycle tabs. Or if its not clunky they work by abbreviation (C for close, R for resize), or spacial symmetries (Q -> E for tag -> attach sits atop of WASD, Z/X for left/right below WASD).

Files for Download:

keyboard_reference.html (interactive version)

 

This page or post was last modified on 2022-09-15 .

useful Linux command shortcuts

Record Audio

RECORD="filename";arecord -v -f cd -t raw | lame -r -b 192 - ${RECORD}.mp3 

Convert Video: Works with Whatsapp and Instagram

VIDEOCONVERT=00:00:00; TOOO=00:00:10; VID=input_video.avi; ffmpeg -i $VID -ss $WHATSAPP `if [[ "$TOOO" =~ [0-9][0-9]:[0-9][0-9]:[0-9][0-9] ]]; then echo "-to $TOOO"; fi` -y -c:v libx264 -pix_fmt yuv420p -preset slow -tune zerolatency -crf 19 -level 3.1 -movflags +faststart -c:a aac -b:a 128k -ar 44100 `echo "$VID" | sed -r "s/\..+$//g"`.out.mp4

Grab screen with sound: There are actually several unresolved ffmpeg bug reports, because using x11grab along with alsa will result in immediate buffer underruns. But some dude on Stackoverflow figured out that you have to use the -rtbufsize and -probesize parameters. Format works for Instagram and Whatsapp. Better use OBS Studio though.

SCREENCAPTURE="out"; GSIZE="1080x1080"; GOFF="0,0"; ffmpeg -rtbufsize 1500M -f alsa -i default -video_size $GSIZE -framerate 30 -rtbufsize 100M -f x11grab -i :0.0+$GOFF -probesize 10M -c:v libx264 -pix_fmt yuv420p -preset ultrafast -tune zerolatency -c:a aac -b:a 256k -ar 44100 ${SCREENCAPTURE}.mp4 -y

Set default apps: This is a total hack. Like you can see, it deletes only the default apps from your preferences and then pumps all files supported by the listed particular applications into it, starting with the most favorable. If you do not do this, then file extensions will be opened by alphabetical order, which is total garbage.

DEFAULT_APPS="org.gnome.FileRoller chromium thunderbird krita_raw gimp gpicview org.gnome.Evince mplayer audacious org.gnome.gedit wine"; if [ -n "$ZSH_VERSION" ]; then setopt shwordsplit; fi; x="${HOME}/.config/mimeapps.list"; y="${HOME}/.local/share/applications/mimeapps.list"; if test -f "$y"; then rm "$y"; ln -s "$x" "$y"; fi; rm /tmp/Awwwk*.txt >& /dev/null; if not grep -q "\[Default Applications\]" "$x"; then echo "[Default Applications]" >> "$x"; fi; awk '/^\[.*\]/{x="/tmp/Awwwk"++i".txt";}{print > x;}' "$x" && { rm "$x"; for i in `seq 16`; do if test -f "/tmp/Awwwk${i}.txt" && grep -q "\[Default Applications\]" /tmp/Awwwk${i}.txt; then rm /tmp/Awwwk${i}.txt; fi; done; for i in `seq 16`; do if test -f "/tmp/Awwwk${i}.txt"; then cat /tmp/Awwwk${i}.txt >> $x; fi; done; echo "[Default Applications]" >> $x; for app in $DEFAULT_APPS; do grep "^MimeType=" /usr/share/applications/${app}.desktop | sed "s/^MimeType=//" | sed "s/;[[:space:]]*$//" | tr ';' '\n' | sed "s/^[[:space:]]*//" | sed "s/$/=${app}.desktop/" >> "$x"; done; echo -e "application/x-dosexec=wine.desktop\napplication/x-msdownload=wine.desktop\naudio/mpeg=mplayer.desktop\naudio/x-mpeg=mplayer.desktop" >> "$x";  echo "done"; }

Github commit: with auto credential insert and submodule update

GIT="new"; GPASS="secret"; GUSER="me555"; if ! git remote get-url origin | grep -q "$GPASS"; then git remote set-url origin `git remote get-url origin | sed "s#^https://#https://${GUSER}:${GPASS}@#g"`; fi ; git submodule update --remote --recursive; git add -u; git add  * .*; git commit -m "$GIT"; git push origin master

Kill every wine

WINEKILL=; WPIDS=""; for n in $(ps aux | grep "\(:\\\.*\.e[x]e\|"[^[:space:]]*wi[n]e[^[:space:]]*$"\)" |  (cat && echo "$(ps aux | grep "\.exe" | grep defunct)") | (cat && echo "$(ps aux | grep "\.exe$")") | grep -os "^[^[:space:]]*[[:space:]]*[0-9]*" | grep -os "[0-9]*$" | tr '\n' ' '); do WPIDS="$n $WPIDS"; done; kill `echo "$WPIDS" | tr ' ' '\n'`; { sleep 3; kill -9 `echo "$WPIDS" | tr ' ' '\n'`; }

List installed packages by size on Archlinux

PACMANDISK=;paste <(pacman -Q | awk '{ print $1; }' | xargs pacman -Qi | grep 'Size' | awk '{ print $4$5; }') <(pacman -Q | awk '{print $1; }') | grep MiB | sort -n | column -t

List files and directories over 100MB

DU=;du -cshx ./* | grep "^\([0-9][0-9][0-9]M\|[0-9.]*G\)"

Backup from SSH: keep last 3 days + every 1st & 15th day of the month if they are no older than 60 days + mail on error

BACKUPDIR="/mnt/1/BACKUP/TVBOX/"; REMOTEDIR="/storage/srv/"; REMOTESSH="root@192.168.178.15"; BACKUPPREFIX="tvbox_"; KEEPDAYS="(01|15)"; IFNOTOLDERTHAN="60"; KEEPLAST="3"; ERR=-1; OUTFILE="${BACKUPPREFIX}backup_$(date +"%Y-%m-%d").tar.gz"; if cd "$BACKUPDIR"; then ssh "$REMOTESSH" tar czf - "$REMOTEDIR" > "$OUTFILE"; if [ $(/bin/stat -c%s "$OUTFILE") -gt 999999 ]; then while read line; do if [[ ! "$(date -d @$(/bin/stat -c %Y "$line") +%d)" =~ $KEEPDAYS ]]; then rm "$line"; fi; done < <(find . -type f -mtime +$(($KEEPLAST-1)) -name "$BACKUPPREFIX"'backup_*.gz' | sort -u); find . -type f -mtime +$IFNOTOLDERTHAN -name "$BACKUPPREFIX"'backup_*.gz' -delete; else ERR="Receiving data failed."; fi; else ERR="No backup dir."; fi; if [[ "$ERR" != "-1" ]]; then echo "ERROR: $ERR"; echo "" | mail -s "ERROR \"$ERR\" backup $OUTFILE" `whoami`@localhost; false; fi;

Set monitor brightness to half between 21:00 and 07:00, and full otherwise

BRIGHTNESS=1; if [ "$(($(date +%H)))" -gt 20 ] || [ "$(($(date +%H)))" -lt 7 ]; then BRIGHTNESS=0.5; fi; for OU in `xrandr | grep connected | grep -osa "^[^[:space:]]*"`; do xrandr --output $OU --brightness $BRIGHTNESS --gamma 1:1:1 ; done

This page or post was last modified on 2022-09-15 .

Using new Laravel 8 Jetstream components

When switching from Laravel 7 to 8, one of the first things I noticed were the <x-jet-... components used for all of the scaffolding. Since there are probably hundreds of options to build forms and to simplify writing plain HTML tags in your templates, I decided to keep it all in one style and use the <x-jet-... for all of my templates.

Like you can read in the Livewire docs, you can pull the components into your project folder like so.

php artisan vendor:publish --tag=jetstream-views

But there is for example no <x-jet-textarea>, so how do you add new components?

Simply edit the file /app/Providers/JetstreamServiceProvider.php and add the following to the end of the boot() function and below:

        $this->registerComponent('textarea');
    } // <- end of boot()

     protected function registerComponent(string $component)
    {
      Blade::component('jetstream::components.'.$component, 'jet-'.$component);
    }

Now you can create and customize the component file in /resources/views/vendor/jetstream/components/textarea.blade.php .

<x-jet-action-message> <x-jet-action-section> <x-jet-application-logo> <x-jet-application-mark> <x-jet-authentication-card-logo> <x-jet-authentication-card> <x-jet-button> <x-jet-confirmation-modal> <x-jet-confirms-password> <x-jet-danger-button> <x-jet-dialog-modal> <x-jet-dropdown-link> <x-jet-dropdown> <x-jet-form-section> <x-jet-input-error> <x-jet-input> <x-jet-label> <x-jet-modal> <x-jet-nav-link> <x-jet-responsive-nav-link> <x-jet-secondary-button> <x-jet-section-border> <x-jet-section-title> <x-jet-switchable-team> <x-jet-textarea> <x-jet-validation-errors> <x-jet-welcome>

 

This page or post was last modified on 2022-09-15 .

multi-row tabs in Firefox Quantum

After Mozilla killed virtually all the plugins with Firefox Quantum 3 years back, the browser became almost completely useless and unusable. This was part of a new support scheme that targets only the main bulk of unskilled and largely inactive users, while totally neglecting the rest. Something similar happened to Android's Firefox Fennec just a month ago or so, when it got replaced by Fenix, although that situation seems to be a lot worse. Since Quantum I started using Palemoon (pre-Quantum fork). And I just installed Fennec from F-Droid. Compared to Firefox, Palemoon is only barely if at all developed and maintained. At least it works though.

It would be great if you could switch back to Firefox, but does Quantum work well enough?

By now after 3 years, I guess there are plenty of replacement plugins to restore basic functionality. But one thing I had never imagined to make a return, were multi-row tabs!

In fact the entire UI now seems to be customizable with CSS!

From here you can use this file.

And just put it into your profile directory like this:

~/.mozilla/firefox/horp5zpu.default/chrome/userChrome.css

Here is my file (better size limits):

userChrome.css:

 

Unrelated to multi-row tabs, I still found a couple of not-so-trivial bugs in Firefox Quantum. Like context menus opening in the wrong place. So its still not good enough to switch to. But otherwise, it seemed to be working. With the new abandon style support scheme though, you probably can't really count on anything anymore.

This page or post was last modified on 2022-09-15 .