home.social

#snippet — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #snippet, aggregated by home.social.

fetched live
  1. Hardening Apache for PCI DSS? Enforce TLS 1.2+, disable SSLv3/TLS 1.0/1.1, set strong ciphers, and enable HSTS. Here's the config for Ubuntu 22.04/Debian 12. #pci #snippet #ValtersIT

    valtersit.com/vault/pci-dss-tl

  2. Stop manually checking iDRAC health. This RACADM snippet configures SNMP trap forwarding for system, storage, and fan alerts to a remote receiver. Works on RHEL 8/9, Ubuntu 22.04, Debian 12, iDRAC7+. #idrac #snippet #alerts

    valtersit.com/vault/configure-

  3. Achieve zero-downtime rolling updates with Docker Compose healthchecks. Configure healthcheck directives for readiness, use depends_on with condition: service_healthy, and deploy.update_config with order: start-first. Works on Docker Compose v2.20+, Docker v24+, Ubuntu 22.04, Debian 12. #docker #snippet #zero-downtime #healthcheck #ValtersIT

    valtersit.com/vault/zerodownti

  4. Control primary component selection in Galera Cluster with node weight configuration. Use pc.weight in wsrep_provider_options to assign higher votes to preferred nodes. During a network partition, the group with the highest total weight wins quorum. #mysql #snippet #node-weight

    valtersit.com/vault/galera-clu

  5. Bash’s `read -s` disables terminal echo via `stty -echo`, reads input, then restores it. Store credentials in a variable cleared after use, and use them only in a subshell to prevent leakage. Secure credential injection for POSIX shells. #bash #snippet #security

    valtersit.com/vault/bash-secur

  6. Need to bulk reset AD user passwords from a CSV? This PowerShell snippet processes each user, handles errors, logs success/failure, and forces password change at next logon. Works on Windows Server 2016-2022. #windows #snippet #powershell

    valtersit.com/vault/bulk-reset

  7. Monitor your Shodan API rate limits with a simple curl to /api-info. Extract credits, query limits, and scan limits via jq. Works on Linux and macOS. Full snippet: #shodan #snippet #api-rate-limits

    valtersit.com/vault/shodan-api

  8. Automate compliance fixes: use OpenSCAP's generate-fix to create a Bash remediation script from XCCDF scan results. Maps failed rules to benchmark fixes for RHEL 8/9, CentOS 8, Fedora 36+. #remediation #snippet #openscap

    valtersit.com/vault/remediatio

  9. Need to cap CPU on a legacy system without cgroups? cpulimit attaches to a PID and sends SIGSTOP/SIGCONT at microsecond intervals to enforce a percentage limit. Works on CentOS 7, Ubuntu 20.04, Debian 11. #linux #snippet #cpu-throttling

    valtersit.com/vault/limit-proc

  10. Need 90th, 95th & 99th percentiles over sliding 1-hour windows for CPU metrics? This Flux script uses window() and quantile() with t-digest for efficient approximate computation. #flux #snippet #percentile

    valtersit.com/vault/flux-query

  11. Use InfluxDB as an annotation source in Grafana to overlay events like deployments on your graphs. This Flux query maps event data from a measurement into the required _time, title, and text columns, using a host tag matched to a dashboard variable. #grafana #snippet #annotations

    valtersit.com/vault/grafana-an

  12. Stop namespace conflicts in Helm. Use .Release.Namespace to dynamically scope resources to the release’s namespace. Works with Helm 3.x on Kubernetes 1.19+. No more cross-namespace clashes. #helm #snippet #kubernetes

    valtersit.com/vault/helm-chart

  13. Secure your container data: Mount host directories as read-only using Docker volumes. The `:ro` flag enforces kernel-level write protection, preventing container processes from altering the host filesystem. Essential for security. #docker #snippet #volumes #read-only #ValtersIT

    valtersit.com/vault/mount-host

  14. Keep Lynis audit logs under control with automated rotation and compression. This snippet configures logrotate to rotate logs weekly, gzip them, and retain 4 weeks of history — preventing disk exhaustion on Ubuntu 22.04, Debian 12, RHEL 9, or CentOS Stream 9. Essential for frequent scans. #lynis #snippet #logrotate

    valtersit.com/vault/lynis-audi

  15. I often get frustrated when copy-pasting commands from a website into my Nushell terminal, especially with those line-escaping backslashes...

    Here is a little snippet I found to solve that issue.

    Read more on my blog: moskitohero.com/post/2026-07-1

    #nushell #bash #shell #snippet

  16. I often get frustrated when copy-pasting commands from a website into my Nushell terminal, especially with those line-escaping backslashes...

    Here is a little snippet I found to solve that issue.

    Read more on my blog: moskitohero.com/post/2026-07-1

    #nushell #bash #shell #snippet

  17. Configure iDRAC for encrypted SNMP v3 traps: racadm sets trap destination, enables alerts, and configures auth/privacy protocols. iDRAC firmware generates traps from Dell MIBs on temperature, power, fan events.

    #idrac #snippet #snmp

    valtersit.com/vault/monitor-id

  18. Enforce HTTPS for all S3 data access with this AWS CLI policy, meeting ISO 27001 A.13.2.3 on secure communications. Uses aws:SecureTransport condition to deny non-TLS requests. Scopable to specific principals.
    #iso #snippet #awss3

    valtersit.com/vault/aws-s3-buc

  19. Analyze per-process page faults with `ps` and `/proc/[pid]/stat`. Track major faults (disk I/O) vs minor faults (cache) via kernel's `task_struct`. Compute delta over time to spot high-impact processes. Production-ready for Ubuntu 22.04, Debian 12, RHEL 8. #linux #snippet #page-fault #major-fault #ValtersIT

    valtersit.com/vault/perprocess

  20. Monitor ZeroTier with Prometheus: Export peer counts, health & bandwidth stats via ZeroTier JSON API, scraped by node_exporter textfile collector. Script queries /status and /network/[ID] endpoints, outputs gauge metrics. Works on Ubuntu 22.04, Debian 12. #zerotier #prometheus #snippet

    valtersit.com/vault/zerotier-w

  21. Calculate P99 latency from structured logs in Loki using LogQL. This query filters for `duration_ms` fields, then applies `quantile_over_time(0.99, [5m])` via the t-digest algorithm for efficient approximation. Works with Loki v2.6+ and LogQL v2.0+. Full guide at #loki #snippet #latency #p99 #ValtersIT

    valtersit.com/vault/logql-quer

  22. Monitor USB insertion events to detect data exfiltration. Use wevtutil to query System log for Event ID 20001 from Microsoft-Windows-Kernel-PnP, filtering for 'USB\VID_' hardware IDs. Outputs timestamps, device description, and serial number. #windows #snippet #usb-monitoring #dlp #ValtersIT

    valtersit.com/vault/monitor-us

  23. Monitor USB insertion events to detect data exfiltration. Use wevtutil to query System log for Event ID 20001 from Microsoft-Windows-Kernel-PnP, filtering for 'USB\VID_' hardware IDs. Outputs timestamps, device description, and serial number. #windows #snippet #usb-monitoring #dlp #ValtersIT

    valtersit.com/vault/monitor-us

  24. Deploy stateful Workers with Durable Objects using `wrangler deploy --bind`. Achieve strongly consistent state across requests via a single global coordinator with SQLite-based persistence. Automatic failover included. #cloudflare #durable-objects #snippet

    valtersit.com/vault/integrate-

  25. Zero-downtime deployments with Fabric: This snippet implements blue-green swapping by checking a symlink, deploying to the inactive environment, and running health checks via c.run(). Perfect for Ubuntu/Debian. #fabric #snippet #blue-green

    valtersit.com/vault/rolling-de

  26. Migrate Terraform state from local to S3 without re-importing resources. Use `terraform state mv` combined with a backend migration to rename and transition state files seamlessly. Works on Linux, macOS, Windows (Terraform 0.12+). Details: #terraform #snippet #state-migration #s3 #ValtersIT

    valtersit.com/vault/migrate-te

  27. Can't trust a scan from within an infected OS. This snippet triggers Windows Defender Offline Scan via WinRE, booting into a minimal PE environment with updated signatures to catch persistent, hidden malware. Windows 10/11, Server 2016+. #windows #snippet #offline-scan #winre #ValtersIT

    valtersit.com/vault/offline-sc

  28. Protect your VLAN configs! Backup vlan.dat on Cisco IOS/IOS-XE switches with `copy flash:vlan.dat flash:vlan-backup.dat`. Restore via `copy flash:vlan-backup.dat flash:vlan.dat` and reload. Essential for disaster recovery or cloning setups. #cisco #snippet #ValtersIT

    valtersit.com/vault/vlan-datab

  29. Need to route multiple subnets through a single IPSec tunnel on VyOS 1.4? This snippet shows how to configure multiple traffic selectors (TS) with strongSwan and XFRM for efficient site-to-site connections. #vyos #snippet #ipsec #traffic-selector #ValtersIT

    valtersit.com/vault/ipsec-tunn

  30. Streamline your LLMNR poisoning workflow: Use Responder's -o and -F flags to output NTLMv1 hashes in Hashcat-compatible format for offline cracking with mode 5500. Works on Kali, Ubuntu, Parrot. #responder #snippet #hashcat #llmnr #ValtersIT

    valtersit.com/vault/llmnr-pois

  31. SCAP drift detection via timestamp-based differential scanning: compare current scan start-time to baseline ARF using oscap info. If delta > 24h, full scan; else quick OVAL delta check. Works on RHEL 8, Ubuntu 22.04, Debian 12. #openscap #snippet #drift

    valtersit.com/vault/scap-times

  32. Detect stealth port knocking with NSE. Use knock.nse to analyze packet captures or simulate knocks, probing sequences like 7000,8000 to uncover hidden firewall openings. Works on Linux, macOS. #nmap #snippet #port-knocking #nse #ValtersIT

    valtersit.com/vault/port-knock

  33. une solution qui me convient en attendant de dépasser le seuil de flemme :

    ```
    nb ls --limit 10 --excerpt 5 --pager --paths --sort --reverse
    ```

    #snippet

  34. Alien verse 1 not full
    Call me
    This year
    This summer
    A new world
    A new order
    A new leader
    New original ep by fend otw check out the lead singles "cody" & "alien" soon droping more singles
    Stay tuned
    Yt channel: youtube.com/@fffend?si=7QgpCwV
    Keep up if you want
    Unknown L*sers
    #music #art #snippet #checkout #design #song #newmusic #undergroundmusic #newartist

  35. To search for Google API keys recursively in the current folder and its sub-folders with ripgrep:

    rg 'AIza[0-9A-Za-z\-_]{35}' -o

    Also shared on Shodan Snippets:

    snippets.shodan.io/c/FHw2r7wWI

    #Security #OneLiner #Google #GoogleAPIKeys #APIkeys #ripgrep #Regex #BugBounty #Snippet

  36. "That's great. And freaky at the same time. My girlfriend knows where the kitchen is in the no longer existing palace of an Egyptian Pharaoh who's been dead for some two thousand years."

    #WIP #snippet #WipQuote

  37. Hi there,
    This lovely #FursuitFriday I have been released from hospital.
    In the past days I was able to resume work I was unable to do for a long time: I actually got work done on my #comic! Here's a little #snippet from the upcoming #chapter. More on my #webcomic later…
    #furry #furryart #art

  38. dans vim pour copier une ligne, contenant par exemple une URL, dans le presse-papier : `:[numero de ligne]y<enter>` ou `:+[distance relative]y<enter>`. L'ouvrir dans un onglet firefox grâce à vimium : `P`.

    #snippet #vim

  39. Hi there,
    I have great #news on this #FursuitFriday! I'll be out of hospital by next Friday and will continue my treatment as an outpatient. The treatment itself has helped me tremendously.
    In fact I started a bigger #artwork just recently, of which I'll show you a #snippet.
    #art #furryart #furry

  40. ça m'a pris 10 minutes chrono pour implémenter pagefind, un moteur de recherche qui fonctionne dans le navigateur et "sans" serveur, sur mon site eleventy. je le fais surtout pour moi, mais en fait, c'est certainement essentiel pour créer de la navigabilité dans un petit site perso. je ne sais pas si ça vaut la peine d'en faire un billet de blog mais en attendant, voici une requête de tirage qui pourra servir d'inspiration : codeberg.org/taniki/11d.im/pul

    #eleventy #snippet #howto

  41. En @proxmox las imágenes #cloud de @alpinelinux están bastante conseguidas, tamaño liviano y con los #snippet todo configurable.
    alpinelinux.org/cloud/

  42. "What are you doing?" Charisma asked.

    "Isolating," Hilda explained. "School's sixth year, fourth month, class of Hexmaster Dundree on grabbing spooks by the balls. You should remember that."

    "Uh-huh." It was clear that Charisma had forgotten various things from her school years. "I do think he called it something else."

    #WIP #Snippet #Writing #Fantasy

  43. At that moment a young man in his late twenties stopped near them. "Come on, man!" he said with a thick Irish accent, "kiss her already, or do ye want me to show ye how it's done?"

    #snippet #writing

  44. "Are you insulting me?" Ferguson sounded slightly hostile.

    Hilda looked at him sternly. "If you have to ask, I am not insulting you. My insults are not questionable."

    #writing #snippet #Hilda #humour #fantasy #Witch

  45. А, всё это время я мог в sing-box в конфиге TUN исключить отдельные интерфейсы, чтобы прокси не ломало мне роуты Wireguard и не мешало дебагу на локалхосте.

    И по непонятной причине добавление exclude_interface ещё фиксит нерабочий ICMP, даже при strict_route=true.

    "inbounds": [
      {
        "type": "tun",
        "address": "172.18.0.1/30",
    
        "auto_route": true,
        "auto_redirect": true,
        "strict_route": true,
    
        // вот эта штука
        "exclude_interface": [
          "lo",
          "wg0"
        ],
        // ^^^^
    
        "stack": "system"
      },
      // ...
    ]
    

    #singbox #snippet

  46. Oh nice, I can store my scripts in this 💯

    🌀 **dial** — A TUI for managing code snippets.

    👌 Find the code you need with syntax highlighting.
    ⚙️ Runs on Linux, macOS, and Windows.

    🦀 Written in Rust & built with @ratatui_rs

    ⭐ GitHub: github.com/mouhamadalmounayar/

    #rustlang #ratatui #tui #code #snippet #manager #development #terminal

  47. Upd: see this post for a better config. As it turns out, GNU coreutils already have a preserve-root flag (but it's the default only in rm), while busybox can be wrapped in a small bash function.

    # /etc/bash/bashrc
    
    real_rm=$(which rm)
    real_chmod=$(which chmod)
    real_chown=$(which chown)
    _confirm () {
            echo -n 'Confirm: '
            read c
            [[ "${c,,}" = y ]]
    }
    rm () {
            _confirm || return 1
            "$real_rm" "$@"
    }
    chmod () {
            _confirm || return 1
            "$real_chmod" "$@"
    }
    chown () {
            _confirm || return 1
            "$real_chown" "$@"
    }
    

    #snippet #linux #bash

  48. #javascript #WordPress #Snippet #API

    I have a "snippet" code
    javascript:(()=>{window.open('https://spinka.tepewu.pl/wp-admin/post-new.php?in_reply_to='+encodeURIComponent(window.location.href));})();

    which produces a specific type of post "in reply to" with just an URL embedded.

    I assume that the code calls some API function and can pass some parameters to it.
    Please somebody point me to a resource where I could learn how to create a post with a format of my choice, automatically embedding, say, an original title, header picture, and lead/abstract.

    The use case is to aggregate singular posts into our climate infokiosk at #SPINKa