Skip to content

Instantly share code, notes, and snippets.

View dkebler's full-sized avatar

David Kebler dkebler

  • We Also Walk Dogs
  • Oregon, US
View GitHub Profile
@dkebler
dkebler / nemo-action-rel-path.md
Created March 9, 2025 17:19
nemo action relative path to script with Exec

Nemo Actions with Relative Paths

The Problem

Nemo file manager actions (.nemo_action files) in Linux typically require absolute paths when specifying executables, which causes issues with:

  • Portability between systems
  • Moving application directories
  • Sharing configurations between users
  • Maintaining action files in version control
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@dkebler
dkebler / smenu.lib
Last active August 6, 2024 18:13
A library script to help get and run smenu https://github.com/p-gen/smenu/discussions/44
#!/bin/bash
# A library script to help get and run smenu
# https://gist.github.com/dkebler/fe40cd5ad14f54807c6a975be1d0a1da
# https://github.com/p-gen/smenu
# https://github.com/p-gen/smenu/discussions/44
# source it and then have fun.
# I put in a function `smenu_test`.
# When you run it the first time it will pull,build and put smenu in same directory as this script
@dkebler
dkebler / widevine.sh
Last active March 15, 2024 21:08
Install WidevineCDM into chromium
#!/bin/bash
# -eux
function confirm()
{
echo -n "$@ "
read -e answer
for response in y Y yes YES Yes Sure sure SURE OK ok Ok
do
if [ "_$answer" == "_$response" ]
then
@dkebler
dkebler / rockpro64watchdog.md
Last active December 30, 2023 19:43
Pine64 RockPro64 Powerup Watchdog

Rockpro64 Power On Watchdog using esp8266 and Tasmota

Problem

Some times after power loss (12v) the rockpro64 will not fully power on when 12v is restored. It will enable 5V but then it will not "power on" which is indicated by pin 1 raising to 3.3v. This is fixed by pushing the power button for 5-8 seconds which for sure forces the rockpro off and then a single push of a second. We can use these facts to "push" the power using a relay powered by a esp8266 running the Tasmota firmware and a simple tasmota rule. Below are the details. You ONLY need to do this is you are using the rockpro64 in an unattended mission critical application (e.g a NAS box running your cloud server).

WARNING WARNING WARNING

I take NO responsibility if you brick/fubar your rockpro64 or wemos boards doing this. Please understand and test first. Don't just connect your watchdog to the rockpro64 rather set up a testbench like I did by using the 3.3v pin on the D1 mini and a switch instead of pin1 on the rockpro to simul

@dkebler
dkebler / rock64shrink.sh
Last active March 4, 2023 22:45
Bash Script for Shrinking/Truncating a disk image
#!/bin/bash
# WARNING this script could easily trash a image or worse a device. DO NOT USE IT WITH A DEVICE
# It will make a copy of the image to work on by default unless you use the -o option
# which you should NOT unless your image is much bigger than >16GB
# In other words test it on a disk image file that could be damaged.
# Use the -h option to see list of options
# You MUST use -t to do the last step truncation
@dkebler
dkebler / watch.sh
Created February 19, 2023 16:18 — forked from fago/watch.sh
Inotify script to trigger a command on file changes, e.g. rsync
#!/bin/bash
# (c) Wolfgang Ziegler // fago
#
# Inotify script to trigger a command on file changes.
#
# The script triggers the command as soon as a file event occurs. Events
# occurring during command execution are aggregated and trigger a single command
# execution only.
#
# Usage example: Trigger rsync for synchronizing file changes.
@dkebler
dkebler / hugo-update.sh
Created September 26, 2020 16:20
Hugo Release Update Script - supports extended version
#!/bin/bash
# Version 0.21.0 8:26 PST, Nov 9, 2018
# inspried from this forum post https://discourse.gohugo.io/t/script-to-install-latest-hugo-release-on-macos-and-ubuntu/14774/10
# if you have run into github api anonymous access limits which happens during debugging/dev then add user and token here or sourced from a separate file
# . ~/githubapitoken
#GITHUB_USER=""
#GITHUB_TOKEN=""
if [ "$GITHUB_TOKEN" != "" ]; then
echo using access token with script
#!/bin/bash
add-ppa () {
if [ $EUID != 0 ]; then
sudo bash -c "$(declare -f add-ppa); add-ppa $*"
else
VERSION=jammy
KEYSDIR=/etc/apt/trusted.gpg.d
KEYSERVER=keyserver.ubuntu.com
@dkebler
dkebler / evdi-install.sh
Last active November 1, 2021 18:19
install the forked evdi module for amd gpu
#!/bin/bash
# remove default evdi module and build and install this fork
# clone this https://github.com/pioto1225/evdi/tree/amd_vmap_texture
# put this script in the parent directory
echo "**** this script must be run from the parent of the the evdi repo ****"
ls -la /usr/src | grep evdi
echo enter the latest evdi driver version
read version
echo "***** moving /usr/src/evdi-$version to evdi-$version.original ****"
sudo mv /usr/src/evdi-$version evdi-$version.original