Skip to content

Instantly share code, notes, and snippets.

@stif
stif / http-server.js
Last active Jul 28, 2022
node.js HTTP Server
View http-server.js
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
View basecamp-mqtt-test
#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);
View InterVlanRouting.md

cnt-host Interfaces

/etc/network/interfaces.d/enp2s0

auto enp2s0
iface enp2s0 inet dhcp

auto enp2s0.10
iface enp2s0.10 inet dhcp
View open3a-phpinfo.html
<!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;}
@stif
stif / docker-compose.yaml
Created Aug 22, 2017
c´t Umbauanleitung Docker-Compose File
View docker-compose.yaml
version: '2.1'
networks:
extern:
ipam:
config:
- subnet: 172.20.0.0/24
gateway: 172.20.0.1
services:
nginxproxy:
@stif
stif / gist:d03e427d33334d649dc944bc40138e9d
Created Jun 27, 2016
OpenELEC 6.0.3 Build error after libcec update
View gist:d03e427d33334d649dc944bc40138e9d
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