Skip to content

Instantly share code, notes, and snippets.

article, input, img, textare, button, a, time, label, [role=button], section {
filter: blur(4px);
}
*:hover {
filter: initial;
}
@kardysm
kardysm / bind-webcam
Created September 10, 2021 19:05
bind and unbind integrated webcam
https://askubuntu.com/questions/747212/how-to-disable-integrated-webcam-on-ubuntu?utm_source=pocket_mylist
Find out the device string of the webcam you want to disable:
for device in $(ls /sys/bus/usb/devices/*/product); do
echo $device; cat $device;
done
This will show result lines like this:
@kardysm
kardysm / camera-as-webcam.sh
Last active September 28, 2021 06:31
Stream external dslr/mirrorless camera as webcam on linux
#!/bin/sh
# webcam will be preview quality, not of actual camera capabilities
# prerequisites and source: https://www.crackedthecode.co/how-to-use-your-dslr-as-a-webcam-in-linux/
# alternative: https://hanspinckaers.com/using-a-sony-alpha-camera-as-a-webcam-in-ubuntu
# IF PREREQUISITES ARE MET AND SCRIPT IS FAILING, RESTART MIGHT HELP
# restart v4l2loopback kernel module
sudo modprobe -r dslr-webcam
@kardysm
kardysm / setup_n8n_mydevil.sh
Last active September 4, 2021 16:12
Setup n8n on mydevil hosting for custom domain (proxying)
#!/bin/sh
# Michał Kardyś (@kardysm), 2021
# script accepts:
# arg: $1 - proxy domain to external
# env: N8N_USER - username for basic auth
# env: N8N_PASSWORD - password for basic auth
#
# prerequisites:
# - DNS domain pointed correctly - for proxy address
@kardysm
kardysm / gist:204fd3d55ecb740282d186f405d95b69
Created August 26, 2021 06:27
Turn off sloppy follow focus in GNOME/Ubuntu/Budgie
# source: https://askubuntu.com/a/1037944
# Change to click (so it does not interfere with copyQ
gsettings set org.gnome.desktop.wm.preferences focus-mode 'click'
# get possible values
gsettings range org.gnome.desktop.wm.preferences focus-mode
# reset focus follows mouse setting
gsettings reset org.gnome.desktop.wm.preferences focus-mode
@kardysm
kardysm / rotate.sh
Last active April 21, 2021 10:53
Rotate mp4 video 90* (by default) clockwise via ffmpeg
#!/bin/bash
TMP_PATH="/tmp/rotating-vids"
# Provide path to source directory
ARG_DIRECTORY="${1:-.}"
# Transposition settings, default 90 deg clockwise
TRANSPOSE="${2:-1}"
DIR=$(dirname $ARG_DIRECTORY)

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

sudo nano /etc/gai.conf
uncomment:
precedence ::ffff:0:0/96 100
sudo reboot
sudo nano /etc/dhcp/dhclient.conf
uncomment and edit:
prepend domain-name-servers 1.1.1.1, 9.9.9.9; #cloudflare and IBM quad9
sudo service network-manager restart
const listDeepEventListeners = (elem) => {
listEventListeners(elem);
Array.from(elem.children).map(function(item){
listEventListeners(item)
listDeepEventListeners(item);
})
};
const listEventListeners = (elem) => {
const listeners = getEventListeners(elem)