Skip to content

奇技淫巧

Customized SNI

  1. openssl
  2. Postman 改Host
openssl s_client -connect "diqz8h6n59coy.cloudfront.net:443" -servername "diqz8h6n59coy.cloudfront.net"

openssl s_client -connect "diqz8h6n59coy.cloudfront.net:443" -servername "github.com"

openssl s_client -connect "diqz8h6n59coy.cloudfront.net:443" -servername "tw.yahoo.com"

openssl s_client -connect "diqz8h6n59coy.cloudfront.net:443" -servername "stackoverflow.com"

取代上下文

https://stackoverflow.com/questions/11500695/notepad-regulare-expression-to-replace search with regular expression request.getParameter\("(.*?)"\) replace with StringEscapeUtils.escapeHtml\(request.getParameter\("\1"\)\)

Twitter mute words

https://twitter.com/oobe/status/1476426833721962499?s=12

HackMD Expoert all

curl  --cookie "userid=<from cookie> ; connect.sid=<from cookie>" -o /tmp/hackmd_backup.zip 'https://hackmd.io/exportAllNotes'
#! /bin/bash
if [[ "$#" -ne 1 ]]; then
    echo "Usage: $0 HACKMD_API_TOKEN" >&2
  exit 1
fi
HACKMD_API_TOKEN=$1
userid=$(curl "https://api.hackmd.io/v1/me" -H "Authorization: Bearer ${HACKMD_API_TOKEN}" | jq -r '.id')
curl --cookie-jar "cookies.txt" 'https://hackmd.io/'
session_id=$(cat cookies.txt | grep connect.sid | awk '{print $7}')
echo "user_id: ${userid}"
echo "session_id: ${session_id}"
curl  --cookie "userid=${userid} ; connect.sid=${session_id}" -o /tmp/hackmd_backup.zip 'https://hackmd.io/exportAllNotes'

wsl can not access remote linux and use rsync

mobaxterm

cd \\\\wsl$\\Ubuntu\\home\\foo\\
rsync -avzh --dry-run ./bar smci@172.17.43.113:/home/foo/bar/

nextcloud box

Download a file from a Nextcloud public link (pointing to a folder!) via command-line - Stack Overflow