Restore Pretzel Rocks Offscreen Window

As you might now, I use Pretzel as the source for music during my streams. What you probably don’t know, for whatever reason, the player windows seem to disappear from time to time without any possibility to get it back on any of my screens.

Pretzl App Window as it should be

Actually, there is no way to get the window back on your screen(s). The easiest way to restore the default windows position is to jump into %APPDATA%/PretzelDesktop where you delete the window-state.json file.

This one has to go…

Make sure Pretzel is closed while deleting the JSON-file. Once you start Pretzel App again, it should reset its position.

Emoji Font

Occasionally (probably too often), I use emojis in my lecture notes. Unfortunately, sometimes I end up with strange things based on the font, I use.

OpenSansEmoji might help to solve this issue.

Example of OpenSansEmoji vs Arial

It is a font made of three other fonts, providing all most of the emojis you need.

This is basically a mashup font which consists of three fonts. The aim of OpenSansEmoji is to include the whole iOS (currently 6.1) Emoji set while keeping the file size as low as possible. Most of the symbols listed on the “Emoji” Wikipedia page are supported. All symbols are in monochrome.

Also, it is licensed under Apache 2.0 and therefore free to use.

Link: https://github.com/MorbZ/OpenSansEmoji

Raspi Network Failure Shenanigan

It seems as I run into a common issue with my Raspberry 4. After an indeterministic uptime, the wifi stops working.

And here is the hotfix, a small script provided by @pitto first restarting the nic and if anything fails just reboots the device:

This bash script checks for wireless internet connection and, if it is failing, tries to fix it.

It is simple and it seems to work.


I just have to write some automation to roll it out automatically including a corresponding cron job once I find some time.

GitHub Repo: https://github.com/ltpitt/bash-network-repair-automation

Turn off your Screen in Windows 10

A problem you might have as well: how to turn off the screen of your laptop without changing the battery settings and without using any tools? Probably using a hotkey? Did you realize, this is not part of Windows at all?

Basically, here is the batch file you have to create for it. Yes, someone wrote a batch file for this. Create a shortcut to the batch file, assign a hotkey and be happy. You also can download the batch file from TechNet. Works on my machine (with Windows 10).

powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,2)

Found on TechNet: https://gallery.technet.microsoft.com/scriptcenter/Turn-off-screen-4d173e0a

Glow Effect for SynthWave’84 on macOS

During today’s recording of our podcast, I talked about not getting the glow effect for the SynthWave’84 theme working. Right after doing so, I figured out how to solve the issue.

After installing the plugin, you need also the extension Custom CSS and JS Loader.

Now edit the settings in the settings.json file of Visual Studio Code by adding the following entries:

"vscode_custom_css.policy": true,
"vscode_custom_css.imports": [
 "file:///Users/andreas/.vscode/extensions/robbowen.synthwave-vscode-0.0.7/synthwave84.css" 
],

Of course, you have to change the user name above to yours. The settings.json should now look quite similar to the following:

Eventually, you need to make sure Visual Studio can apply the modifications by running

>sudo chown -R $(whoami) "/Applications/Visual Studio Code.app/Contents/MacOS/Electron"

That is, by the way, the step I have missed in my previous attempts.

Now you can restart Visual Studio Code, enter Command+Shift+P and enter Enable Custom CSS and JS

Once Visual Studio Code is reloaded, the glow effect of the theme should work like a charm.

If you receive any message about a corrupt Code installation, you might want to simply click it away.

Some of the previous steps might need to be repeated once the Visual Studio Code installation was updated to a new version.

Theme: https://marketplace.visualstudio.com/items?itemName=RobbOwen.synthwave-vscode

Custom CSS Loader: https://marketplace.visualstudio.com/items?itemName=be5invis.vscode-custom-css

Raspberry Pi – Setting a static IPv4 address

It run me mad, as I tried to change the IP address of my Raspberry to a static one. I changed literally everything in  /etc/network/interfaces and reloaded, restarted and reboot the device over and over.

iface eth0 inet static
address 192.168.0.207
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.

As the above configuration did not help a lot, I figured out that based on the Raspberry model, you need to change settings on various places.

First run

cat /proc/cpuinfo

to determine you model. While getting something like

pi@raspberrypi:~ $ cat /proc/cpuinfo
processor    : 0
model name    : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS    : 2.00
Features    : half thumb fastmult vfp edsp java tls
CPU implementer    : 0x41
CPU architecture: 7
CPU variant    : 0x0
CPU part    : 0xb76
CPU revision    : 7

Hardware    : BCM2708
Revision    : 0004
Serial        : 000000004715b608

you need to use the hardware revision and

Model and Pi Revision 256MB Hardware Revision Code from cpuinfo
Model B Revision 1.0 256MB 0002
Model B Revision 1.0 + ECN0001 (no fuses, D14 removed) 256MB 0003
Model B Revision 2.0
Mounting holes
256MB 0004
0005
0006
Model A
Mounting holes
256MB 0007
0008
0009
Model B Revision 2.0
Mounting holes
512MB 000d
000e
000f
Model B+ 512MB 0010
Compute Module 512MB 0011
Model A+ 256MB 0012
Pi 2 Model B 1GB a01041 (Sony, UK)
a21041 (Embest, China)
PiZero 512MB 900092

Based on this information you need

Model a

Static IP addresses in /etc/network/interfaces is not the “prefered” way,as it is an old way and DHCPCD5 is installed.

Model b

Static IP addresses are configured in the /etc/dhcpcd.conf and it is  required that /etc/network/interfaces is set to manually.

iface eth0 inet manual

That’s all…

Sud-o-Visual Studio Code

There are literally no good reasons to start Visual Studio Code on macOS with leveraged rights. Applications on macOS are not designed to run sudoed in general. If you would do so, this can have unintended sided effects. So much for the disclaimer.

If you want to start Visual Studio Code on macOS sudoed, just run

sudo open /Applications/Visual\ Studio\ Code.app

That’s all.

RFC Quick Access

To follow best practices, understand and learn new de-facto standards, I read and refer a lot RFCs (Requests for Comments). Luckily, the IETF provides an endless list of RFCs to do so.

If often need quick look into these RFCs while being in an editor or at a console windows. To avoid switching from the keyboard and losing focus, I use a small batch file called rfc.bat to gain access to RFCs very quickly.

rfc batch file call on cmd.exe

The batch script simply calles the IETF RFC URL with the RFC number as parameter.

@echo off
start https://tools.ietf.org/html/rfc%1

Where ever the batch files lives, make sure the directory is in your path. I use a folder called c:\Prg\batch which is synchronized over all my computers.

I have adapted this approach to a variety of manual tasks to open files which live on a dedicated place. E.g. I use a much more sophisticated script to open Visio diagrams based on process numbers from our company sharepoint to gain quick access instead of maneuvering through a bunch of websites. These are more than 500 documents named based on a alphanumeric pattern, so this way makes it much more easy to find and open the documents.