Skip to content

Instantly share code, notes, and snippets.

@mepley1
mepley1 / main.zig
Created October 5, 2025 08:39 — forked from lithdew/main.zig
zig: listen for SIGINT (linux)
const std = @import("std");
const print = std.debug.print;
const assert = std.debug.assert;
pub const signalfd_siginfo = extern struct {
signo: u32,
errno: i32,
code: i32,
pid: u32,
@mepley1
mepley1 / password.txt
Created March 17, 2025 00:32 — forked from gabonator/password.txt
HiSilicon IP camera root passwords
Summary of passwords by sperglord8008s, updated November 1. 2020. For login try "root", "default", "defaul" or "root"
00000000
059AnkJ
4uvdzKqBkj.jg
7ujMko0admin
7ujMko0vizxv
123
1111
1234
@mepley1
mepley1 / sddm-greeter-test-mode.md
Last active March 20, 2025 00:47
Launch SDDM greeter from active desktop session to test themes/customizations
# Launch SDDM greeter instance in test mode, using given theme
# Note: any custom fonts used need to be readable by the greeter.
sddm-greeter --test-mode --theme /usr/share/sddm/themes/<theme-name>
@mepley1
mepley1 / zig-sentinel-terminated-to-slice.md
Last active March 12, 2025 10:32
Zig convert sentinel-terminated pointer to slice
  • To convert from a zero-terminated pointer (i.e. [*:0]const u8) to a slice, use std.mem.span
  • To convert from a zero-terminated sentinel slice (i.e. [:0]const u8) to a zero-terminated pointer ([*:0]const u8) call .ptr
  • To convert from a slice to a zero terminated pointer, use std.mem.Allocator.dupeZ
// "Hello" is a zero-terminated array of u8
const x: [:0]const u8 = "Hello";
const x_ptr: [*:0]const u8 = x.ptr;
const x_slc: []const u8 = std.mem.span(x_ptr);
@mepley1
mepley1 / routeros-block-IoT-ping.md
Last active June 25, 2023 18:59
RouterOS: Detect and block IPs pinged by IoT devices

MikroTik RouterOS firewall filters, to detect and block an IoT device on your network from pinging home. Most do this to check for connectivity but sometimes they get caught doing "more."

The first rule will add any address the device tries to ping (or send other ICMP traffic to) to a dynamic address-list. The second rule blocks any traffic the device sends to IPs in that list.

Replace the src-mac-address in the filters with the device's MAC address. Then add the filters and watch the address-list grow.

/ip firewall filter
add action=add-dst-to-address-list address-list="BrosTrend pinged" address-list-timeout=none-dynamic chain=forward protocol=icmp src-mac-address=XX:XX:XX:XX:XX:XX comment="pinged by BrosTrend"
@mepley1
mepley1 / backup_digitalocean.md
Created March 15, 2023 01:29 — forked from amalmurali47/backup_digitalocean.md
Backup DigitalOcean droplet locally

DigitalOcean does not provide a way to download a snapshot of your droplet locally. You can use rsync to accomplish this instead.

On your local machine, assuming you have added your-server in your SSH config:

rsync -aAXHv --append-verify --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} your-server:/
  • -a : archive mode (all files, with permissions, etc.)
  • -A : preserve ACLs/permissions (not included with -a)