Skip to content

Instantly share code, notes, and snippets.

@simonjenny
simonjenny / sshlist
Created June 23, 2020 11:01
Easy SSH Dialog based on your SSH Config
#!/bin/bash
DIALOG=${DIALOG=dialog}
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
trap "rm -f $tempfile" 0 1 2 5 15
ar=()
for i in `cat ~/.ssh/config |grep -w Host| sed -e "s/Host //g" | grep -Ei '[a-z]'`
do
ar+=($i "")
done
$DIALOG --title "SSH Servers" --menu "Bitte wähle ein Server:" 0 0 10 "${ar[@]}" 2> $tempfile
@simonjenny
simonjenny / dl.sh
Created February 27, 2020 12:35
Download all Videos in Youtube Playlist as Music Files
#!/bin/bash
/usr/bin/youtube-dl -i -f 'bestaudio[ext=m4a]' --write-thumbnail --embed-thumbnail \
--metadata-from-title "%(title)s" \
--metadata-from-title "%(artist)s" \
--output '/%(playlist_title)s/%(title)s/%(title)s.%(ext)s' \
--download-archive "$1.txt" \
--write-info-json \
-q https://www.youtube.com/playlist?list=$1
@simonjenny
simonjenny / rover.py
Created January 9, 2020 10:08
Autonomous Rover and Wiimote Control for ExplorerHat
import explorerhat, time, random
import RPi.GPIO as GPIO
import cwiid
mode = 0
back = explorerhat.analog.three
front = explorerhat.analog.four
speed = 50
wii_connected = False
@simonjenny
simonjenny / rover.py
Created January 9, 2020 10:06
WiiMote Remote for ExplorerHat
import explorerhat, time, random
import RPi.GPIO as GPIO
import cwiid
import os
import sys
speed = 50
wii_connected = False
def connect_wii():
@simonjenny
simonjenny / slideshow.py
Last active August 7, 2024 16:46
Slideshow for Raspberry Pi (or any other Python capable OS)
# -*- coding: utf-8 -*-
import os, pygame, random
pygame.init()
pygame.mouse.set_visible(False)
BACKGROUND = (0,0,0)
INTERVAL = os.getenv('INTERVAL', 60)
IMAGEFOLDER = os.getenv('IMAGEFOLDER', 'images')