Skip to content

Instantly share code, notes, and snippets.

@rwese
rwese / test-saneimage-discovery.sh
Created May 29, 2022
saneimage -L inside docker container
View test-saneimage-discovery.sh
# ATTENTION: this is not secure and must not be used in any production environment
#
# to work it needs the following extra mappings and permissions
#
# * --net host for the discovery process, which is otherwise blocked by certain iptables rules, at least in my case this was the easiest solution
# * --privileged to access the devices at all
# * dbus bind-mounts for the devices discovered by the os
#
# build the debian-sane image
export DOCKER_IMAGE_NAME=debian-sane
@rwese
rwese / userChrome.css
Created May 25, 2022
Hide Firefox-Tabs when using treestyle-tabs
View userChrome.css
/*
firefox: about:config
toolkit.legacyUserProfileCustomizations.stylesheets > true
css-file: /.mozilla/firefox/<<<profile>>>/chrome/userChrome.css
*/
#TabsToolbar {
visibility: collapse !important;
}
@rwese
rwese / Dockerfile
Last active Feb 25, 2022
Nextcloud - docker - fpm-alpine dockerfile add tesseract-ocr and fix svg support and default_phone_region
View Dockerfile
# add tesseract
# add php-imagick
# add py-pluggy, a not documented, dependency for ocrmypdf
#
# by default english is installed as an ocr language for tesseract on alpine
# adds tesseract-ocr-data-deu, change to your local language or remove
#
# This `pecl install imagick || true` is a workaround as imagick was installed
# on some image verions but pecl fails if already installed
#
@rwese
rwese / event_device.sh
Created Sep 13, 2021
get the event device by name for a keyboard or mouse on linux
View event_device.sh
#!/bin/bash
# read the /proc/bus/input/devices and then parse out the proper event device
# this can be used in conjuction with kmonad *https://github.com/kmonad/kmonad)
DEVICE_NAME="Logitech MX Keys"
EVENT=$(grep "$DEVICE_NAME" /proc/bus/input/devices -A 4 | tail -n1 | grep -Eo 'event[0-9]+')
DEVICE="/dev/input/$EVENT"
echo "Found device at: $DEVICE"
@rwese
rwese / macos_automator_msteams_without_gpu.sh
Created Oct 28, 2019
Restart MS Teams with "disable-gpu" to reduce battery consumption.
View macos_automator_msteams_without_gpu.sh
#!/bin/bash
# Created 2019-04, Author: René Weselowski <rene.weselowski@gmail.com>
#
# This script is entended as an macos automator 'application' run at startup
# to kill the MSTeams process and restart it wiith '--disable-gpu'
#
# Usage:
# Create a new automator task "Run Shell Script"
# Shell: /bin/bash
# Put it into your login/startup items
@rwese
rwese / winscp-sudo.sh
Created May 11, 2019
winscp - sftp sudo
View winscp-sudo.sh
#/usr/bin/env bash
# At times when you really need to remote edit files owned by root via WINSCP
# or other SFTP Clients...
#
# Winscp Link for this:
# https://winscp.net/eng/docs/faq_su
sudo su -c /usr/lib/openssh/sftp-server