Probably the weakest element on the laptop is the Webcam which can output 720p@30fps. By default the low light performance is not that great but you can improve it considerably by trading frame rate for low light performance.

First install the Video 4 Linux utils:

sudo apt install v4l-utils

Now run the following command (the default is 0)

v4l2-ctl --set-ctrl=exposure_auto_priority=1

Now we have reduced the noise level considerably you can play with the sharpness levels 0-7 (the default is 3)

I was experiencing a loop where after suspending and resuming the laptop it would go back into suspend over and over again. To fix this just update /etc/default/grub and add button.lid_init_state=open to GRUB_CMDLINE_LINUX_DEFAULT

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash button.lid_init_state=open"

I also had to add the following to stop errors during the update

GRUB_DISABLE_OS_PROBER=true

Then update GRUB

sudo update-grub

Update:

I found that I actually needed to replace gdm3 with lightdm to fix a different issue and this also resolved the suspend problems

First install powertop and TLP . We use powertop to estimate power usage when unplugged and TLP to run as a service

sudo apt install powertop tlp

I then did a little tweaking in my /etc/rc.local

#!/bin/sh -e

# Temp disable bluetooth
modprobe -r btusb

# Autosuspend USB Razer Keyboard after 5 minutes 
echo '300000' > '/sys/bus/usb/devices/3-8/power/autosuspend_delay_ms'
echo 'auto' > '/sys/bus/usb/devices/3-8/power/control'

# VM writeback timeout
echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs';

exit 0

Lastly switch from NVidia GTX 1650 to the Intel Iris Pro

Microbit via WebUSB on Ubuntu 18.04

- 1 min read

Make sure you are running the latest firmware on the microbit

Create a new udev rule

sudo nano /etc/udev/rules.d/80-microbit.rules

With the following content

SUBSYSTEM=="usb", ATTR{idVendor}=="0d28", ATTR{idProduct}=="0204", MODE="0660", GROUP="plugdev"

Then if you want non-admin users to be able to use it (like your kids) run

sudo usermod -a -G plugdev non-admin-user

If you are admin you just need to unplug and replug the microbit (the udev rules run on hot-plug), if you are non-admin you will need to logout and back in to get the updated user groups

Ubuntu file limits 18.04

- 1 min read

sudo nano /etc/systemd/user.conf

DefaultLimitNOFILE=65535

sudo nano /etc/systemd/system.conf

DefaultLimitNOFILE=65535

sudo nano /etc/security/limits.conf

* hard nofile 65535
* soft nofile 65535

Source

So I’ve been working on a little side project for the last couple of weeks to try and create a video based training school to allow myself to scale and maybe not have to repeat myself as much when ever I join a new client.

So I decided to take my post on the Uncommon Sense and turn that into a mini course to try things out.

This was in some ways just an excuse to learn about DSLR filming (read buy some toys), non-linear editing, colour grading etc. Now it’s not perfect (the audio isn’t great as my shotgun mic wasn’t working) but it feels good enough to share.

Uncommon Sense

- 2 mins read

Just because something is compelling doesn’t mean it’s right
i.e. transitive dependencies or the easiest location to add feature X in your codebase

Plugins are a sign of bad composeability or lack of craftsmanship or both
i.e Ridiculous NPM modules that plugin your test tool into your transpiler into your bundler into your web server or equally insane Spring plugins. Maybe look at the unix way…

Libraries are overused and under understood
i.e most day to day problems are easier to solve from first principles than deciphering the README of some library. 

GitHub Get Public Keys for a User

- 1 min read
https://api.github.com/users/danielbodart/keys

Will return

[
  {
    "id": 11647754,
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhoeoQelGjp0Oz3m64SV8AszPTyxlK1jJ8lYlW28WaSK5hu79BemIibekO06P2aA47vhI8hc4R90aqE0Ja1qG6A+jkezn2jeSzZZq7/dvoYFC0i96ljlJTKoOY5E0P4/259giTL1wtMbJrYfFutmVMBidHiOzA1dnLTrZthOuYGlanZL7oazfrz4Ht+ZdvoMoIFqU8yRnW/E903dn2DjH6Wk2dhsdP1QssbOtu3BNguhpcuVksrKw7hqrxCpiJW7Eo7z8yg6qP+KbzGF6G4UmA1/VDn5RFwNC7bvSShirYasEyAOrMHcUiCyvvvtT0a+SlsVfYbyH8wm5Ci38D9HK1"
  },
  {
    "id": 26992755,
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJDZbFgT04IDx5SECPFnHlJfwq/aHkhGr2sgSl0gqo3fOy48du/DPy4VH5cAk0qiLbT8dfzgMmkQm8EourUidZHORlbfbzzptMhWnbwEQbfXBuVyVa1Us5MV6Y0IV0TDOjNIALi6z3QTqJPtoOOfuRnDoumGCnl7bqxaKNrreoVm2vc7ep6yKuBR9HqDBJ6cN6KZ08IYFWjora1CscwsKC2EP6LWcnLsLVh2x4ZgJI0mDtnQ8hHedWmvQGhcyctKg1WdtcrrsVQESwlwDCiEVK9MypThYdZfVhh8d0JTApw37+QVkDW/oQeSMkKEyfss3wuOCCoGiJmurwM18Q/6V7"
  }
]

Should return them in the same order as https://github.com/settings/keys