Skip to content

Instantly share code, notes, and snippets.

@rwese
rwese / .wezterm.lua
Created September 21, 2024 18:20
wezterm - sticky tmux session, automatically reopen host specific session
-- this is a snippet to set the wezterm default_prog to start a hostname
-- specific session, to ensure different environments always run the same
-- session by default.
--
-- using tmux-resurrect is also possible, but for me this now works just fine
--
local wezterm = require("wezterm")
-- most reliable way to get the hostname i've found
local handle = io.popen("hostname -s")
@rwese
rwese / php-container.sh
Created November 2, 2022 15:33
PHP Docker Container wrapper compatible with phpstorm
#!/usr/bin/env bash
#
# @author René Weselowski
#
# php cli wrapper for the php-docker images.
#
# @see https://hub.docker.com/_/php
#
##### requirements
# - docker
@rwese
rwese / test-saneimage-discovery.sh
Created May 29, 2022 13:22
saneimage -L inside docker container
# 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
Last active November 4, 2022 19:40
Hide Firefox-Tabs when using treestyle-tabs
/*
firefox: about:config
toolkit.legacyUserProfileCustomizations.stylesheets > true
css-file: /.mozilla/firefox/<<<profile>>>/chrome/userChrome.css
*/
#TabsToolbar {
visibility: collapse !important;
}
@rwese
rwese / Dockerfile
Last active February 6, 2024 05:43
Nextcloud - docker - fpm-alpine dockerfile add tesseract-ocr and fix svg support and default_phone_region
# 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 September 13, 2021 15:00
get the event device by name for a keyboard or mouse on linux
#!/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 October 28, 2019 08:26
Restart MS Teams with "disable-gpu" to reduce battery consumption.
#!/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 13:21
winscp - sftp sudo
#/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