Skip to content

Instantly share code, notes, and snippets.

View vmsh0's full-sized avatar

Riccardo Paolo Bestetti vmsh0

View GitHub Profile
@vmsh0
vmsh0 / jstatd.sh
Last active February 18, 2021 10:37 — forked from nicerobot/jstatd.sh
Java 11: run jstatd w/o error 'access denied (java.util.PropertyPermission java.rmi.server.ignoreSubClasses write)'
#!/usr/bin/bash
# should also work with zsh
# (c) 2021 Riccardo Paolo Bestetti - bestov.io
# license: as long as you keep the above copyright notice and this license, you can do whatever you want with this
PORT='1099'
echo "Starting on port $PORT..."
jstatd -p $PORT -J-Djava.security.policy=<(echo 'grant codebase "jrt:/jdk.jstatd" { permission java.security.AllPermission; }; grant codebase "jrt:/jdk.internal.jvmstat" { permission java.security.AllPermission; };')
@vmsh0
vmsh0 / brightness.sh
Last active July 25, 2020 20:30
Script to quickly change the brightness value on Linux
#!/bin/sh
low_brightness_clamp=200 # you should probably change this depending on the brightness range of your driver
dev=$1
prm=$2
sys="/sys/class/backlight/$dev"
if [ ! -e "$sys" ]; then
>&2 echo "device not found"