Skip to content

Instantly share code, notes, and snippets.

View dunkelstern's full-sized avatar
🐢

Johannes Schriewer dunkelstern

🐢
View GitHub Profile
@dunkelstern
dunkelstern / vpn_setup.ps1
Created August 8, 2016 15:38
VPN Setup script for windows powershell
# Set these to the correct values
$server_address = "vpn.example.com"
$connection_name = "VPN Connection"
$certificate_path = "certificate.p12"
$ca_cert_path = "strongswanCert.pem"
$password = ConvertTo-SecureString -String "P12 passphrase" -AsPlainText -Force
# Import machine cert
Import-PfxCertificate -FilePath $certificate_path -CertStoreLocation Cert:\LocalMachine\My\ -Password $password
@dunkelstern
dunkelstern / logcat.py
Created September 7, 2016 16:57
ScribeJS commandline logfile dumper and filtering tool (python 3)
#!/usr/bin/env python
import json
import argparse
import itertools
import time
from dateutil.parser import parse
import datetime
@dunkelstern
dunkelstern / nginx.conf
Created September 21, 2016 12:33
nginx RTMP config
user rtmp;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
@dunkelstern
dunkelstern / style.xsl
Created September 21, 2016 12:58
nginx rtmp status style sheet
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
@dunkelstern
dunkelstern / portainer_status.py
Created February 3, 2023 17:58
Use portainer API to query for container health, with support for stacks, needs python3, no external deps
#!/usr/bin/python3
from typing import Union, List, Any, Dict, Optional
import argparse
import os
import json
import ssl
from urllib.request import urlopen, Request
JSON = Union[List[Any], Dict[str, Any]]
@dunkelstern
dunkelstern / README.md
Created May 8, 2023 17:58
Systemd Unit for running python application in virtualenv

Assumptions

  • Username is user
  • User is in group user
  • User's home is /home/user
  • Python application is in /home/user/pythonapp
  • Python script is named start.py
  • Virtual environment is /home/user/.virtualenvs/pythonapp created with python -m venv /home/user/.virtualenvs/pythonapp

You can add multiple Environment lines if you need more env-variables

@dunkelstern
dunkelstern / nousa1t.yaml
Created November 9, 2023 19:24
NOUS A1T ESPHome template
esphome:
name: "nousa1t0"
friendly_name: NousA1T0
comment: "Wohnzimmer"
project:
name: "NOUS.Smart-Wifi-Socket_001"
version: "A1T"
#
# Original Tasmota Template: