Skip to content

Instantly share code, notes, and snippets.

Avatar

Florian Knodt adlerweb

View GitHub Profile
@adlerweb
adlerweb / w1vz.php
Last active Mar 9, 2021
VZ/PHP/DS18B20/Raspi
View w1vz.php
<?php
if (! function_exists('pcntl_fork')) die('PCNTL functions not available on this PHP installation');
$mapping = array(
'000002386cd3' => 'da68e010-df8f-11e3-8d00-af6cb310cad1',
'0000023882e5' => 'e172e220-df8f-11e3-8e0d-7d816ca63379',
'00000238a7bd' => 'e5df5840-df8f-11e3-942a-6d89eca9798f'
);
$middleware = 'http://192.168.101.109/middleware.php';
$maxforks = 10;
View gist:cbcc3f023ea848697270
<?php
while(true) {
$html = file_get_contents('http://1.2.3.4/dht22.tpl');
if(preg_match('/temperature reading is ([\d\.]+)\*C, humidity is ([\d\.]+) ./', $html, $match)) {
vz_add('**UUID_TEMPERATUR**', $match[1]);
vz_add('**UUID_FEUCHTE**', $match[2]);
}
echo '--'."\n";
sleep(10);
View kicad-install.gentoo.patch
--- kicad-install.sh.org 2015-04-07 10:39:13.000000000 +0200
+++ kicad-install.sh 2015-04-08 08:31:41.000000000 +0200
@@ -2,6 +2,7 @@
# Install KiCad from source onto either:
# -> a Ubuntu/Debian/Mint or
# -> a Red Hat
+# -> a Gentoo
# compatible linux system.
#
# The "install_prerequisites" step is the only "distro dependent" one. That step could be modified
@adlerweb
adlerweb / ytwll2m3u.php
Created Apr 26, 2015
Youtube WatchLater to Playlist Script
View ytwll2m3u.php
<?php
/**
* Youtube Watch Later List To Playlist Script
*
* This script fetches your watch later list and outputs it as an M3U playlist
*
* Requirements:
* PHP enabled webserver
* Google PHP API (https://github.com/google/google-api-php-client)
View ESP8266-1080p.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View espdht.ino
#include <Arduino.h>
// wenn aktiv: Meldungen per Serial
#define SERIAL
// wenn auskommentiert: delay()
// wenn aktiv: deep sleep nutzen (Hardwaremodifikation notwendig)
#define DEEP
@adlerweb
adlerweb / bashrc
Created Jul 17, 2016
powerline config
View bashrc
# Powerline
if [ -f `which powerline-daemon` ]; then
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /usr/lib/python3.5/site-packages/powerline/bindings/bash/powerline.sh
fi
View associate.cmd
@echo off
SET SC=HKLM\Software\Classes
SET Extn=001-9 7z-0 arj-4 bz2-2 bzip2-2 cab-7 cpio-7 deb-11 dmg-17 gz-14 fat-21 gz-14 gzip-14 hfs-18 iso-8 lha-6 lzh-6 lzma-16 ntfs-22 rar-3 rpm-10 split-9 squashfs-24 swm-15 tar-13 taz-5 tbz-2 tbz2-2 tgz-14 tpz-14 txz-23 vhd-20 wim-15 xar-19 xz-23 z-5 zip-1001-9 7z-0 arj-4 bz2-2 bzip2-2 cab-7 cpio-7 deb-11 dmg-17 gz-14 fat-21 gz-14 gzip-14 hfs-18 iso-8 lha-6 lzh-6 lzma-16 ntfs-22 rar-3 rpm-10 split-9 squashfs-24 swm-15 tar-13 taz-5 tbz-2 tbz2-2 tgz-14 tpz-14 txz-23 vhd-20 wim-15 xar-19 xz-23 z-5 zip-1
FOR %%j IN (%Extn%) DO (
FOR /F "tokens=1,2 delims=-" %%A IN ("%%j") DO (
REG ADD %SC%\.%%A /VE /D "7-Zip.%%A" /F
REG ADD %SC%\7-Zip.%%A /VE /D "%%A Archive" /F
REG ADD %SC%\7-Zip.%%A\DefaultIcon /VE /D "%PROGRAMFILES%\7-Zip\7z.dll,%%B" /F
View keybase.md

Keybase proof

I hereby claim:

  • I am adlerweb on github.
  • I am adlerweb (https://keybase.io/adlerweb) on keybase.
  • I have a public key whose fingerprint is 7CBC 82F8 8284 B4EB 79E4 0AC7 C374 B04A 1A1E F2DA

To claim this, I am signing this object:

View sds011.php
<?php
if($argc != 2) {
echo 'Usage: '.$argv[0].' Port'."\n";
echo 'example: '.$argv[0].' /dev/ttyUSB0'."\n";
exit(2);
}
$port = @fopen($argv[1], 'r+');
if(!$port) {