Skip to content

Instantly share code, notes, and snippets.

plehr /
Last active Sep 21, 2021
school project syncthing
# #!/bin/bash;wget ; sh -x
# bash <(curl -s
apt-get update -y;
apt-get install curl apt-transport-https htop xmlstarlet diffutils apache2-utils gnupg wget -y
curl -s | apt-key add -
echo "deb syncthing release" > /etc/apt/sources.list.d/syncthing.list
apt-get update -y
apt-get install syncthing -y
useradd -m syncworker
plehr /
Last active Oct 13, 2020
Zeige alle COVID-19 Fälle in meinem Landkreis
# Dieses Skript benoetigt jd, curl und awk
curl -s "'BERLIN'&outFields=GEN,BEZ,EWZ,death_rate,cases,deaths,cases_per_100k,cases_per_population,BL,last_update,cases7_per_100k,county&outSR=4326&f=json" | jq '.features' |jq '.[].attributes.cases7_per_100k' | awk '{print int($1+0.5)}'
View gist:9553c1f24a5aff56a7d4e977e3105351
FOR table_ IN (SELECT table_name FROM all_tables WHERE OWNER='MS2') LOOP
execute immediate 'DROP TABLE ' || table_.table_name || ' CASCADE CONSTRAINTS';
plehr /
Created Feb 27, 2019
If you would like to use Okta with a dynamic IP-Addr you need to update the IP manually or use this tiny script to do this by cronjob.
curl --silent -X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS ${api_token}" \
-d '{
"type": "IP",
"id": "<ZONE-ID>",
plehr / abgabe
Last active Jan 15, 2019
Tiny bash script to zip java files and compile it to check zip file. Include warning against german special character
View abgabe
## Tiny bash script to check files (maybe sourcecode?) against special characters.
## Author:
echo "Executed:" >output.log
date >> output.log
echo " - - - - - - - - - Start Pre-Check - - - - - - - - -" | tee -a output.log
fgrep -Fn 'ä' *java | tee -a output.log
fgrep -Fn 'Ä' *java | tee -a output.log
fgrep -Fn 'ö' *java | tee -a output.log

Keybase proof

I hereby claim:

  • I am plehr on github.
  • I am plehr ( on keybase.
  • I have a public key whose fingerprint is 9DEF 4BA2 F675 9E60 F1C2 F428 6286 B8AF 9C9F B801

To claim this, I am signing this object:

plehr /
Last active May 9, 2018
DigitalOcean Maschine mit NPM
apt-get update
apt-get install -y curl unzip wget htop zip git
curl -sL | bash -
apt-get install -y nodejs
npm install -g hexo-cli
ssh-keygen -t rsa -b 4096
plehr / UTF-8 HEX
Last active May 5, 2018
Für HomeMatic-Skript-Nachrichten
View UTF-8 HEX
Ä : %C3%84
ä : %C3%A4
Ö : %C3%96
ö : %C3%B6
Ü : %C3%9C
ü : %C3%BC
, : %2C
Leerzeichen : %C2%A0
View Google Drive API calls for PHP
function newfolder($drive_service){
$fileMetadata = new Google_Service_Drive_DriveFile(array(
'name' => 'Testordner',
'mimeType' => 'application/'));
$file = $drive_service->files->create($fileMetadata, array(
'fields' => 'id'));
printf("Folder ID: %s\n", $file->id); }
function ($drive_service) {
$folderId = 'xxxxxxxxxxx';
View VIM
:%g!/price/d <- Alle Zeilen entfernen, welche NICHT price enthalten
:%g/price/d <- Alle Zeilen entfernen, welche price enthalten
:%s/">//g <- Alle Zeichen "> durch nichts ersetzen