Skip to content

Instantly share code, notes, and snippets.

View munim's full-sized avatar

Abdul Munim munim

  • Germany
  • 04:40 (UTC +02:00)
  • X @munim
View GitHub Profile
@solarkraft
solarkraft / syncthing-automerge.py
Created December 30, 2022 18:00
Monitors a Syncthing-synced directory and tries to merge conflicting files (based on https://www.rafa.ee/articles/resolve-syncthing-conflicts-using-three-way-merge/). Probably adaptable for other directory types, but only tested with Logseq (works for me™️).
import os
import time
import re
import subprocess
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
def get_relative_path(path):
return os.path.relpath(path)

Poor Man's Global Traffic Manager

Sometimes we need to add redundancy to some service or server which happen to be a public-facing entry point of our infrastructure. For example, imagine we want to add a high availability pair for a load balancer which sits on the edge of network and forwards traffic to alive backend servers.

                                             ┌─────────────┐
                                             │             │
                                      ┌─────►│  Backend 1  │
                                      │      │             │
                                      │      └─────────────┘
@1player
1player / bazarr.docker-compose.yml
Last active February 17, 2024 20:41
Poor man's media centre
# Bazarr downloads subtitles
version: "3.4"
services:
bazarr:
image: linuxserver/bazarr:1.0.5-development
container_name: bazarr
restart: unless-stopped
environment:
- TZ=Europe/London
@vnl
vnl / MediaDownloader.yaml
Created October 5, 2021 20:10
Docker-compose file which shows how to set up Sonarr, Radarr, Prowlarr, Lidarr, Jackett, QBittorrent and a VPN container so that all all traffic from the containers is routed through the VPN. Also includes get_iplayer containers, which is not routed through the VPN.
version: "3"
services:
vpn:
image: qmcgaw/gluetun
container_name: vpn
cap_add:
- NET_ADMIN
ports:
- 8888:8888/tcp # HTTP proxy
- 8388:8388/tcp # Shadowsocks
@danielwetan
danielwetan / nodejs-cicd-github-actions.md
Last active April 30, 2024 07:36
Deploy Node.js to VPS using Github Actions

Deploy Node.js to VPS using Github Actions

Steps to deploy Node.js to VPS using PM2 and Github Actions

1. Clone repo to VPS folder

@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active May 2, 2024 11:53
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@Biswa96
Biswa96 / Remove_MIUI_Bloatware.CMD
Last active April 7, 2024 15:38
Remove bloatware applications from MIUI ROM in Xiaomi phones
@echo off
set /p Y=Enter adb.exe folder path:
cd /d %Y%
adb devices
pause
for %%X in (
"com.amazon.appmanager"
"com.android.browser"
"com.android.chrome"
"com.android.email"
@vielhuber
vielhuber / script.txt
Last active April 17, 2024 12:20
ImageMagick: Increase pdf scan contrast and sharpening #tools
convert -density 150 input.pdf -brightness-contrast 5x25 -sharpen 0x1 output.pdf
convert -density 300 input.pdf -colorspace gray -normalize -level 50%,51% -sharpen 0x1 output.pdf
convert -density 300 input.pdf -colorspace gray -normalize -level 25%,26% -sharpen 0x1 output.pdf
convert -density 300 input.pdf -colorspace gray -normalize -modulate 150 -sharpen 0x1 output.pdf
convert -density 300 input.pdf -contrast -contrast -contrast -contrast -sharpen 0x1 output.pdf
@vasanthk
vasanthk / System Design.md
Last active May 2, 2024 17:45
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?