Here are some commands/snippets I’ve found useful.
IP/Connection/TLS info
curl https://ipinfo.io/json
# Response like:
{
"ip": "34.77.243.238",
"hostname": "238.243.77.34.bc.googleusercontent.com",
"city": "Brussels",
"region": "Brussels Capital",
"country": "BE",
"loc": "50.8505,4.3488",
"org": "AS396982 Google LLC",
"postal": "1000",
"timezone": "Europe/Brussels",
"readme": "https://ipinfo.io/missingauth"
}
curl https://tls.peet.ws/api/all
# For TLS fingerprint data
1-line installs for Linux/Mac
- Brew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Micromamba:
curl micro.mamba.pm/install.sh | bash
- Pixi:
curl -fsSL https://pixi.sh/install.sh | bash
- Tailscale:
curl -fsSL https://tailscale.com/install.sh | sh
- Bun:
curl -fsSL https://bun.sh/install | bash; source ~/.bashrc
- DuckDB:
wget -qO- https://github.com/duckdb/duckdb/releases/latest/download/duckdb_cli-linux-amd64.zip | funzip | sudo tee /usr/local/bin/duckdb > /dev/null && sudo chmod +x /usr/local/bin/duckdb
- Fish:
brew install fish
Add Apache-2.0 license to project
curl -O https://www.apache.org/licenses/LICENSE-2.0.txt
(Remember to update the license field in your package manifest file like package.json
or Cargo.toml
)
Create an SOCKS proxy over SSH
ssh -NCD8080
# -N just forwards the ports, doesn't run a command
# -C compresses data
# -D creates "dynamic" port forwarding by running a SOCKS proxy on your machine tunelling to the remote machine.
Then use HTTP_PROXY
, HTTPS_PROXY
, or ALL_PROXY=localhost:8080
to use your proxy.
Detect/convert character encodings
Chardet is a Python CLI tool great at detecting encodings, and iconv is a standard GNU Linux tool that converts between encodings.
chardet myfile.txt
iconv -f <detected encoding> -t UTF8 myfile.txt > myfile-utf8.txt
Firefox browser history with specific visit datetimes
Run this in DuckDB on a copy of places.sqlite
from your Firefox Profile directory (a randomly-named subdirectory of ~/Library/Mozilla/Firefox/Profiles/
on Mac or %APPDATA%\Mozilla\Firefox\Profiles\
on Windows)
CREATE OR REPLACE VIEW history AS
SELECT
title AS page_title,
make_timestamp(visit_date) AS visit_time,
url AS webpage_url,
(CASE visit_type
WHEN 1 THEN 'Link'
WHEN 2 THEN 'Typed URL'
WHEN 3 THEN 'Bookmark'
WHEN 4 THEN 'Embedded'
WHEN 5 THEN 'Permanent Redirect'
WHEN 6 THEN 'Temporary Redirect'
WHEN 7 THEN 'Download'
WHEN 8 THEN 'Iframe'
WHEN 9 THEN 'Reload'
ELSE 'Other'
END) AS visit_type,
visit_count AS visit_count,
make_timestamp(last_visit_date) AS last_visit_time,
from_visit AS visit_source
FROM
moz_historyvisits,
moz_places
WHERE
moz_historyvisits.place_id = moz_places.id
ORDER BY
moz_historyvisits.visit_date DESC;