Skip to content

Instantly share code, notes, and snippets.

@jadwigo
jadwigo / reset_usb.md
Created October 14, 2025 14:02
Reset USB devices from the commandline

Reset USB devices from the commandline

For people who use USB webcam on ubuntu or another linux, those cameras can get lost in powersave mode and then are unresponsive.

You can unplug it and reconnect it to get the camera back, but that's kind of hard to do when you're remote.

To do it remote you can login to the console of the machine

  • use the command usbreset to get a list of the USB devices
@jadwigo
jadwigo / localwindows11account.md
Created September 15, 2025 07:40
You still don't really need a Microsoft account to use Windows 11

You still don't really need a Microsoft account to use Windows 11

https://www.xda-developers.com/you-still-dont-need-microsoft-account-use-windows-11/

So what do you need to do? Well, it's simple.

During Windows 11 setup, when you get to the page asking you to connect to the internet, just ignore that and press Shift + F10 on your keyboard to open the Command Prompt. In this window, type the following command and then press Enter:

@jadwigo
jadwigo / gradients.css
Created November 18, 2024 11:22
red gradient
/** https://cssgradient.io/ **/
background: rgb(221,11,11);
background: linear-gradient(103deg, rgba(221,11,11,1) 0%, rgba(247,0,140,1) 76%, rgba(221,11,11,1) 100%);
@jadwigo
jadwigo / nvidiachecks.md
Created November 13, 2023 10:23
different ways to check for nvidia jetpack versions

old version - check for existing file

cat /etc/nv_tegra_release

later versions (check L4T verions)

dpkg-query --show nvidia-l4t-core

dpkg -l | grep 'nvidia-l4t-core'

@jadwigo
jadwigo / autoupdates.sh
Last active September 16, 2025 13:14
Ubuntu autoupdates (nala)
#!/bin/sh
echo "== Check required programs =="
if ! [ -x "$(command -v nala)" ]; then
echo 'Error: NALA is not installed. Please install it with "apt install nala"' >&2
exit 1
fi
if ! [ -x "$(command -v snap)" ]; then
echo 'Error: SNAP is not installed. Please install it with "nala install snap"' >&2
# Quick setup for raspberry pi with smtp mailserver and log2ram
apt purge wolfram-engine scratch scratch2 nuscratch sonic-pi idle3 -y
apt purge smartsim java-common minecraft-pi libreoffice* geany -y
apt clean
apt autoremove -y
echo "deb http://packages.azlux.fr/debian/ bullseye main" | sudo tee /etc/apt/sources.list.d/azlux.list
wget -qO - https://azlux.fr/repo.gpg.key | sudo apt-key add -
@jadwigo
jadwigo / pictureframe-setup.md
Last active October 31, 2022 08:21
Installation procedure for the pictureframe

Picture screen installation

cleanup installation and remove unused big programs

sudo apt purge wolfram-engine scratch scratch2 nuscratch sonic-pi idle3 -y
sudo apt purge smartsim java-common minecraft-pi libreoffice* geany -y
sudo apt clean
sudo apt autoremove -y
@jadwigo
jadwigo / locationquery.sql
Last active April 28, 2020 20:59
Query locations in a circle of $max_distance around $input_latitude, $input_longitude
SELECT
l.*,
(
6371
* acos(
cos(
radians( $input_latitude )
)
* cos(
radians( l.latitude )
@jadwigo
jadwigo / switch-php-version.sh
Created April 5, 2020 10:05
How to switch PHP version in ubuntu 18.04
#!/bin/sh
# Show a dialog to switch between available php versions on your ubuntu 18.04 linux system
# found at https://www.ostechnix.com/how-to-switch-between-multiple-php-versions-in-ubuntu/
sudo update-alternatives --config php
-- anonymize the following tables
UPDATE `users`
SET
name = CONCAT('Anonymized ', id),
email = CONCAT('anonymized+', id, "@example.com"),
password = SHA1(CONCAT('secret', id, RAND()))
WHERE 1;
UPDATE `ls_sponsors`