Skip to content

Instantly share code, notes, and snippets.

View pepoluan's full-sized avatar
🏡

Pandu E POLUAN pepoluan

🏡
View GitHub Profile
@pepoluan
pepoluan / ShowListeners.sh
Created January 19, 2026 03:26
Show Listener Processes with Detailed Arguments, using `ss` instead of `netstat`
#!/bin/bash
# © 2026, Pandu POLUAN
# SPDX-License-Identifier: MPL-2.0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
function show_listeners() {
@pepoluan
pepoluan / ShowListeners.sh
Created January 15, 2026 12:32
Show Listener Processes with Detailed Arguments
#!/usr/bin/env bash
# © 2026, Pandu POLUAN
# SPDX-License-Identifier: MPL-2.0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
function show_listeners() {
@pepoluan
pepoluan / elapsed_ms.zsh
Created December 6, 2025 06:26
Track elapsed time in milliseconds on ZSH
# This code snippet is dedicated to the Public Domain, or licensed under CC0 if you prefer.
printf -v _start '%.0f' $(( EPOCHREALTIME * 1000 ))
::
::: COMMANDS TO MEASURE HERE :::
::
printf -v _end '%.0f' $(( EPOCHREALTIME * 1000 ))
_elapsed=$(( _end - _start ))
@pepoluan
pepoluan / backup-daily-windows-lockscreen-wallpaper.sh
Created September 2, 2025 13:06
Backup Daily Windows Lockscreen Wallpaper (for Cygwin)
#!/usr/bin/env bash
# Requires: Cygwin
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
# (C) 2025, Pandu POLUAN
@pepoluan
pepoluan / dump_mods_md.py
Last active September 1, 2025 16:15
Dump a list of Factorio mods in Markdown format
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.12"
# ///
# SPDX-License-Identifier: MPL-2.0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
@pepoluan
pepoluan / fp_not_exist.py
Created March 24, 2025 05:15
Create a filename that does not exist
import random
import string
fromt pathlib import Path
def file_that_does_not_exist() -> Path:
def _randname() -> str:
return "".join(
@pepoluan
pepoluan / colored_bash_prompt_one_liners.sh
Last active March 5, 2025 04:05
Simple Colorized Bash Prompt One-Liners
# NO NEED to make a script
# Just choose any one variant, and copy that one line
# Then paste in a new session
#1 Green hostname, bold white command
export PS1="\n"'\[\033[0m\][\u@\[\033[1;32m\]\h\[\033[0m\] \W]\$ \[\033[1m\]'; export PS0='\[\033[0m\]'
#2 Green hostname, bold cyan command
export PS1="\n"'\[\033[0m\][\u@\[\033[1;32m\]\h\[\033[0m\] \W]\$ \[\033[1;96m\]'; export PS0='\[\033[0m\]'
@pepoluan
pepoluan / RegexLookup.vb
Last active September 13, 2024 08:11
RegexLookup function for Excel
' This is supposed to be a VBA (VB for applications) module, but GitHub does not have a syntax-highlighter for .vba files
'
' SPDX-License-Identifier: MPL-2.0
'
' This Source Code Form is subject to the terms of the Mozilla Public
' License, v. 2.0. If a copy of the MPL was not distributed with this
' file, You can obtain one at https://mozilla.org/MPL/2.0/.
' REQUIREMENTS:
' - You MUST add a reference to "Microsoft VBScript Regular Expressions 5.5" (or any compatible versions)
@pepoluan
pepoluan / pwgen.py
Last active October 9, 2024 10:35
pwgen utility -- in Python
#!/usr/bin/env python3
# SPDX-License-Identifier: MPL-2.0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
from __future__ import annotations
import argparse
import random
import secrets
@pepoluan
pepoluan / sponge.py
Last active October 9, 2024 10:35
sponge utility -- in Python
#!/usr/bin/env python3
# SPDX-License-Identifier: MPL-2.0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
from __future__ import annotations
import argparse
import sys
import tempfile