November 9, 2023
Trouble setting up wireguard-ui in docker
[ Edit: fixed by adding UID, GID, and PEER env vars to the wireguard service: https://github.com/ngoduykhanh/wireguard-ui/issues/473#issuecomment-1793604986 ]
Following a guide to set-up wireguard and wireguard-ui: https://linuxiac.com/how-to-set-up-wireguard-vpn-with-docker/
Server created on DigitalOcean with IPv4 and IPv6 addresses by default.
Configured iptables as per the set-up guide (server also runs another docker based service that opens ports 80, 433, and 9993):
sysops@master-control:~/wireguard$ sudo iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy DROP) target prot opt source destination DOCKER-USER all -- anywhere anywhere DOCKER-ISOLATION-STAGE-1 all -- anywhere anywhere ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED DOCKER all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED DOCKER all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED DOCKER all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain DOCKER (3 references) target prot opt source destination ACCEPT udp -- anywhere 172.
read more
February 3, 2023
Use Canon EOS 90D as a webcam for Google Meet / Skype / Zoom / etc on Linux Ubuntu 22.04 with nVidia hardware acceleration
Quick and dirty post that pulls together a couple of sources. I might improve the post at some point. I might not…
Initial set-up:
Source https://www.youtube.com/watch?v=TsuY4o2zLVQ
Additional code to specify which video device to create.
sudo apt update && sudo apt install gphoto2 v4l2loopback-utils ffmpeg echo 'dslr-webcam' | sudo tee -a /etc/modules echo <<EOT | sudo tee -a /etc/modprobe.d/dslr-webcam.conf alias dslr-webcam v4l2loopback options v4l2loopback exclusive_caps=1 max_buffers=2 video_nr=69 EOT Hardware acceleration set-up:
read more
July 12, 2022
SQLSTATE[HY000]: General error: 1366 Incorrect string value: ‘\xE2\x80\x8B\xE2\x80\x8B…’ for column
If you get this (or similar) when trying to insert/update in a MySQL database, you table is not able to cope with the extended version of the UTF8 character set.
You will need to convert your table to use the utf8mb4 character set, and utf8mb4_unicode_ci collation.
An example to do so:
ALTER TABLE `your_table_here` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
read more
November 30, 2021
Making my laptop screen less bright and reduce eye strain
Running Kubuntu on my 2018 DELL XPS 15 laptop is a joy, when I can reduce the brightness down to its minimum.
During daylight hours, the minimum is bright enough and saves on battery usage.
But during the evening, when I’m tired from staring at monitors all day long, I found that my eyes were begging me to stop using the laptop.
Using the brightness controls on the laptop’s keyboard causes the brightness to step up and down by distinct levels.
read more
October 15, 2021
New hardware, who dis?
New laptop provided by work. Time to install everything that makes me productive as a PHP developer.
Using Kubuntu 21.10 as my base OS.
General utilities:
sudo apt install \ openssh-server \ net-tools \ htop \ curl \ whois \ ack \ mysql-client \ httpie \ php-cli \ freerdp2-x11 \ meld \ kcachegrind \ vokoscreen-ng \ autokey-qt \ parlatype \ thunderbird-locale-en-gb \ libreoffice-calc \ libreoffice-writer \ libreoffice-draw \ cherrytree Snaps:
read more
October 6, 2021
old and busted: mysqldump, new hotness: mydumper
I’m late to the mydumper party - https://github.com/maxbube/mydumper
Multi-threaded, lightning quick, exports to files per table structure and data.
In the Ubuntu world (and likely Debian too) it’s available as a precompiled package: sudo apt update && sudo apt install mydumper
Backup everything in a database:
mydumper \ --triggers \ --routines \ --events \ --database name_of_source_database It’ll create a date stamped directory with two files for each table. One for the schema, the other with the data.
read more
April 23, 2021
How to call a static method in PHP when you have the class name in a variable
Wrap the variable (that holds the class name) in brackets:
<?php class A { public static function foo($arg) { return 'Argument was "' . $arg . '"' . PHP_EOL; } } $result = A::foo('triggered via named class'); echo $result; $className = A::class; $result = ($className)::foo('trigged via variable'); echo $result; The output of the above code:
$ php a.php Argument was "triggered via named class" Argument was "trigged via variable"
read more
December 18, 2020
I got locked out of a google compute instance due to ssh packets being dropped
Silly thing to happen really.
Some system on the instance detected too many connections in a short amount of time - likely due to some automated tasks driven by ansible.
That resulted in iptables dropping all connections to port 22 🙁
Thankfully, with google compute, one can access the serial console via the web UI.
Unfortunately, all of my users have no passwords - this is to ensure that ssh logins are via keypairs only.
read more
May 14, 2020
Skype forgetting login details on Ubuntu
TLDR; Install gnome-keyring
If you are not using the default install of Ubuntu, you might not be using Gnome. This is the case for flavours such as: Kubuntu (KDE Plsama), Lubuntu (LXQt), Xubuntu (XFCE), and so on.
And if you have installed Skype using snap, then you will likely find that it will always ask you to login upon loading, even if you have it configured to automatically run at login.
read more
December 4, 2019
KDE Plasma likes, dislikes, and would be nice to haves
With each new release of Ubuntu, I’ve stuck with the default desktop environment. These have worked well for me over the years, but thought I should see what else there is.
The only way for me to do it justice is to run KDE Plasma as my only desktop environment for a minimum of 2 weeks. So both my work station and my personal laptop are use KDE Plasma installed alongside Gnome 3 Shell on Ubuntu 19.
read more