Skip to content

Instantly share code, notes, and snippets.

View rwenz3l's full-sized avatar
🔨
Building new Things.

Robin Wenzel rwenz3l

🔨
Building new Things.
View GitHub Profile
@rwenz3l
rwenz3l / verify_flac.sh
Created July 23, 2017 15:45
Verify a FLAC file ripped with XLD
crc32 <(flac --decode --stdout --force-raw-format --endian=little --sign=signed /path/to/file.flac)
@rwenz3l
rwenz3l / cli_upload.sh
Created July 22, 2017 19:26
upload file to php with CLI (curl)
curl -F "logfile=@safe01.log" -F "sub=archive" localhost:9000/recv.php
#! /bin/sh
#
# Credit to: www.byan-roper.org
#
#
# actually uses some bash extensions; see comment on line 36
#
# change the UID of a login on Mac OS X 10.11 El Capitan
#
# run this script using sudo *from another user account*!!!
# Variante 1: Pure Python
from random import randint
def wuerfeln(wuerfel=1, versuche=1):
ergebnis = {}
for a in range(wuerfel,(wuerfel*6)+1):
ergebnis[a] = 0
for i in range(0, versuche):
summe = 0
for j in range(0, wuerfel):
@rwenz3l
rwenz3l / ToggleGateway.bat
Last active May 30, 2017 06:41
Toggle between two Gateways on Windows 7/8/10
@echo off
set /p DUMMY=Press ENTER to Toggle Internet Gateways..
CD %~dp0
IF EXIST "%~dp0fast.ini" (
ECHO Switch: Slow
route DELETE 0.0.0.0 MASK 0.0.0.0 192.168.10.6
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.10.5
DEL Fast.ini
@rwenz3l
rwenz3l / upload.sh
Created August 24, 2016 08:13
Upload Script for Amazon Cloud Drive
# UPLOAD SCRIPT
echo "--> Pause All Torrents/Stop Deluge"
# deluge-console "pause *;quit"
systemctl stop deluged
echo "--> Stop PlexServer"
systemctl stop plexmediaserver
echo "--> Unmount EncFS and ACD"
fusermount -z -u /share/acd-dec/
fusermount -z -u /share/acd-raw/
echo "--> Clear ACD Cache and Sync"
@rwenz3l
rwenz3l / maintain.sh
Last active November 23, 2016 00:10
Maintenance Script for ACD
echo "(===== Checks =====)"
if [[ -d "/share/acd-raw/plexcrypt" ]];
then
echo "Properly Mounted";
else
echo "Crashed";
echo "(===== Unmount =====)"
echo "Unmount EncFS ACD"
fusermount -z -u /share/acd-dec
@rwenz3l
rwenz3l / erstelle_verz.sh
Created July 6, 2015 20:07
Loesung zu Aufgabe 6-2
#!/bin/bash
if [ $# -eq 1 ]
then
INPUT="${1}"
else
echo "Keine Input Parameter gegeben"
exit
fi
for line in $(cat ${INPUT} | tail -n 9 | tr " " "-" | grep '[0-9]$'); do
@rwenz3l
rwenz3l / gist:8a7a72bdce824aa24ed2
Last active August 29, 2015 14:23
Convert IBAN Landeskennung to Zahl
static int LandeskennungToZahl(String Landeskennung){
// Beispiel Landeskennung = DE
// return Zahl = 1314
String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
String LandesZahl = "";
for(char b : Landeskennung.toCharArray()) {
int n = 10;
for(char a : alphabet.toCharArray()) {
String buchstabe = String.valueOf(n);
System.out.println("Ist " + b + " = " + a);
@rwenz3l
rwenz3l / qt_rec_req.script
Last active August 29, 2015 14:20
Quicktime AutoRecord request
-- set the path as POSIX path
set thePath to "Macintosh HD:Users:userName:Documents:"
-- set timeStamp
set theDate to current date
set dateStamp to the year of theDate & "-" & the month of theDate & "-" & the day of theDate & " " & hours of theDate & "-" & minutes of theDate
-- set movieName
set movieName to dateStamp & ".mov"
-- set final path and make it a file reference
set filePath to thePath & movieName
set f to a reference to file filePath