Skip to content

Instantly share code, notes, and snippets.

@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 19, 2025 05:13
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@omnibs
omnibs / 101-rx-samples.md
Last active March 22, 2025 11:58
101 Rx Samples in C#

101 Rx Samples in C#

This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.

Here's the unedited original, translated to Github Markdown glory:

101 Rx Samples - a work in progress

@milovidov983
milovidov983 / ConvertStringToUtf8Bom.cs
Created August 14, 2018 13:49
How to convert UTF-8 to UTF-8 with BOM c# string
private string ConvertStringToUtf8Bom(string source) {
var data = Encoding.UTF8.GetBytes(source);
var result = Encoding.UTF8.GetPreamble().Concat(data).ToArray();
var encoder = new UTF8Encoding(true);
return encoder.GetString(result);
}
@AysadKozanoglu
AysadKozanoglu / capture Passwords tcpdump.md
Created February 12, 2019 13:33
get plain passwords with tcpdump

Capture SMTP Email

tcpdump -nn -l port 25 | grep -i 'MAIL FROM\|RCPT TO'

Extract HTTP Passwords in POST Requests

tcpdump -s 0 -A -n -l | egrep -i "POST /|pwd=|passwd=|password=|Host:"

Capture FTP Credentials and Commands

#!/bin/bash
# Script to Auto Update Plex on Synology NAS
#
# Must be run as root.
#
# @author Martino https://forums.plex.tv/u/Martino
# @see https://forums.plex.tv/t/script-to-auto-update-plex-on-synology-nas-rev4/479748
mkdir -p /tmp/plex/
@LosantGists
LosantGists / arduino-modbus-rtu.ino
Created February 27, 2020 21:37
Example sketch that reads Modbus RTU data with an Arduino
#include <ArduinoModbus.h>
// How often (in milliseconds) the sensors will be read.
const unsigned long REPORT_INTERVAL = 1000;
void setup() {
Serial.begin(9600);
while(!Serial);
if (!ModbusRTUClient.begin(9600)) {
@yarnairb
yarnairb / MusicBee2Plex.py
Last active February 2, 2025 19:04
Script to sync my MusicBee m3u playslists with Plex so I can use PlexAmp as my own Spotify
#!/usr/bin/env python3
import sys
import signal
import os
import json
import re
import argparse
import configparser
import pathlib