Skip to content

Instantly share code, notes, and snippets.

View sgeto's full-sized avatar

Ali Abdulkadir sgeto

View GitHub Profile
@tdussa
tdussa / failover.md
Last active September 15, 2025 20:10
MikroTik failover routing description (living document)

MikroTik Routing Failover

This is meant to be a somewhat-easier-to-digest recap of the discussion that can be found on the MikroTik forum at this URL: https://forum.mikrotik.com/viewtopic.php?f=23&t=157048&p=836497&hilit=failover#p836497 Note that the forum discussion not only addresses failover, but also load balancing at the same time (without explicitly saying so in the beginning).

For the sake of this document, we'll make some assumptions:

@socram8888
socram8888 / wg-refresh.sh
Last active May 25, 2025 18:03
Refresh script for CloudFlare Warp on OpenWRT devices
#!/bin/ash
set -euo pipefail
cd $(dirname "$0")
CF_API=https://api.cloudflareclient.com/v0i1909051800
WG_IFACE=cfwarp
regen=true
if [ -e keys.cfg ]; then
@oofnikj
oofnikj / answerfile
Last active October 27, 2025 01:48
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"
@Spirit-act
Spirit-act / complementary_calculator.cs
Last active June 4, 2023 07:04
complementary color calculator
using System;
public class Program
{
public static void Main()
{
int[] rgb_color = new int[]{255, 0, 255};
string hex_color = "#FF00FF";
Console.WriteLine(calculate(hex_color));
int[] x = calculate(rgb_color);
#!/usr/bin/awk -f
BEGIN {
D="cd /overlay/upper/usr/lib/opkg/info&&"
C=D"ls *.list"
S="sort -n"
while(C|getline>0) {
P=substr(F=$1,1,length($1)-5)
J=D"du -sk $(cat "F")"
s=0
while(J|getline>0) {
@simonswine
simonswine / install-openjdk8-musl.sh
Created August 11, 2019 10:54
Install alpine openjdk8 onto OpenWRT (armv7)
#!/bin/sh
set -o errexit
set -o nounset
set -o pipefail
set -x
REVISION=8.212.04-r0
URL=http://dl-cdn.alpinelinux.org/alpine/v3.10/community/armv7/
PACKAGES="openjdk8 openjdk8-jre openjdk8-jre-lib openjdk8-jre-base"
@pawl
pawl / webdav.conf
Last active August 1, 2023 05:41
Installing nginx webdav server on ubuntu 20.04
server {
listen 80;
listen [::]:80;
root /var/dav/webdav_root;
# dav allowed method
dav_methods PUT DELETE MKCOL COPY MOVE;
# Allow current scope perform specified DAV method
dav_ext_methods PROPFIND OPTIONS;
@ChronoMonochrome
ChronoMonochrome / midas_recovery.sh
Created May 10, 2019 21:18
Midas TWRP build script
SRC=/media/system/root/LOS15/kernel/samsung/midas
KERNEL_OUT=/ramdisk
ANDROID_OUT=/media/system/root/LOS15/out
GCC=/media/system/root/LOS15/prebuilts/gcc/linux-x86/arm/arm-eabi-7.4/bin/arm-linux-gnueabi-
TARGET=midas
#$ANDROID_OUT/host/linux-x86/bin/mkbootfs -d $ANDROID_OUT/target/product/$TARGET/system \
# $ANDROID_OUT/target/product/$TARGET/recovery/root | $ANDROID_OUT/host/linux-x86/bin/minigzip > \
# $ANDROID_OUT/target/product/$TARGET/recovery-ramdisk.img
@fnky
fnky / ANSI.md
Last active November 1, 2025 10:01
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@morteza-mori
morteza-mori / mikrotik
Created October 2, 2018 08:52
Mikrotik nslookup
put [resolve google.com server 8.8.8.8]