Skip to content

Instantly share code, notes, and snippets.

View samueljon's full-sized avatar

Samúel Jón Gunnarsson samueljon

View GitHub Profile
@Mau5Machine
Mau5Machine / docker-compose.yml
Last active April 9, 2024 16:00
Traefik Configuration and Setup
version: "3.3"
services:
################################################
#### Traefik Proxy Setup #####
###############################################
traefik:
image: traefik:v2.0
restart: always
@habovh
habovh / cors_support.conf
Last active April 5, 2024 15:57 — forked from agouriou/nginx.conf
Example Nginx (> 1.9) configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs. Handle error status (4xx, 5xx) and expose headers.
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support.conf"
# under your Nginx configuration directory and placing the following
# statement inside your location block(s):
#
# include cors_support.conf;
#
# A limitation to this method is that Nginx doesn't currently send headers
@NathanGiesbrecht
NathanGiesbrecht / noip2.service
Last active February 24, 2024 01:32
Systemd Service file for no-ip.com dynamic ip updater
# Simple No-ip.com Dynamic DNS Updater
#
# By Nathan Giesbrecht (http://nathangiesbrecht.com)
#
# 1) Install binary as described in no-ip.com's source file (assuming results in /usr/local/bin)
# 2) Run sudo /usr/local/bin/noip2 -C to generate configuration file
# 3) Copy this file noip2.service to /etc/systemd/system/
# 4) Execute `sudo systemctl daemon-reload`
# 5) Execute `sudo systemctl enable noip2`
# 6) Execute `sudo systemctl start noip2`
@olafz
olafz / tweak_6rd.rsc
Created January 8, 2020 19:37
Tweak IPv6 mikrotik RouterOS (6RD)
# Dutch ISP Tweak offers IPv6 via 6rd. The commands below configure a mikrotik
# RouterOS with 6rd. This was tested with RouterOS 6.46.1.
#
# First, you'll have to request IPv6 information from Tweak. You'll receive
# a fixed IPv4 address and some other information. For the rest of this guide,
# I assume the following information is received from Tweak:
#
# ===
# IPv4 address: 185.227.123.123
# IPv4 mask length: 22
@techniq
techniq / audit_mixin.py
Created March 16, 2013 01:05
Useful SQLAlchemy Mixins
from datetime import datetime
from sqlalchemy import Column, Integer, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declared_attr
from flask_security import current_user
class AuditMixin(object):
created_at = Column(DateTime, default=datetime.now)
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now)
@f41gh7
f41gh7 / api-server.yaml
Last active August 21, 2023 10:31
vm operator configuration examples
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMServiceScrape
metadata:
name: apiserver
namespace: monitoring-system
spec:
endpoints:
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
bearerTokenSecret:
key: ""
@mtrimarchi
mtrimarchi / 6to4.rsc
Created May 30, 2020 23:08
Working 6rd/6to4 script for modems without native IPV6 in firmware operating on native IPV6 network - https://forum.mikrotik.com/viewtopic.php?t=134621
# 6to4.rsc
# Notes
# We cannot use variables here, somehow the router rejects them.
/interface 6to4
# The first value to replace here is your WAN IPv4 address (the one you get when you type "my ip" in google search
# The second value is the one called "IPv4 Relay" in the calculator.
add clamp-tcp-mss=yes disabled=no dont-fragment=no dscp=inherit local-address=<WAN_IP_HERE> mtu=1480 name=6rd remote-address=<IPV4_RELAY_ADDRESS_HERE>
# "IPv6 6RD Adress"
@johnkary
johnkary / Request.php
Created December 4, 2013 03:59
Example of how to request raw XML via a SoapClient
<?php
use Psr\Log\LoggerInterface;
/**
* Assembles and dispatches the SOAP request body XML and returns the
* Response body XML from the vendor API.
*/
class Request
{
# Pollenvarsel for Home Assistant - Oppdatert 29.04.2021 grunnet endret URL/struktur hos Pollenkontroll.no
- platform: rest
name: pollen_json
resource: https://pollenkontroll.no/api/middleware/pollen/b5bb4856-2117-433d-bf18-53504ef2f101
scan_interval: 21600
value_template: 'OK'
json_attributes:
- "forecast"
@hhromic
hhromic / tradfri.sh
Last active April 16, 2023 21:06
Show information about IKEA Tradfri devices firmware from the official IKEA servers in Linux
#!/usr/bin/env bash
# Show information about IKEA Tradfri devices firmware from the official IKEA servers
# script by github.com/hhromic
# optional filter
declare -r FILTER=$1
# URLs for firmware channels
declare -r -A CHANNEL_URLS=(
[CURRENT]=http://fw.ota.homesmart.ikea.net/feed/version_info.json