Skip to content

Instantly share code, notes, and snippets.

View hdmn's full-sized avatar
🥸

hdmn hdmn

🥸
View GitHub Profile
@egeneralov
egeneralov / linux.sh
Last active January 18, 2024 04:04
linux to mikrotik ip tunnel
ip tunnel add ipip local ${linux_ip} remote ${mikrotik_ip} mode ipip
ip link set ipip up
ip addr add 192.168.3.1/30 dev ipip
iptables -t mangle -A POSTROUTING -o ipip -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
iptables -t nat -A POSTROUTING -s 192.168.3.0/30 -o ${linux_output_iface} -j MASQUERADE
@jkjuopperi
jkjuopperi / gist:e2fefa48c79bafb59b23ffefa8384bb3
Last active June 24, 2024 11:53
MikroTik wireless channels
/interface wireless channels
add band=2ghz-b/g/n width=20 list=2GHz/20MHz frequency=2412 name=ch1
add band=2ghz-b/g/n width=20 list=2GHz/20MHz frequency=2437 name=ch6
add band=2ghz-b/g/n width=20 list=2GHz/20MHz frequency=2462 name=ch11
add band=5ghz-onlyac width=20 list=5GHz/80MHz extension-channel=Ceee frequency=5180 name=ch36/38/42
add band=5ghz-onlyac width=20 list=5GHz/80MHz extension-channel=eCee frequency=5200 name=ch40/38/42
add band=5ghz-onlyac width=20 list=5GHz/80MHz extension-channel=eeCe frequency=5220 name=ch44/46/42
add band=5ghz-onlyac width=20 list=5GHz/80MHz extension-channel=eeeC frequency=5240 name=ch48/46/42
@stroebs
stroebs / make-chr.sh
Last active July 25, 2024 02:48
Install Mikrotik CHR on a Digital Ocean droplet (Ubuntu 20.04 tested working 29/03/2022)
#!/bin/bash
#
# Digital Ocean Ubuntu 18.04 x64 Droplet with "Regular Intel" CPU.
# Running:
# git clone https://gist.github.com/54fc09734a3911e91eeeb43434f117df.git
# cd 54fc09734a3911e91eeeb43434f117df/
# chmod +x make-chr.sh
# ./make-chr.sh
#
# Once the reboot is done, login with root/CHANGEME and change the password!
@dks77
dks77 / 99-login-german-fon
Last active October 10, 2021 00:12 — forked from cusspvz/99-login-fon
Telekom_FON Hotspot: auto-login bash script wget germany wispr client openwrt
#!/bin/sh
# place this file at: /etc/hotplug.d/iface/99-login-telekom_fon
# based on source: https://gist.github.com/cusspvz/3ab1ea9110f4ef87f0d2e1cd134aca67
#
# loginscript for german telekom_FON hotspot (NOT the general Telekom Hotspot)
# technic: uses HTTP POST formular; extract URLs from WIPSr
#
# Preparations
digraph architecture {
rankdir=LR;
// Storage - #303F9F (dark blue)
node[fillcolor="#303F9F" style="filled" fontcolor="white"];
database[label="DB"]; cache[label="Redis"];
// Client-side Apps - #FFEB3B (yellow)
node[fillcolor="#FFEB3B" style="filled" fontcolor="black"];
front_end[label="Front-end App"]; extension[label="Browser Extension"];
@IAMIronmanSam
IAMIronmanSam / pem2cer.sh
Created September 9, 2016 23:31
.PEM to .CER using openssl
openssl x509 -inform PEM -in cacert.pem -outform DER -out certificate.cer
@c0deaddict
c0deaddict / hd44780.lua
Created November 13, 2015 21:22
NodeMCU HD44780
local bor, band, bnot = bit.bor, bit.band, bit.bnot
local function write4bits(self, bits, char_mode)
tmr.delay(1000)
gpio.write(self.pin_rs, char_mode and gpio.HIGH or gpio.LOW)
for n = 1, 2 do
for i, pin in ipairs(self.pin_db) do
local j = (2-n)*4 + (i-1)
local val = (bit.isset(bits, j))
<?php $zeiten = page('oeffnungszeiten') ?>
<?php if($zeiten->status() == 'normal'): ?>
<!-- hier werden die öffnungszeiten abhängig vom tag angezeigt -->
<?php else if($zeiten->status() == 'open'): ?>
<!-- hier wird einfach nur angezeigt dass geöffnet ist -->
<?php else: ?>
<!-- hier wird angezeigt dass geschlossen ist -->
<?php endif ?>
@flazer
flazer / gpstimesync.py
Created November 18, 2013 09:01
Connects to your GPS-Dongle and synchronize systemtime with GPS-UTC-time. Handles local-timezones Needs PYTZ-Library: http://pytz.sourceforge.net/#installation
#! /usr/bin/python
#####################
# GPS-TIME-SYNC #
# 2013 flazer #
# info@flazer.net #
#####################
# Connects to your GPS-Dongle and synchronize systemtime with GPS-UTC-time.
# Handles local-timezones
@iimos
iimos / optimize-images.sh
Last active August 21, 2023 08:50
Script for JPEG images optimization
#! /bin/sh
# Usage 1:
# optimize-images.sh /images/dir
#
# Usage 2:
# cd /images/dir
# optimize-images.sh
EXTENSIONS="jpe?g"