Skip to content

Instantly share code, notes, and snippets.

View slashtechno's full-sized avatar
🚀
Floating through space 🌌 🌎

Angad Behl slashtechno

🚀
Floating through space 🌌 🌎
View GitHub Profile
@solarkraft
solarkraft / syncthing-automerge.py
Last active November 27, 2025 18:25
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™️).
# This script automatically handles Syncthing conflicts on text files by applying a
# git three-way merge between the previously synced version and each divergent version.
# It depends on the watchdog package and git.
# For automatic dependency installation when running with ´uv run --script deconflicter.py´:
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "watchdog",
@umbernhard
umbernhard / arch-secure-install.md
Last active November 26, 2025 02:00
Building a Secure Arch Linux Device

Building a Secure Arch Linux Device

Locking down a linux machine is getting easier by the day. Recent advancements in systemd-boot have enabled a host of features to help users ensure that their machines have not been tampered with. This guide provides a walkthrough of how to turn on many of these features during installation, as well as reasoning for why certain features help improve security.

The steps laid out below draw on a wide variety of existing resources, and in places I'll point to them rather than attempt to regurgitate full explanations of the various security components. The most significant one, which I highly encourage everyone to read, is Rod Smith's site about secure boot, which is the most comprehensive and cogent explanation of UEFI, boot managers and boot loaders, and secure boot. Another incredibly useful resources is Safeboot, which encapsulates many of the setup steps below in a Debian application.

@hahwul
hahwul / golang-custom-flag-usage.go
Created February 13, 2021 14:36
Golang custom flag usage
package main
import (
"flag"
"fmt"
)
func main() {
flag.String("a", "", "flag 1")
flag.String("b", "", "flag 2")
flag.String("c", "", "flag 3")
@oofnikj
oofnikj / answerfile
Last active December 5, 2025 18:17
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"
@awabcodes
awabcodes / systemd-service-config.md
Last active June 18, 2022 20:42
[Systemd Config] #systemd #linux #systemd_service

Create a systemd service

sudo nano /etc/systemd/system/webapp.service
[Unit]
Description=Webapp Service
[Service]
User=username
@csinghdev
csinghdev / apache_virtualhost_example.conf
Created March 14, 2020 11:52
Apache virtual host conf file
<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example
ErrorLog ${APACHE_LOG_DIR}/example.com-error.log
CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined
<Directory /var/www/example/>
@priyanshus
priyanshus / port-scan.sh
Last active September 7, 2024 08:39
NMAP scan for a list of subdomains
#!/bin/bash
#Performs port scan using nmap
print_usage() {
cat << _EOF_
Utility to scan open ports. Can be used to scan ports for a domain or a list of domains specified in a file.
Example Usage:
-h, --help Show brief help
-d, --domain Domain name or ip to scan
-f, --file Spefify a file containing domains/IPs to scan
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active November 2, 2025 23:00
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::PostMessage(-1,0x0112,0xF170,2)
@meain
meain / loading_messages.js
Last active November 27, 2025 09:22
Funny loading messages
export default [
"Reticulating splines...",
"Generating witty dialog...",
"Swapping time and space...",
"Spinning violently around the y-axis...",
"Tokenizing real life...",
"Bending the spoon...",
"Filtering morale...",
"Don't think of purple hippos...",
"We need a new fuse...",