Skip to content

Instantly share code, notes, and snippets.

😎
leisure at work

Stefan Höhn dewomser

😎
leisure at work
Block or report user

Report or block dewomser

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:d2d6cc6c5e459def6ee1a19756c874e9
#!/bin/bash
sleep 60
/usr/bin/wget -P /home/foo/falkencam/$(date +%m_%d_%y) http://falken3-webcam.worms.de/webcam/current.jpg
# crontab to get Photo every 5 minutes
#*/5 * * * * /home/foo/bin/falkencam.sh
View gist:3873d1ba96a37d277efba7978d86636f
// Beispiel Twurl Tweet mit Bild
// initialisieren mit genauer Byte größe
twurl -H upload.twitter.com "/1.1/media/upload.json" -d "command=INIT&media_type=image/jpg&total_bytes=2204" | jq
//Das mittlere ist das richtige
{
"media_id": 1108021296946917400,
@dewomser
dewomser / Verspätungen im Bahnhof Worms
Last active Mar 12, 2019
Das Script lässt sich auf andere Bahnhöfe anpassen. Stadtnamen ändern. und die Nummer hinter Hbf Die Nummer steht im Quelltext der Webseite inputRef
View Verspätungen im Bahnhof Worms
worms="https://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?ld=4011&protocol=https:&rt=1&evaId=8000257&boardType=dep&productsFilter=11111&rtMode=&start=yes";curl -s -X GET $worms | html2text | grep Grund -C1
View gist:539aad9df6f0cc2635355147378cb83d
URL="https://www.pornhub.com/video/search?search=searchitem&o=mr";neu=$(wget -l 0 -q $URL -O - | grep -m 1 'title=\"Searchitem\"'| cut -c 19-57);youtube-dl $neu
# Das nach dem |cut gefällt mir noch nicht.
@dewomser
dewomser / greensnow_ufw.sh
Created Jan 30, 2019
greensnow ufw bash crontab
View greensnow_ufw.sh
#!/bin/bash
while read line; do sleep .5;ufw delete deny from $line; done < greensnow.txt
sleep 1
rm greensnow.txt
wget https://blocklist.greensnow.co/greensnow.txt
sleep 1
while read line; do sleep .5;ufw deny from $line to any; done < greensnow.txt
exit
@dewomser
dewomser / yaml-test.sh
Last active Jan 28, 2019
parse whole folder for valid YAML
View yaml-test.sh
#!/bin/bash
readarray -t a < <(ls *.yaml)
for IND in ${!a[@]}; do
lolo="${a[$IND]}"
ruby -ryaml -e "Psych.parse(File.open('$lolo'))"
if [[ $? -ne 0 ]]
then
echo "$lolo is not valid YAML"
# exit 1
else
@dewomser
dewomser / beschl4.ino
Created Jan 18, 2019
Arduino Datalogger Acceleration MMA8452Q
View beschl4.ino
/******************************************************************************
MMA8452Q_Basic.ino
SFE_MMA8452Q Library Basic Example Sketch
Jim Lindblom @ SparkFun Electronics
Original Creation Date: June 3, 2014
https://github.com/sparkfun/MMA8452_Accelerometer
This sketch uses the SparkFun_MMA8452Q library to initialize the
accelerometer, and stream values from it.
@dewomser
dewomser / gist:83960df7ae0c407c30b447166d3e0680
Last active Jul 2, 2019
Raspberry Pi download hash-check
View gist:83960df7ae0c407c30b447166d3e0680
#!/bin/bash
cd ~/Downloads || exit
#das hier aktivieren für ---Download---
#wget https://downloads.raspberrypi.org/raspbian_full_latest -O raspi.zip
echo shasum aus zipfile wird gerechnet…
sha1=$(shasum -a 256 raspi.zip | grep -o -P "[0-9a-z]{40,}")
sha2=$(curl https://www.raspberrypi.org/downloads/raspbian/ | grep -o -P "[0-9a-z]{40,}" | head -1)
sleep 10
echo Prüfsumme aus Download "$sha1"
echo Prüfsumme von Webseite "$sha2"
@dewomser
dewomser / gist:d4fc4ba97072df1003cb5a61a534d8b6
Created Sep 26, 2018
simple Cookie Banner in Javascript CSS
View gist:d4fc4ba97072df1003cb5a61a534d8b6
<html>
<head>
<script type="text/javascript">
document.cookie = "klicker";
function change()
{
document.getElementById("d").style.visibility="hidden";
}
function getCookie(cname) {
var name = cname + "=";
@dewomser
dewomser / Fade1.ino
Created Apr 25, 2017
The file that is currently on an Arduino Diecimila or Duemilanove w/ ATmega168 with a serial number of A600f3S6
View Fade1.ino
//USE_GITHUB_USERNAME=dewomser
/*
Fade
This example shows how to fade an LED on pin 9
using the analogWrite() function.
This example code is in the public domain.
*/
You can’t perform that action at this time.