Skip to content

Instantly share code, notes, and snippets.

@stif
stif / gist:d03e427d33334d649dc944bc40138e9d
Created June 27, 2016 09:05
OpenELEC 6.0.3 Build error after libcec update
UNPACK libcec
APPLY PATCH (common) /home/stif/Dokumente/OpenELEC/OpenELEC.tv/packages/devel/libcec/patches/libcec-00-imx6-support.patch
can't find file to patch at input line 30
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From a7f3315333c1a79259a763c6542a6cd71855b357 Mon Sep 17 00:00:00 2001
|From: Stefan Saraev <stefan@saraev.ca>
|Date: Thu, 7 May 2015 11:35:04 +0300
|Subject: [PATCH] imx support
@stif
stif / docker-compose.yaml
Created August 22, 2017 20:15
c´t Umbauanleitung Docker-Compose File
version: '2.1'
networks:
extern:
ipam:
config:
- subnet: 172.20.0.0/24
gateway: 172.20.0.1
services:
nginxproxy:
@stif
stif / open3a-phpinfo.html
Created November 19, 2017 20:08
Open3A phpinfo
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0026)http://10.0.20.37/info.php -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body {background-color: #fff; color: #222; font-family: sans-serif;}
pre {margin: 0; font-family: monospace;}
a:link {color: #009; text-decoration: none; background-color: #fff;}
a:hover {text-decoration: underline;}
table {border-collapse: collapse; border: 0; width: 934px; box-shadow: 1px 2px 3px #ccc;}
.center {text-align: center;}

cnt-host Interfaces

/etc/network/interfaces.d/enp2s0

auto enp2s0
iface enp2s0 inet dhcp

auto enp2s0.10
iface enp2s0.10 inet dhcp
#include <Basecamp.hpp>
Basecamp iot;
void onMqttConnect(bool sessionPresent) {
Serial.println("Connected to MQTT.");
Serial.print("Session present: ");
Serial.println(sessionPresent);
uint16_t packetIdSub = iot.mqtt.subscribe("test/lol", 2);
Serial.print("Subscribing at QoS 2, packetId: ");
Serial.println(packetIdSub);
@stif
stif / http-server.js
Last active April 1, 2024 04:10
node.js HTTP Server
import * as http from 'http'
import { URL } from 'url'
import { stat, readFile } from 'fs/promises';
import { join, extname } from 'path';
// you can pass the parameter in the command line. e.g. node http_server.js 3000
const port = process.argv[2] || 9000;
// maps file extention to MIME types
@stif
stif / Part1.sh
Last active April 18, 2023 09:17
APU2 Ubuntu Installation
#!/bin/bash
DISKLABEL_SYSTEM="Root"
DISKLABEL_STORAGE="Docker"
PARTSIZE_ROOT="8" # in GB
PARTSIZE_SWAP="12" # root+swap (eg 4G root + 4G swap = 8G)
INSTALL_DEVICE=/dev/sda
@stif
stif / Readme.md
Created October 27, 2023 10:45
Unifi VLAN Creation Automation

Selenium Webdriver

with Selenium Webdriver you can automate tasks on a webpage. In this Scenario Selenium opens chromium webbroser, Logs into the Unifi Controller WebUI, read the config.csv file and add a VLAN for every Line in the CSV File.

npm install
USER=myUnifiUser PASS=myUnifiPass node index.js
create Vlan: V13-VLAN13 Name
create Vlan: V14-VLAN14 Name
...