Skip to content

Instantly share code, notes, and snippets.

View unreal4u's full-sized avatar

Camilo Sperberg unreal4u

View GitHub Profile
@unreal4u
unreal4u / listado.txt
Created September 12, 2019 19:43
Listado de películas y series en Disney+
10 Things I Hate About You
101 Dalmatians
101 Dalmatians II: Patch's London Adventure
102 Dalmatians
12 Dates of Christmas
20,000 Leagues Under the Sea
The Absent-Minded Professor
Adventures in Babysitting
The Adventures of Bullwhip Griffin
The Adventures of Huck Finn
@unreal4u
unreal4u / readout.py
Created August 28, 2018 21:00
Reads out a DHT22 sensor and publishes the data to a MQTT broker
# Raspberry Pi Tips & Tricks - https://raspberrytips.nl
import Adafruit_DHT
humidity, temperature = Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, 2)
#print temperature
humidity = round(humidity, 2)
temperature = round(temperature, 2)
@unreal4u
unreal4u / run.php
Created August 28, 2018 20:57
Turns on or off a relay depending on the value that the MQTT broker sends.
<?php
/**
* This script is a quick and dirty way to turn a relay on or off in the basement
* of my house. It will listen to a certain topic and activate the commands that
* are sent in that topic. It has a built-in failsave so that the fan turns off
* automatically after 45 minutes.
*/
declare(strict_types=1);
@unreal4u
unreal4u / ssl.md
Created March 6, 2018 09:41 — forked from hyperized/ssl.md

Verify matching signatures

Verify the CSR:

openssl req -noout -modulus -in star_mydomain_tld.csr | openssl md5

Verify the KEY:

openssl rsa -noout -modulus -in star_mydomain_tld.key | openssl md5

Verify the CRT:

<pre>== Generic PHP information
PHP version: 7.1.14
Server: Probably CLI
Maximum execution time: 0 seconds
Maximum memory size: 128.00 MB (134217728 bytes)
Maximum upload size: 2.00 MB (2097152 bytes)
Modules loaded:
@unreal4u
unreal4u / gist:3b1a1fce81408dd3561d5751aa5da7f1
Last active December 20, 2017 09:48
Check whether it is already past a certain hour in a timezone
<?php
# 3v4l.org: https://3v4l.org/SpvCY
/**
* Incorrect check: with diff
*/
function isPastDate(\DateTimeImmutable $serverTime, \DateTimeImmutable $localTime): bool
{
$endResult = $serverTime->diff($localTime);
return $endResult->invert === 1;
@unreal4u
unreal4u / 50-httpd-php.conf
Last active February 19, 2022 12:00
Filter for logstash for access and error logs generated by apache2.(2|4) and php7
filter {
# Analyze access log
if [fields][type] == "apache-access" {
# First part: get every common message
grok {
match => { "message" => "^%{IP:[apache2][access][remote_ip]} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] " }
overwrite => "message"
}
# Get the specifics
@unreal4u
unreal4u / gist:4ccdfd28ad35760eac58
Last active January 15, 2016 22:24
Bisect log smarty
unreal4u-MBP:smarty unreal4u$ git bisect start
unreal4u-MBP:smarty unreal4u$ git bisect good v3.1.27
unreal4u-MBP:smarty unreal4u$ git bisect bad v3.1.28
Bisecting: 116 revisions left to test after this (roughly 7 steps)
[af6f77a9e6db1b1ed7d06794d6f230d43de74701] create raw compiled object to avoid checking for compiled file
unreal4u-MBP:smarty unreal4u$ git bisect good
Bisecting: 58 revisions left to test after this (roughly 6 steps)
[7f0a2f788f7382bba41324ff1e4b11210f56cfa3] Merge pull request #95 from dshepherd/patch-1
unreal4u-MBP:smarty unreal4u$ git bisect good
Bisecting: 29 revisions left to test after this (roughly 5 steps)
@unreal4u
unreal4u / onename
Last active October 27, 2016 21:57
Verifying that "unreal4u.id" is my Blockstack ID. https://onename.com/unreal4u
@unreal4u
unreal4u / id_rsa.pub
Created November 9, 2013 11:20
My public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhkbb2gbXARoBoHgBldyzpOEXY5F0N+JTEmjeaaxXWJSm8I/9FBjFDoilA2uBEeyIcQ4H3WDm3GugSFGfYcUCXxPNrzp19wZxmT5Q99XlEY45b54DosxjYlNtc/tQkGdSN3W9I6Tc1LE/b4Ux5EDXJ3olG+GQGHMn//aMPVt8SmFxEUoEoQt26eyfb4dJSrflMiaXgOJpqYbNZyqsdZulahEqpv9k5jWhJ78M5JMt4V5fGPqlDbGniu/xBzAVgtfuyTWd5ksN1aqUOnA9KocYQydI1MoPC6lJcO0HjczFWoMO0gj37H6kqD1oqpC/idFNFEY1Mc9fel3G/zmmysFyf me@unreal4u.com