Skip to content

Instantly share code, notes, and snippets.

View plembo's full-sized avatar

Phil Lembo plembo

View GitHub Profile
@plembo
plembo / vmwp-no3d-avail.md
Last active March 26, 2025 07:03
VMware Player: No 3d support available from the host

VMware Player: "No 3d support is available from the host"

Facts: VMware Player on Ubuntu 18.04 LTS with the standard Gnome desktop running an AMD WX-2100 graphics card. Both glxinfo and glxgears show 3d acceleration is enabled and working on the host. In addition to VMware Player, the host is also running the qemu-kvm/libvirtd stack from Ubuntu's official repositories. My use case for 3d accelerated graphics in a Windows guest is to occasionally play a Windows-only game.

Issue: Player barks this warning during installation of... anything.

Solution: This askubuntu post, Powered by StackExchange[TM], provides the solution:

@plembo
plembo / bind9-zone-reload.md
Last active August 27, 2020 18:08
BIND 9 Admin: Reloading Zones

Reloading zones in BIND 9

Whenever you made changes in a BIND zone file that zone will need to be reloaded.

This can be done in two ways on a DNS master server:

  1. Restart the BIND service (for example, on an Ubuntu server):
$ sudo systemctl restart bind9
  1. Update using the rndc tool:
@plembo
plembo / search-domain-google-fiber.md
Last active August 27, 2020 19:19
Search Domain with Google Fiber

Search Domain with Google Fiber

Google Fiber's Network Box DHCP makes no provision for passing a search domain to clients. This alone is reason to ditch the Network Box in favor of another device.

Most Linux DHCP clients will be using Network Manager, which provides a way to supply a custom search domain that will be added to /etc/resolv.conf. Note that you must mask systemd-networkd for this to work.

  1. Go to /etc/NetworkManager/system-connections
  2. Edit the 'Wired connection 1' profile under [ipv4] to specify your preferred search domain:
@plembo
plembo / ubntergf.md
Last active February 10, 2025 21:20
Using a Ubiquiti EdgeRouter with Google Fiber

Using a Ubiquiti EdgeRouter with Google Fiber

After using Mikrotik routers almost exclusively for many years I have recently switched to Ubiquiti's EdgeRouter 4 to accommodate the orders of magnitude greater bandwidth delivered by Google Fiber.

The main reason for switching to the ER-4 was that there simply wasn't a Mikrotik device in its class that was close to the price. As it turns out there is also somewhat more (and more recent) online advice available on replacing Google's Network Box with an EdgeRouter. I was heavily influenced by the specs for the GFRG200 that Google furnished us with in determining my minimum requirements (1 GHz CPU, 1 GB RAM, etc) for a new router.

The primary resource I used for this project was this repo from Mike Potts:

@plembo
plembo / wslhometerm.md
Created September 23, 2020 01:16
Open WSL Linux home in Windows Terminal

Open WSL Linux home in Windows Terminal

As I write this the latest version of Windows Terminal, an otherwise great program, opens the user's Windows home rather than their Linux home. As many have learned over time, it's fast becoming a best practice to favor the Linux over the Windows file system when working within WSL.

The necessary change is trivial. It only requires the adding of a single line to the Windows Terminal configuration to specify the home directory to open. Here is the syntax:

"startingDirectory": "//wsl$/Ubuntu-18.04/home/username/"
@plembo
plembo / winterm-gitbash.md
Last active March 2, 2024 19:18
Git-Bash in Windows Terminal

Git-Bash in Windows Terminal

Windows Terminal is a nice console for Windows. With the latest version of it a prior or subsequent install of Git for Windows does does not show up among the available terminals, so if you want it you'll need to add it manually.

NOTE: The latest versions of Windows Terminal allow you to create and edit profiles in Settings. Use the paths for bash.exe and git-for-windows.ico below and it will work as advertised (don't just copy and paste: the path separators won't work in the Settings gui if they're escaped). Apart from being able to set things up visually, a big advantage of the new method is that you don't have to make up a guid :-)

To add Git-Bash to Windows Terminal, open the Windows Terminal Settings and paste in block of profile code:

Installing ImageMagick on Ubuntu

UPDATE: I'm now running the AppImage package for ImageMagick. With appimaged installed, setup of ImageMagick on Ubuntu Desktop was frictionless. By linking from from the AppImage to ~/bin I am able to run it in the CLI. The main difference is in the format of the commands. Instead of convert I invoke magick convert, which isn't a big deal since convert was always just an alias for the full command. Getting it all to work on my headless Ubuntu Server required more effort (mostly to get appimaged running), but eventually successful.


Notes on installing ImageMagick from source, because the old version that ships with Ubuntu doesn't support the latest formats (like .webp). The AppImage package fell short for me, so I decided to go with source. This has been tested on Ubuntu 18.04 and 20.04 LTS.

Basically followed the directio

@plembo
plembo / latestffmpegonubuntu.md
Last active November 5, 2021 14:40
Latest ffmpeg on Ubuntu 18.04 LTS

Installing the latest ffmpeg on Ubuntu 18.04 LTS

The version of ffmpeg that ships with Ubuntu 18.04 LTS is hopelessly old. If you find yourself working with this tool often, you'll probably want to get the latest version. There are two ways to go here: precompiled binaries or a PPA, although you may find yourself having to use the latter because a packaged ffmpeg is a dependency for other packages you want to install.

Precompiled binaries

I've been using John VanSickle's precompiled static binaries for Linux since forever:

https://johnvansickle.com/ffmpeg/

As John recommends, use the "git master" build for your platform (for most of us that's amd64).

@plembo
plembo / vscodedeftermshell.md
Last active October 28, 2020 16:54
Change the default terminal shell in vscode

Changing the default terminal shell in vscode

The integrated terminal in vscode (Visual Studio Code) is a handy feature. By default it launches Windows PowerShell on Windows, and bash on Linux.

But vscode can usually detect other available shells, including the cross-platform PowerShell 7, or if you're on Windows, the humble command prompt. It is normally not necessary to manually add these to the vscode configuration.

Changing shells is as easy as typing the shell's executable name in an existing vscode terminal.

@plembo
plembo / pyshebvenv.md
Last active November 5, 2021 23:26
What shebang to use in for python script in a venv?

What path to use in the shebang (#!) for a python script in a venv?

In order to run a python script under bash and most other Unix or Linux systems without invoking the python executable manually, you need to include the python path in a "shebang" (#!) at the top of the script.

That's easy enough in a standard environment:

#!/usr/bin/python3

But in a python virtual environment (venv) that's going to be a problem because the binary will be "python", not "python3", and although the latest version of venv was designed to detect the default python binary in the environment, it's going to do as instructed if given told to use "python3" in the shebang.