Skip to content

Instantly share code, notes, and snippets.


Summary of One-Liner Web Servers

Here's a quick reference for spinning up a simple HTTP server using a single command in various programming languages. These are incredibly handy for quickly serving static files, testing local web pages, or sharing content within a local network.

Language Command Default Port Notes
Python 3 python3 -m http.server 8000 The most popular and recommended option for its simplicity and ubiquity. Serves files from the current directory. You can specify a port like python3 -m http.server 8080.
Python 2 python -m SimpleHTTPServer 8000 Legacy. Only use if you
@21e06
21e06 / sort-access-log.sh
Created August 2, 2024 09:07
sort access.log unique ip per windows users
for i in $(grep -oP '(\d+\.\d+\.\d+\.\d+)(?=.+Windows)' /var/log/nginx/access.log|sort -u); do curl -s ipinfo.io/$i/org | jq; sleep 1; done
@21e06
21e06 / failed-auth.log
Created July 28, 2024 02:43
get asn from failed ssh login
while read x; do curl -s ipinfo.io/$x/org | echo "$x - $(cat)" | tee -a failed-auth.log; sleep 10; done <<< $(grep -i failed /var/log/auth.log | grep -oP '\d+\.\d+\.\d+\.\d+' | sort -u)
@21e06
21e06 / nostr.sh
Last active July 10, 2024 08:57
track nostr visitors
#!/bin/bash
logfile=$HOME/nostr.log
logs() {
for log in $(ls /var/log/nginx/nostr.log* -1t); do
if [[ $log == *".gz" ]]; then
zcat $log | cut -d' ' -f1 | uniq
continue
fi
localhost.run
serveo.net
- add more
netsh int ip reset
netsh winsock reset
netsh winhttp reset proxy
ipconfig /release
ipconfig /renew
ipconfig /flushdns
#!/bin/bash
minFee=$(curl -sSL "https://mempool.space/api/v1/fees/recommended" | jq -r .minimumFee)
# e.g. mempool.wait
waitFile=$BASH_SOURCE.wait
if [ ! -f $waitFile ]; then
exit 0
fi

[...new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode('my nostr key')))].map((b) =&gt; b.toString(16).padStart(2, '0')).join('')

@21e06
21e06 / btcphp
Last active November 16, 2023 04:20
#!/bin/bash
STITLE="BITCOIN PRICE"
printf "\n\t $STITLE \n\n"
PDAXXX=$(curl -sL curl -sL https://services.pdax.ph/api/liquidity/otc/v1/marketprices | jq -r '.result[] | select(.currencyPair=="BTC_PHP")')
PHPASK=$(echo $PDAXXX | jq -r .bid)
PHPBID=$(echo $PDAXXX | jq -r .ask)
@21e06
21e06 / ms.md
Last active May 8, 2026 10:58

Windows Vista/7/[8/8.1]/10/11/Server [2008-2022]

  Windows 10/11:
  Home      : TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
  Home N    : 3KHY7-WNT83-DGQKR-F7HPR-844BM
  Home SL   : 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
  Pro       : W269N-WFGWX-YVC9B-4J6C9-T83GX
  Pro N     : MH37W-N47XK-V7XM9-C7227-GCQG9
  Edu Pro   : 6TP4R-GNPTD-KYYHQ-7B7DP-J447Y
  Edu Pro N : YVWGF-BXNMC-HTQYQ-CPQ99-66QFC