# programmes.net > Free, privacy-first developer tools that run entirely in your browser, plus a free CORS-enabled JSON API so scripts and AI agents can call the same tools programmatically. No signup, no API key, and nothing you type into a tool is ever collected (analytics are cookieless unless you opt in); everything also works offline. programmes.net provides 96 developer tools (formatters, encoders, hashing, converters, and text & web utilities), reference content, and a JSON API. All tool logic is shared between the website and the API, so results are identical. ## Tools Start with: [JSON Formatter & Validator](https://programmes.net/tools/json), [Base64 Encoder & Decoder](https://programmes.net/tools/base64), [JWT Decoder](https://programmes.net/tools/jwt), [Hash Generator](https://programmes.net/tools/hash), [UUID Generator](https://programmes.net/tools/uuid), [Unix Timestamp Converter](https://programmes.net/tools/timestamp), [Regex Tester](https://programmes.net/tools/regex), [YAML / JSON Converter](https://programmes.net/tools/yaml-json), [JSON to TypeScript](https://programmes.net/tools/json-ts). Every tool page has a Markdown twin (append `.md`) describing what it does and, where it has one, its API with REST, MCP and curl examples. ### Formatters & Validators - [JSON Formatter & Validator](https://programmes.net/tools/json) ([Markdown](https://programmes.net/tools/json.md)): Format, validate, and minify JSON data - [XML Formatter & Validator](https://programmes.net/tools/xml) ([Markdown](https://programmes.net/tools/xml.md)): Format and validate XML documents - [SQL Formatter](https://programmes.net/tools/sql) ([Markdown](https://programmes.net/tools/sql.md)): Format and beautify SQL queries - [HTML Formatter](https://programmes.net/tools/html) ([Markdown](https://programmes.net/tools/html.md)): Format and beautify HTML code - [CSS Minifier & Beautifier](https://programmes.net/tools/css-minify) ([Markdown](https://programmes.net/tools/css-minify.md)): Minify or beautify CSS, strip comments, shrink size - [SemVer Calculator](https://programmes.net/tools/semver) ([Markdown](https://programmes.net/tools/semver.md)): Compare, sort, bump versions and test npm ranges - [Luhn, IBAN & ISBN Validator](https://programmes.net/tools/luhn) ([Markdown](https://programmes.net/tools/luhn.md)): Check digits for cards, IBANs, ISBNs and EAN barcodes - [JSON Schema Validator](https://programmes.net/tools/json-schema-validator) ([Markdown](https://programmes.net/tools/json-schema-validator.md)): Validate JSON against a JSON Schema (2020-12, 2019-09, 7, 4) ### Encoders & Decoders - [Base64 Encoder & Decoder](https://programmes.net/tools/base64) ([Markdown](https://programmes.net/tools/base64.md)): Encode and decode Base64 strings - [URL Encoder & Decoder](https://programmes.net/tools/url) ([Markdown](https://programmes.net/tools/url.md)): URL encode and decode strings - [JWT Decoder](https://programmes.net/tools/jwt) ([Markdown](https://programmes.net/tools/jwt.md)): Decode a JWT header and payload and check its expiry - [HTML Entity Encoder & Decoder](https://programmes.net/tools/html-entity) ([Markdown](https://programmes.net/tools/html-entity.md)): Encode and decode HTML entities - [Batch URL Encoder & Parser](https://programmes.net/tools/url-encode) ([Markdown](https://programmes.net/tools/url-encode.md)): Advanced URL encoding with batch mode and URL parser - [Image to Base64](https://programmes.net/tools/image-base64) ([Markdown](https://programmes.net/tools/image-base64.md)): Convert images to Base64 data URIs - [JWT Encoder & Signer](https://programmes.net/tools/jwt-encode) ([Markdown](https://programmes.net/tools/jwt-encode.md)): Build and HMAC-sign JWTs in your browser - [Base32, Base58 & Base85 Encoder](https://programmes.net/tools/base-n) ([Markdown](https://programmes.net/tools/base-n.md)): Encode and decode Base32, Crockford, Base58, Ascii85, Z85 - [SVG to Data URI](https://programmes.net/tools/svg-data-uri) ([Markdown](https://programmes.net/tools/svg-data-uri.md)): Minify SVG into a CSS data URI for background or mask images - [ID Decoder](https://programmes.net/tools/id-decoder) ([Markdown](https://programmes.net/tools/id-decoder.md)): Decode Snowflake, ObjectId, KSUID, TypeID, ULID and UUID: time and fields - [Punycode & IDN Converter](https://programmes.net/tools/punycode) ([Markdown](https://programmes.net/tools/punycode.md)): Convert international domain names to and from xn-- Punycode - [Gzip & Deflate Compressor](https://programmes.net/tools/compress) ([Markdown](https://programmes.net/tools/compress.md)): Gzip, deflate or raw-deflate text to Base64 or hex, and back, with sizes - [SAML Decoder](https://programmes.net/tools/saml-decoder) ([Markdown](https://programmes.net/tools/saml-decoder.md)): Decode SAMLRequest and SAMLResponse: issuer, NameID, audience, validity ### Cryptography & Hashing - [Hash Generator](https://programmes.net/tools/hash) ([Markdown](https://programmes.net/tools/hash.md)): Generate MD5, SHA-1, SHA-256 hashes - [UUID Generator](https://programmes.net/tools/uuid) ([Markdown](https://programmes.net/tools/uuid.md)): Generate unique identifiers - [Password Generator](https://programmes.net/tools/password) ([Markdown](https://programmes.net/tools/password.md)): Generate secure passwords - [Bcrypt Generator & Verifier](https://programmes.net/tools/bcrypt) ([Markdown](https://programmes.net/tools/bcrypt.md)): Generate and verify bcrypt hashes - [Random String Generator](https://programmes.net/tools/random) ([Markdown](https://programmes.net/tools/random.md)): Generate random strings with custom patterns and charsets - [Password Strength Checker](https://programmes.net/tools/password-strength) ([Markdown](https://programmes.net/tools/password-strength.md)): Test password strength, entropy & crack time - [TOTP / 2FA Code Generator](https://programmes.net/tools/totp) ([Markdown](https://programmes.net/tools/totp.md)): Generate RFC 6238 TOTP two-factor authentication codes - [ULID Generator](https://programmes.net/tools/ulid) ([Markdown](https://programmes.net/tools/ulid.md)): Generate sortable timestamp-based ULIDs - [AES Text Encryption](https://programmes.net/tools/aes-encrypt) ([Markdown](https://programmes.net/tools/aes-encrypt.md)): Encrypt and decrypt text with a password using AES-256-GCM - [HMAC Generator](https://programmes.net/tools/hmac) ([Markdown](https://programmes.net/tools/hmac.md)): Generate HMAC SHA-256/384/512 signatures in-browser - [NanoID Generator](https://programmes.net/tools/nanoid) ([Markdown](https://programmes.net/tools/nanoid.md)): Random IDs with custom alphabets and collision odds - [X.509 Certificate Decoder](https://programmes.net/tools/x509) ([Markdown](https://programmes.net/tools/x509.md)): Decode PEM certificates: SANs, validity, key, fingerprint - [SSH & Key Pair Generator](https://programmes.net/tools/keygen) ([Markdown](https://programmes.net/tools/keygen.md)): Generate Ed25519, ECDSA, RSA, X25519 and WireGuard key pairs - [CSR, SSH Key & JWK Inspector](https://programmes.net/tools/key-inspector) ([Markdown](https://programmes.net/tools/key-inspector.md)): Decode CSRs, SSH public keys and JWKs: SANs, fingerprints, thumbprints ### Converters - [Unix Timestamp Converter](https://programmes.net/tools/timestamp) ([Markdown](https://programmes.net/tools/timestamp.md)): Convert Unix timestamps - [Color Converter](https://programmes.net/tools/color) ([Markdown](https://programmes.net/tools/color.md)): Convert between color formats - [Number Base Converter](https://programmes.net/tools/number-base) ([Markdown](https://programmes.net/tools/number-base.md)): Convert between number bases - [Case Converter](https://programmes.net/tools/case) ([Markdown](https://programmes.net/tools/case.md)): Convert text case formats - [JSON / CSV Converter](https://programmes.net/tools/json-csv) ([Markdown](https://programmes.net/tools/json-csv.md)): Convert between JSON and CSV formats with nested object support - [YAML / JSON Converter](https://programmes.net/tools/yaml-json) ([Markdown](https://programmes.net/tools/yaml-json.md)): Convert between YAML and JSON in either direction - [JSON to TypeScript](https://programmes.net/tools/json-ts) ([Markdown](https://programmes.net/tools/json-ts.md)): Generate TypeScript interfaces and types from JSON - [Color Contrast Checker](https://programmes.net/tools/contrast) ([Markdown](https://programmes.net/tools/contrast.md)): Check WCAG color contrast for accessibility - [chmod Calculator](https://programmes.net/tools/chmod) ([Markdown](https://programmes.net/tools/chmod.md)): Calculate Unix file permissions in octal & symbolic - [cURL Converter](https://programmes.net/tools/curl-converter) ([Markdown](https://programmes.net/tools/curl-converter.md)): Convert curl commands to fetch, Python & Node code - [JSON Schema Generator](https://programmes.net/tools/json-schema) ([Markdown](https://programmes.net/tools/json-schema.md)): Generate draft-07 JSON Schema from sample JSON - [IP Subnet Calculator](https://programmes.net/tools/cidr) ([Markdown](https://programmes.net/tools/cidr.md)): Calculate IPv4 subnets, netmask & host range from CIDR - [Color Palette Generator](https://programmes.net/tools/color-palette) ([Markdown](https://programmes.net/tools/color-palette.md)): Generate color harmonies, shades and tints from a base color - [JSONPath Evaluator](https://programmes.net/tools/jsonpath) ([Markdown](https://programmes.net/tools/jsonpath.md)): Query JSON with JSONPath expressions in your browser - [Data Size Converter](https://programmes.net/tools/data-size) ([Markdown](https://programmes.net/tools/data-size.md)): Convert between bytes, KB, MB, GB, KiB, MiB and bits - [ASCII Converter](https://programmes.net/tools/ascii) ([Markdown](https://programmes.net/tools/ascii.md)): Convert text to ASCII codes in dec, hex, binary, octal - [Roman Numeral Converter](https://programmes.net/tools/roman-numeral) ([Markdown](https://programmes.net/tools/roman-numeral.md)): Convert numbers to Roman numerals and back - [JSON Diff](https://programmes.net/tools/json-diff) ([Markdown](https://programmes.net/tools/json-diff.md)): Compare two JSON documents and see added, removed, changed keys - [JSON to XML Converter](https://programmes.net/tools/json-xml) ([Markdown](https://programmes.net/tools/json-xml.md)): Convert JSON to XML and XML back to JSON - [Duration Converter](https://programmes.net/tools/duration) ([Markdown](https://programmes.net/tools/duration.md)): Convert between ISO 8601 durations, seconds and "1h30m" human text - [.env to JSON Converter](https://programmes.net/tools/env-json) ([Markdown](https://programmes.net/tools/env-json.md)): Convert dotenv files to JSON and back, with lint warnings - [TOML to JSON Converter](https://programmes.net/tools/toml-json) ([Markdown](https://programmes.net/tools/toml-json.md)): Convert TOML to JSON and JSON to TOML - [IPv6 Address Tool](https://programmes.net/tools/ipv6) ([Markdown](https://programmes.net/tools/ipv6.md)): Expand, compress (RFC 5952), classify and subnet IPv6 - [HTML to JSX Converter](https://programmes.net/tools/html-jsx) ([Markdown](https://programmes.net/tools/html-jsx.md)): Convert HTML and SVG markup to React JSX - [JSON5 / JSONC to JSON](https://programmes.net/tools/jsonc) ([Markdown](https://programmes.net/tools/jsonc.md)): Strip comments and trailing commas: JSON5 and JSONC to JSON - [Date Calculator](https://programmes.net/tools/date-calc) ([Markdown](https://programmes.net/tools/date-calc.md)): Days between dates, add durations, business days, ISO week - [docker run to Compose Converter](https://programmes.net/tools/docker-compose) ([Markdown](https://programmes.net/tools/docker-compose.md)): Convert docker run commands to Docker Compose services and back - [IEEE 754 Float Inspector](https://programmes.net/tools/ieee754) ([Markdown](https://programmes.net/tools/ieee754.md)): See a number as float32/float64 bits, the exact stored value and the error - [HTML to Markdown](https://programmes.net/tools/html-markdown) ([Markdown](https://programmes.net/tools/html-markdown.md)): Turn an HTML page into clean Markdown for docs, notes and LLM prompts ### Text Tools - [Regex Tester](https://programmes.net/tools/regex) ([Markdown](https://programmes.net/tools/regex.md)): Test regular expressions - [Diff Checker](https://programmes.net/tools/diff) ([Markdown](https://programmes.net/tools/diff.md)): Compare text differences - [Lorem Ipsum Generator](https://programmes.net/tools/lorem) ([Markdown](https://programmes.net/tools/lorem.md)): Generate placeholder text - [Word Counter](https://programmes.net/tools/word-count) ([Markdown](https://programmes.net/tools/word-count.md)): Count words and characters - [Slugify](https://programmes.net/tools/slugify) ([Markdown](https://programmes.net/tools/slugify.md)): Convert text to clean, URL-safe slugs instantly - [Sort & Dedupe Lines](https://programmes.net/tools/sort-lines) ([Markdown](https://programmes.net/tools/sort-lines.md)): Sort, dedupe and clean up lists of text lines - [String Escape & Unescape](https://programmes.net/tools/string-escape) ([Markdown](https://programmes.net/tools/string-escape.md)): Escape & unescape JSON, JS, HTML, URL, regex strings - [Morse Code Translator](https://programmes.net/tools/morse-code) ([Markdown](https://programmes.net/tools/morse-code.md)): Translate text to Morse code and decode Morse to text - [Markdown Table Generator](https://programmes.net/tools/markdown-table) ([Markdown](https://programmes.net/tools/markdown-table.md)): Convert CSV or TSV data into aligned markdown tables - [Unicode Character Inspector](https://programmes.net/tools/char-inspector) ([Markdown](https://programmes.net/tools/char-inspector.md)): Inspect Unicode code points, UTF-8, and escapes - [Text Cleanup & Invisible Characters](https://programmes.net/tools/text-cleanup) ([Markdown](https://programmes.net/tools/text-cleanup.md)): Find and remove zero-width, bidi and hidden Unicode; fix line endings ### Web Tools - [QR Code Generator](https://programmes.net/tools/qr) ([Markdown](https://programmes.net/tools/qr.md)): Generate QR codes - [Cron Expression Parser](https://programmes.net/tools/cron) ([Markdown](https://programmes.net/tools/cron.md)): Build and test cron expressions - [Markdown Preview](https://programmes.net/tools/markdown) ([Markdown](https://programmes.net/tools/markdown.md)): Preview markdown content - [.gitignore Generator](https://programmes.net/tools/gitignore) ([Markdown](https://programmes.net/tools/gitignore.md)): Generate .gitignore files from curated templates - [HTTP Status Code Lookup](https://programmes.net/tools/http-status) ([Markdown](https://programmes.net/tools/http-status.md)): Search and reference all HTTP status codes - [WiFi QR Code Generator](https://programmes.net/tools/wifi-qr) ([Markdown](https://programmes.net/tools/wifi-qr.md)): Create a scannable QR code to share WiFi access - [User-Agent Parser](https://programmes.net/tools/user-agent) ([Markdown](https://programmes.net/tools/user-agent.md)): Parse User-Agent strings: browser, OS, engine, device - [CSS Gradient Generator](https://programmes.net/tools/css-gradient) ([Markdown](https://programmes.net/tools/css-gradient.md)): Build linear, radial & conic CSS gradients live - [MIME Type Lookup](https://programmes.net/tools/mime) ([Markdown](https://programmes.net/tools/mime.md)): Look up MIME types by file extension or type - [CSS Box Shadow Generator](https://programmes.net/tools/box-shadow) ([Markdown](https://programmes.net/tools/box-shadow.md)): Build layered CSS box-shadow values with live preview - [CSS Cubic Bezier Generator](https://programmes.net/tools/cubic-bezier) ([Markdown](https://programmes.net/tools/cubic-bezier.md)): Visual editor for custom CSS cubic-bezier easing curves - [Time Zone Converter](https://programmes.net/tools/timezone) ([Markdown](https://programmes.net/tools/timezone.md)): Convert times between time zones with DST support - [CSS Unit Converter](https://programmes.net/tools/css-units) ([Markdown](https://programmes.net/tools/css-units.md)): Convert px, rem, em, pt, pc, and percent CSS units - [HTML Meta Tags Generator](https://programmes.net/tools/meta-tags) ([Markdown](https://programmes.net/tools/meta-tags.md)): Generate SEO, Open Graph & Twitter Card meta tags - [CSP Evaluator](https://programmes.net/tools/csp) ([Markdown](https://programmes.net/tools/csp.md)): Parse and audit Content-Security-Policy headers - [Security Headers Checker](https://programmes.net/tools/security-headers) ([Markdown](https://programmes.net/tools/security-headers.md)): Grade pasted HTTP response headers A+ to F - [UTM Link Builder](https://programmes.net/tools/utm) ([Markdown](https://programmes.net/tools/utm.md)): Build, parse and clean campaign URLs with UTM tags - [Aspect Ratio Calculator](https://programmes.net/tools/aspect-ratio) ([Markdown](https://programmes.net/tools/aspect-ratio.md)): Reduce ratios, solve width × height, get CSS aspect-ratio - [Glob & .gitignore Tester](https://programmes.net/tools/glob-tester) ([Markdown](https://programmes.net/tools/glob-tester.md)): Test .gitignore and glob patterns against paths and see which rule matched - [EXIF Viewer & Remover](https://programmes.net/tools/exif) ([Markdown](https://programmes.net/tools/exif.md)): Read photo metadata (camera, GPS, dates) and save a copy without it - [robots.txt Builder & llms.txt Validator](https://programmes.net/tools/robots-txt) ([Markdown](https://programmes.net/tools/robots-txt.md)): Build robots.txt that treats search, AI answer and AI training bots apart ## Reference Answer-first reference pages. Every entry's first sentence is the direct answer. Append `.md` to any entry URL for clean Markdown; the full corpus is at https://programmes.net/llms-full.txt. ### [HTTP Status Codes](https://programmes.net/http) Every HTTP status code from 100 to 511, plus common unofficial codes from nginx, Cloudflare and AWS load balancers — what each means, why it happens and how to fix it. (86 pages; pattern: https://programmes.net/http/{slug}, Markdown: https://programmes.net/http/{slug}.md) - [200 OK](https://programmes.net/http/200): HTTP 200 OK means the request succeeded and the response body contains the result — the resource for a GET, or the outcome of the action for a POST. - [201 Created](https://programmes.net/http/201): HTTP 201 Created means the request succeeded and a new resource was created, usually identified by the Location header in the response. - [204 No Content](https://programmes.net/http/204): HTTP 204 No Content means the request succeeded and there is intentionally no response body to send back. - [301 Moved Permanently](https://programmes.net/http/301): HTTP 301 Moved Permanently means the resource has permanently moved to the URL in the Location header and future requests should use that new URL. - [302 Found](https://programmes.net/http/302): HTTP 302 Found means the resource is temporarily at the URL in the Location header, and the client should keep using the original URL for future requests. - [304 Not Modified](https://programmes.net/http/304): HTTP 304 Not Modified means the cached copy the client already has is still valid, so the server sends no body and the client should use its cache. - [307 Temporary Redirect](https://programmes.net/http/307): HTTP 307 Temporary Redirect means the resource is temporarily at the Location URL and the client must repeat the request there with the same method and body. - [308 Permanent Redirect](https://programmes.net/http/308): HTTP 308 Permanent Redirect means the resource has permanently moved to the Location URL and the client must repeat the request there with the same method and body. - [400 Bad Request](https://programmes.net/http/400): HTTP 400 Bad Request means the server cannot or will not process the request because of something it sees as a client error, such as malformed syntax or an invalid body. - [401 Unauthorized](https://programmes.net/http/401): HTTP 401 Unauthorized means the request lacks valid authentication credentials for the resource — the client is not logged in, or its token is missing, expired or invalid. - [403 Forbidden](https://programmes.net/http/403): HTTP 403 Forbidden means the server understood the request but refuses to authorize it — the client is not allowed to access the resource, and re-authenticating will not help. - [404 Not Found](https://programmes.net/http/404): HTTP 404 Not Found means the server cannot find anything at the requested URL — the page or resource does not exist, or the server is choosing not to reveal it. - [405 Method Not Allowed](https://programmes.net/http/405): HTTP 405 Method Not Allowed means the URL exists but does not support the HTTP method used, such as a POST to an endpoint that only accepts GET. - [408 Request Timeout](https://programmes.net/http/408): HTTP 408 Request Timeout means the server gave up waiting for the client to finish sending the request and closed the connection. - [409 Conflict](https://programmes.net/http/409): HTTP 409 Conflict means the request conflicts with the current state of the resource, such as a duplicate record or an edit based on an outdated version. - [413 Content Too Large](https://programmes.net/http/413): HTTP 413 Content Too Large means the request body is larger than the server is willing or able to process — formerly called "Payload Too Large" and "Request Entity Too Large". - [418 I'm a teapot](https://programmes.net/http/418): HTTP 418 I'm a teapot is a joke status code from the 1998 April Fools’ RFC 2324 ("Hyper Text Coffee Pot Control Protocol"), meaning the server refuses to brew coffee because it is a teapot. - [422 Unprocessable Content](https://programmes.net/http/422): HTTP 422 Unprocessable Content means the server understands the content type and the syntax is correct, but the content itself failed validation — formerly called "Unprocessable Entity". - [429 Too Many Requests](https://programmes.net/http/429): HTTP 429 Too Many Requests means the client has sent too many requests in a given amount of time and is being rate limited. - [499 Client Closed Request](https://programmes.net/http/499): HTTP 499 Client Closed Request is a non-standard nginx code logged when the client closed the connection before nginx could send the response. - [500 Internal Server Error](https://programmes.net/http/500): HTTP 500 Internal Server Error means the server hit an unexpected condition — usually an unhandled exception or misconfiguration — that prevented it from fulfilling the request. - [502 Bad Gateway](https://programmes.net/http/502): HTTP 502 Bad Gateway means a server acting as a gateway or proxy received an invalid response — or no response — from the upstream server it forwarded the request to. - [503 Service Unavailable](https://programmes.net/http/503): HTTP 503 Service Unavailable means the server is temporarily unable to handle the request, usually because it is overloaded or down for maintenance. - [504 Gateway Timeout](https://programmes.net/http/504): HTTP 504 Gateway Timeout means a gateway or proxy did not receive a response from the upstream server in time. ### [HTTP Headers](https://programmes.net/header) What HTTP request and response headers do — Content-Type, Cache-Control, Authorization, CORS, CSP, HSTS, cookies, client hints, X-Forwarded-For and more — with syntax, examples, spec, security notes and curl/nginx snippets. (148 pages; pattern: https://programmes.net/header/{slug}, Markdown: https://programmes.net/header/{slug}.md) - [Content-Type header](https://programmes.net/header/content-type): The Content-Type header states the media type (MIME type) of the message body, plus parameters such as charset. - [Content-Length header](https://programmes.net/header/content-length): The Content-Length header gives the size of the message body in bytes. - [Content-Encoding header](https://programmes.net/header/content-encoding): The Content-Encoding header lists the compression applied to the body, such as gzip, br (Brotli) or zstd. - [Content-Disposition header](https://programmes.net/header/content-disposition): The Content-Disposition header tells the browser whether to show a response inline or download it as an attachment, and suggests a file name. - [Accept header](https://programmes.net/header/accept): The Accept header lists the media types the client can handle, with optional q-value preferences. - [Accept-Encoding header](https://programmes.net/header/accept-encoding): The Accept-Encoding header lists the compression algorithms the client understands, such as gzip, br and zstd. - [Vary header](https://programmes.net/header/vary): The Vary header lists the request headers that influenced the response, so caches store a separate copy per combination. - [User-Agent header](https://programmes.net/header/user-agent): The User-Agent header identifies the client software — browser, library or bot — making the request. - [Cache-Control header](https://programmes.net/header/cache-control): The Cache-Control header carries caching directives — how long a response may be reused, by whom, and whether it must be revalidated. - [ETag header](https://programmes.net/header/etag): The ETag header is an opaque identifier for a specific version of a resource, used for cache revalidation and optimistic concurrency. - [Authorization header](https://programmes.net/header/authorization): The Authorization header carries the client's credentials for the server, in a scheme such as Bearer or Basic. - [Set-Cookie header](https://programmes.net/header/set-cookie): The Set-Cookie header tells the browser to store a cookie, with attributes controlling its lifetime, scope and security. - [Cookie header](https://programmes.net/header/cookie): The Cookie header sends the cookies the browser has stored for this host and path back to the server. - [Origin header](https://programmes.net/header/origin): The Origin header tells the server the scheme, host and port of the page that initiated the request, without the path. - [Access-Control-Allow-Origin header](https://programmes.net/header/access-control-allow-origin): The Access-Control-Allow-Origin header tells the browser which origin may read the response from cross-origin JavaScript (fetch/XHR). - [Strict-Transport-Security header](https://programmes.net/header/strict-transport-security): The Strict-Transport-Security header tells browsers to use only HTTPS for this host for the given time, turning any http:// link or typed URL into https:// before a request is sent (HSTS). - [Content-Security-Policy header](https://programmes.net/header/content-security-policy): The Content-Security-Policy header restricts which sources a page may load scripts, styles, images, frames and connections from, mitigating cross-site scripting and clickjacking. - [X-Content-Type-Options header](https://programmes.net/header/x-content-type-options): The X-Content-Type-Options header stops browsers from guessing ("sniffing") a response's type instead of trusting Content-Type; its only value is nosniff. - [X-Frame-Options header](https://programmes.net/header/x-frame-options): The X-Frame-Options header controls whether the page may be shown in a frame on other sites, defending against clickjacking. - [Sec-Fetch-Site header](https://programmes.net/header/sec-fetch-site): The Sec-Fetch-Site header tells the server how the request's initiator relates to the target: same-origin, same-site, cross-site, or none (typed URL, bookmark). - [Host header](https://programmes.net/header/host): The Host header gives the host name (and port) the client wants, so one IP address can serve many sites (virtual hosting). - [X-Forwarded-For header](https://programmes.net/header/x-forwarded-for): The X-Forwarded-For header lists the client IP address and each proxy a request passed through, added by load balancers and reverse proxies. - [Location header](https://programmes.net/header/location): The Location header gives the URL to redirect to (3xx) or the URL of a newly created resource (201). - [Retry-After header](https://programmes.net/header/retry-after): The Retry-After header tells the client how long to wait before retrying, as seconds or an HTTP date. - [Referer header](https://programmes.net/header/referer): The Referer header gives the address of the page that linked to or requested the resource — spelled "Referer", a misspelling kept since 1996. ### [Git How-To](https://programmes.net/git) Task-oriented Git answers — undo a commit, rename or delete a branch, squash, interactive rebase, stash, cherry-pick, revert a merge, change the author, remove a file from history, fix common errors — each with the exact commands, minimum Git versions and danger notes. (112 pages; pattern: https://programmes.net/git/{slug}, Markdown: https://programmes.net/git/{slug}.md) - [Undo the last commit](https://programmes.net/git/undo-last-commit): Run git reset --soft HEAD~1 to undo the last commit and keep its changes staged; use git reset HEAD~1 to keep them unstaged, or git reset --hard HEAD~1 to throw them away. - [Add changes to the last commit](https://programmes.net/git/amend-last-commit): Stage the changes and run git commit --amend --no-edit to fold them into the last commit without changing its message. - [Change a commit message](https://programmes.net/git/change-commit-message): For the last commit run git commit --amend -m "New message"; for an older one run git rebase -i ~1 and change pick to reword on that line. - [Unstage a file (undo git add)](https://programmes.net/git/unstage-file): Run git restore --staged to unstage a file while keeping your edits; on Git older than 2.23 use git reset HEAD . - [Discard local changes to a file](https://programmes.net/git/discard-changes): Run git restore to throw away unstaged changes to a file, or git restore --staged --worktree to also drop staged ones and return it to the last commit. - [Revert a commit](https://programmes.net/git/revert-commit): Run git revert to create a new commit that undoes the changes of an earlier one, without rewriting history. - [Recover a lost commit with reflog](https://programmes.net/git/recover-lost-commit): Run git reflog to find the commit's hash, then git branch rescue (or git reset --hard ) to get it back after a bad reset, rebase or amend. - [Reset a branch to match the remote](https://programmes.net/git/reset-to-remote): Run git fetch origin, then git reset --hard origin/ to make your local branch identical to the remote one, discarding local commits and changes. - [Undo a commit that is already pushed](https://programmes.net/git/undo-pushed-commit): On a shared branch, run git revert and push the new commit; only on a branch nobody else uses, reset it away and push with --force-with-lease. - [Discard all local changes](https://programmes.net/git/discard-all-changes): Run git reset --hard to throw away every staged and unstaged change to tracked files, then git clean -f -d to delete untracked files; git stash push -u is the undoable alternative. - [Squash commits into one](https://programmes.net/git/squash-commits): Run git rebase -i HEAD~N and change pick to squash (or fixup) on every commit except the first; alternatively git reset --soft HEAD~N && git commit. - [Change the author of a commit](https://programmes.net/git/change-commit-author): For the last commit run git commit --amend --author="Name " --no-edit; to fix your identity on several commits, rebase with --exec "git commit --amend --no-edit --reset-author". - [Edit, reorder or drop commits (git rebase -i)](https://programmes.net/git/interactive-rebase): Run git rebase -i HEAD~N, then in the todo list change pick to reword, edit, squash, fixup or drop, or reorder the lines, and save to rewrite the last N commits. - [Create a new branch](https://programmes.net/git/create-branch): Run git switch -c to create a branch from the current commit and switch to it (git checkout -b on older Git). - [Rename a branch (locally and on the remote)](https://programmes.net/git/rename-branch): Run git branch -m , push the new name with git push -u origin , then delete the old one with git push origin --delete . - [Delete a local branch](https://programmes.net/git/delete-local-branch): Run git branch -d to delete a branch that is fully merged, or git branch -D to force-delete it. - [Delete a remote branch](https://programmes.net/git/delete-remote-branch): Run git push origin --delete to delete a branch on the remote; others then run git fetch --prune to drop their stale copy. - [Check out a remote branch](https://programmes.net/git/checkout-remote-branch): Run git fetch, then git switch : Git creates a local branch tracking origin/ automatically when exactly one remote has it. - [Set the upstream (tracking) branch](https://programmes.net/git/set-upstream): Push with git push -u origin the first time, or run git branch --set-upstream-to=origin/ for an existing branch. - [Move commits to a new branch](https://programmes.net/git/move-commits-to-new-branch): If you committed to main by mistake, run git branch , then git reset --keep HEAD~N on main, and git switch — the commits now live only on the new branch. - [Go back to an earlier commit](https://programmes.net/git/checkout-commit): Run git switch --detach (or git checkout ) to look at an old commit, git switch - to come back, or git switch -c to start a branch from it. - [Change the remote URL](https://programmes.net/git/change-remote-url): Run git remote set-url origin , for example to switch from HTTPS to SSH or after a repository moved; check it with git remote -v. - [Force-push safely](https://programmes.net/git/force-push-safely): Use git push --force-with-lease instead of --force: it refuses to overwrite the remote branch if someone else pushed to it since your last fetch. - [Fix "Updates were rejected" (non-fast-forward)](https://programmes.net/git/push-rejected): The remote has commits you don't; run git pull --rebase (or git pull) to integrate them, resolve any conflicts, then git push again. - [Rebase a branch onto main](https://programmes.net/git/rebase-onto-main): From your feature branch run git fetch origin and git rebase origin/main, resolve conflicts with git add and git rebase --continue, then push with --force-with-lease. ### [chmod Permissions](https://programmes.net/chmod) Every Unix chmod value from 000 to 777 explained: symbolic rwx form, ls -l output, who can read, write and execute, umask and security notes. (512 pages; pattern: https://programmes.net/chmod/{slug}, Markdown: https://programmes.net/chmod/{slug}.md) - [chmod 000](https://programmes.net/chmod/000): chmod 000 (---------) removes every permission: the owner, the group and others cannot read, write or execute it (only root can still access it). - [chmod 400](https://programmes.net/chmod/400): chmod 400 (r--------) lets the owner read, and gives everyone else no access. - [chmod 440](https://programmes.net/chmod/440): chmod 440 (r--r-----) lets the owner read, the group read, and gives others no access. - [chmod 444](https://programmes.net/chmod/444): chmod 444 (r--r--r--) lets everyone — the owner, the group and all other users — read. - [chmod 500](https://programmes.net/chmod/500): chmod 500 (r-x------) lets the owner read and execute, and gives everyone else no access. - [chmod 555](https://programmes.net/chmod/555): chmod 555 (r-xr-xr-x) lets everyone — the owner, the group and all other users — read and execute. - [chmod 600](https://programmes.net/chmod/600): chmod 600 (rw-------) lets the owner read and write, and gives everyone else no access. - [chmod 640](https://programmes.net/chmod/640): chmod 640 (rw-r-----) lets the owner read and write, the group read, and gives others no access. - [chmod 644](https://programmes.net/chmod/644): chmod 644 (rw-r--r--) lets the owner read and write, and everyone else read. - [chmod 660](https://programmes.net/chmod/660): chmod 660 (rw-rw----) lets the owner read and write, the group read and write, and gives others no access. - [chmod 664](https://programmes.net/chmod/664): chmod 664 (rw-rw-r--) lets the owner read and write, the group read and write, and others read. - [chmod 666](https://programmes.net/chmod/666): chmod 666 (rw-rw-rw-) lets everyone — the owner, the group and all other users — read and write. - [chmod 700](https://programmes.net/chmod/700): chmod 700 (rwx------) lets the owner read, write and execute, and gives everyone else no access. - [chmod 711](https://programmes.net/chmod/711): chmod 711 (rwx--x--x) lets the owner read, write and execute, and everyone else execute. - [chmod 744](https://programmes.net/chmod/744): chmod 744 (rwxr--r--) lets the owner read, write and execute, and everyone else read. - [chmod 750](https://programmes.net/chmod/750): chmod 750 (rwxr-x---) lets the owner read, write and execute, the group read and execute, and gives others no access. - [chmod 755](https://programmes.net/chmod/755): chmod 755 (rwxr-xr-x) lets the owner read, write and execute, and everyone else read and execute. - [chmod 770](https://programmes.net/chmod/770): chmod 770 (rwxrwx---) lets the owner read, write and execute, the group read, write and execute, and gives others no access. - [chmod 775](https://programmes.net/chmod/775): chmod 775 (rwxrwxr-x) lets the owner read, write and execute, the group read, write and execute, and others read and execute. - [chmod 777](https://programmes.net/chmod/777): chmod 777 (rwxrwxrwx) lets everyone — the owner, the group and all other users — read, write and execute. ### [Network Ports](https://programmes.net/port) What common TCP and UDP ports are used for — SSH, HTTP, databases, dev servers and more — with security notes, lsof/ss/netstat commands and firewall rules. (205 pages; pattern: https://programmes.net/port/{slug}, Markdown: https://programmes.net/port/{slug}.md) - [Port 21 (FTP)](https://programmes.net/port/21): Port 21 is the standard control port for FTP (File Transfer Protocol), used for login and commands. - [Port 22 (SSH)](https://programmes.net/port/22): Port 22 is the standard port for SSH (Secure Shell), used for encrypted remote logins, SFTP/SCP file transfer and port forwarding. - [Port 25 (SMTP)](https://programmes.net/port/25): Port 25 is the standard SMTP port that mail servers use to relay email to each other. - [Port 53 (DNS)](https://programmes.net/port/53): Port 53 is the standard port for DNS (Domain Name System), used to resolve domain names to IP addresses. - [Port 80 (HTTP)](https://programmes.net/port/80): Port 80 is the default port for HTTP, the unencrypted web protocol that http:// URLs connect to. - [Port 443 (HTTPS)](https://programmes.net/port/443): Port 443 is the default port for HTTPS — HTTP over TLS — which https:// URLs connect to. - [Port 445 (SMB)](https://programmes.net/port/445): Port 445 is the port for SMB (Server Message Block) over TCP, used for Windows file and printer sharing. - [Port 587 (SMTP Submission)](https://programmes.net/port/587): Port 587 is the standard mail submission port, used by email clients and applications to send outgoing mail through an SMTP server with STARTTLS and authentication. - [Port 993 (IMAPS)](https://programmes.net/port/993): Port 993 is the port for IMAPS — IMAP over implicit TLS — the standard secure port for reading email. - [Port 1433 (SQL Server)](https://programmes.net/port/1433): Port 1433 is the default port for Microsoft SQL Server database connections. - [Port 1883 (MQTT)](https://programmes.net/port/1883): Port 1883 is the standard port for MQTT, the lightweight publish/subscribe messaging protocol used by IoT devices. - [Port 3000 (Dev server)](https://programmes.net/port/3000): Port 3000 is the conventional default port for many web development servers, including Node.js/Express examples, Next.js, Create React App, Rails and Grafana. - [Port 3306 (MySQL)](https://programmes.net/port/3306): Port 3306 is the default port for MySQL and MariaDB database servers. - [Port 3389 (RDP)](https://programmes.net/port/3389): Port 3389 is the default port for RDP (Remote Desktop Protocol), used to control Windows machines remotely. - [Port 5000 (Flask / dev server)](https://programmes.net/port/5000): Port 5000 is the default port for the Flask development server and several other tools, and is also used by macOS AirPlay Receiver. - [Port 5173 (Vite dev server)](https://programmes.net/port/5173): Port 5173 is the default port for the Vite development server, used by Vite-based projects such as SvelteKit, Vue and React (Vite) apps. - [Port 5432 (PostgreSQL)](https://programmes.net/port/5432): Port 5432 is the default port for PostgreSQL database servers. - [Port 5672 (AMQP)](https://programmes.net/port/5672): Port 5672 is the standard port for AMQP, the messaging protocol used by RabbitMQ and other message brokers. - [Port 6379 (Redis)](https://programmes.net/port/6379): Port 6379 is the default port for Redis (and Redis-compatible servers such as Valkey), the in-memory key-value store. - [Port 6443 (Kubernetes API)](https://programmes.net/port/6443): Port 6443 is the conventional default port for the Kubernetes API server (kube-apiserver). - [Port 8000 (Dev HTTP server)](https://programmes.net/port/8000): Port 8000 is the conventional default port for many development web servers, including Django’s runserver, python -m http.server and Uvicorn/FastAPI. - [Port 8080 (HTTP alternate)](https://programmes.net/port/8080): Port 8080 is the most common alternative HTTP port, used by proxies, application servers such as Tomcat and Jenkins, and development servers. - [Port 8888 (Jupyter)](https://programmes.net/port/8888): Port 8888 is the default port for Jupyter Notebook and JupyterLab servers. - [Port 9090 (Prometheus)](https://programmes.net/port/9090): Port 9090 is the default port for the Prometheus server and its web UI. - [Port 9092 (Kafka)](https://programmes.net/port/9092): Port 9092 is the default broker port for Apache Kafka. ### [DNS Record Types](https://programmes.net/dns) Every common DNS record type — A, AAAA, CNAME, MX, TXT, NS, SOA, SRV, CAA, HTTPS, DNSSEC records — plus SPF, DKIM and DMARC: type code, RFC, value format, zone-file example and dig command. (50 pages; pattern: https://programmes.net/dns/{slug}, Markdown: https://programmes.net/dns/{slug}.md) - [DNS A record (IPv4 address)](https://programmes.net/dns/a): The DNS A record (type 1) maps a host name to an IPv4 address. - [DNS AAAA record (IPv6 address)](https://programmes.net/dns/aaaa): The DNS AAAA record (type 28) maps a host name to an IPv6 address. - [DNS PTR record (reverse DNS)](https://programmes.net/dns/ptr): The DNS PTR record (type 12) maps an IP address back to a host name (reverse DNS), using a name under in-addr.arpa or ip6.arpa. - [DNS CNAME record (canonical name / alias)](https://programmes.net/dns/cname): The DNS CNAME record (type 5) makes one name an alias of another, so resolvers restart the lookup at the target name. - [ALIAS record (CNAME flattening at the apex)](https://programmes.net/dns/alias): ALIAS is not a real DNS record type but a DNS-provider feature that lets the zone apex behave like a CNAME by resolving the target and serving its A/AAAA records. - [DNS MX record (mail exchanger)](https://programmes.net/dns/mx): The DNS MX record (type 15) names the mail servers that accept email for a domain, each with a preference number. - [SPF record (authorised mail senders)](https://programmes.net/dns/spf): SPF is a TXT record at the domain, starting "v=spf1", that lists which servers may send email using the domain in the envelope sender. - [DKIM record (email signing key)](https://programmes.net/dns/dkim): DKIM is a TXT record at ._domainkey. that publishes the public key receivers use to verify a message's DKIM-Signature header. - [DMARC record (email authentication policy)](https://programmes.net/dns/dmarc): DMARC is a TXT record at _dmarc. that tells receivers what to do with mail failing SPF and DKIM alignment, and where to send reports. - [DNS SRV record (service location)](https://programmes.net/dns/srv): The DNS SRV record (type 33) gives the host and port of a service, with priority and weight, at a name of the form _service._proto.. - [DNS HTTPS record (HTTPS service binding)](https://programmes.net/dns/https): The DNS HTTPS record (type 65) tells browsers how to connect to an HTTPS origin before the first request — supported protocols (ALPN such as h3), alternative endpoints, IP hints and ECH keys — and can alias the zone apex. - [DNS TXT record (text)](https://programmes.net/dns/txt): The DNS TXT record (type 16) stores arbitrary text strings at a name, and is how SPF, DKIM, DMARC, domain verification and ACME challenges are published. - [DNS CAA record (certificate authority authorization)](https://programmes.net/dns/caa): The DNS CAA record (type 257) lists which certificate authorities are allowed to issue TLS certificates for a domain. - [DNS DS record (delegation signer)](https://programmes.net/dns/ds): The DNS DS record (type 43) is published in the parent zone and holds a hash of the child zone's key-signing key, linking the DNSSEC chain of trust from parent to child. - [DNS NS record (name server)](https://programmes.net/dns/ns): The DNS NS record (type 2) names the authoritative name servers for a zone, and delegates a subdomain to other servers. - [DNS SOA record (start of authority)](https://programmes.net/dns/soa): The DNS SOA record (type 6) is the single record at the top of every zone holding its primary name server, admin contact, serial number and replication and negative-caching timers. ### [Cron Schedule Examples](https://programmes.net/cron) Ready-to-use cron expressions for common schedules — every 5 minutes, hourly, daily at a time, weekdays, monthly — with next run times and snippets for crontab, GitHub Actions, Kubernetes and Cloudflare. (83 pages; pattern: https://programmes.net/cron/{slug}, Markdown: https://programmes.net/cron/{slug}.md) - [Every minute (* * * * *)](https://programmes.net/cron/every-minute): The cron expression to run a job every minute is * * * * *, which runs once every minute, around the clock. - [Every 5 minutes (*/5 * * * *)](https://programmes.net/cron/every-5-minutes): The cron expression to run a job every 5 minutes is */5 * * * *, which runs at minutes 0, 5, 10 … 55 of every hour. - [Every 10 minutes (*/10 * * * *)](https://programmes.net/cron/every-10-minutes): The cron expression to run a job every 10 minutes is */10 * * * *, which runs at minutes 0, 10, 20, 30, 40 and 50 of every hour. - [Every 15 minutes (*/15 * * * *)](https://programmes.net/cron/every-15-minutes): The cron expression to run a job every 15 minutes is */15 * * * *, which runs at minutes 0, 15, 30 and 45 of every hour. - [Every 30 minutes (*/30 * * * *)](https://programmes.net/cron/every-30-minutes): The cron expression to run a job every 30 minutes is */30 * * * *, which runs at minutes 0 and 30 of every hour. - [Every hour (0 * * * *)](https://programmes.net/cron/every-hour): The cron expression to run a job every hour is 0 * * * *, which runs at minute 0 of every hour (00:00, 01:00 … 23:00). - [Every 2 hours (0 */2 * * *)](https://programmes.net/cron/every-2-hours): The cron expression to run a job every 2 hours is 0 */2 * * *, which runs at minute 0 of every even hour (00:00, 02:00 … 22:00). - [Every 6 hours (0 */6 * * *)](https://programmes.net/cron/every-6-hours): The cron expression to run a job every 6 hours is 0 */6 * * *, which runs at 00:00, 06:00, 12:00 and 18:00. - [Every 12 hours (0 */12 * * *)](https://programmes.net/cron/every-12-hours): The cron expression to run a job every 12 hours is 0 */12 * * *, which runs at 00:00 and 12:00. - [Every day at midnight (0 0 * * *)](https://programmes.net/cron/every-day-at-midnight): The cron expression to run a job every day at midnight is 0 0 * * *, which runs once a day at 00:00 (midnight). - [Every day at 2 AM (0 2 * * *)](https://programmes.net/cron/every-day-at-2am): The cron expression to run a job every day at 2 AM is 0 2 * * *, which runs once a day at 02:00 (2 AM). - [Every day at 6 AM (0 6 * * *)](https://programmes.net/cron/every-day-at-6am): The cron expression to run a job every day at 6 AM is 0 6 * * *, which runs once a day at 06:00 (6 AM). - [Every day at 8 AM (0 8 * * *)](https://programmes.net/cron/every-day-at-8am): The cron expression to run a job every day at 8 AM is 0 8 * * *, which runs once a day at 08:00 (8 AM). - [Every day at 9 AM (0 9 * * *)](https://programmes.net/cron/every-day-at-9am): The cron expression to run a job every day at 9 AM is 0 9 * * *, which runs once a day at 09:00 (9 AM). - [Every day at noon (0 12 * * *)](https://programmes.net/cron/every-day-at-noon): The cron expression to run a job every day at noon is 0 12 * * *, which runs once a day at 12:00 (noon). - [Every day at 6 PM (0 18 * * *)](https://programmes.net/cron/every-day-at-6pm): The cron expression to run a job every day at 6 PM is 0 18 * * *, which runs once a day at 18:00 (6 PM). - [Twice a day (0 0,12 * * *)](https://programmes.net/cron/twice-a-day): The cron expression to run a job twice a day is 0 0,12 * * *, which runs at 00:00 (midnight) and 12:00 (noon) every day. - [Every other day (0 0 */2 * *)](https://programmes.net/cron/every-other-day): The cron expression to run a job every other day is 0 0 */2 * *, which runs at 00:00 on every odd-numbered day of the month (1st, 3rd, 5th … 31st). - [Every Monday (0 0 * * 1)](https://programmes.net/cron/every-monday): The cron expression to run a job every Monday is 0 0 * * 1, which runs once a week at 00:00 (midnight) on Monday. - [Every Friday (0 0 * * 5)](https://programmes.net/cron/every-friday): The cron expression to run a job every Friday is 0 0 * * 5, which runs once a week at 00:00 (midnight) on Friday. - [Every Sunday (0 0 * * 0)](https://programmes.net/cron/every-sunday): The cron expression to run a job every Sunday is 0 0 * * 0, which runs once a week at 00:00 (midnight) on Sunday. - [Every week (0 0 * * 0)](https://programmes.net/cron/every-week): The cron expression to run a job every week is 0 0 * * 0, which runs once a week at 00:00 (midnight) on Sunday. - [Every Monday at 9 AM (0 9 * * 1)](https://programmes.net/cron/every-monday-at-9am): The cron expression to run a job every Monday at 9 AM is 0 9 * * 1, which runs once a week at 09:00 on Monday. - [Every weekday (0 0 * * 1-5)](https://programmes.net/cron/every-weekday): The cron expression to run a job every weekday is 0 0 * * 1-5, which runs at 00:00 (midnight) Monday through Friday. - [Every weekday at 9 AM (0 9 * * 1-5)](https://programmes.net/cron/every-weekday-at-9am): The cron expression to run a job every weekday at 9 AM is 0 9 * * 1-5, which runs at 09:00 Monday through Friday. ### [Regex Patterns](https://programmes.net/regex) Tested regular expressions for emails, URLs, IPs, UUIDs, dates, passwords and more — each explained token by token with JavaScript, Python and Go code. (53 pages; pattern: https://programmes.net/regex/{slug}, Markdown: https://programmes.net/regex/{slug}.md) - [Email address regex](https://programmes.net/regex/email): The regex for an email address is /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/, which accepts a local part, one @, a domain and a top-level domain of two or more letters. - [URL (http/https) regex](https://programmes.net/regex/url): The regex for an http or https URL is /^https?:\/\/(?:[A-Za-z0-9-]+\.)+[A-Za-z]{2,}(?::\d{1,5})?(?:[\/?#]\S*)?$/, which requires an http(s) scheme, a dotted hostname with a TLD, an optional port and an optional path, query or fragment. - [HTML tag regex](https://programmes.net/regex/html-tag): The regex for an HTML tag is /<\/?([a-zA-Z][a-zA-Z0-9-]*)\b[^>]*>/g, which finds opening, closing and self-closing tags and captures the tag name. - [Hex color regex](https://programmes.net/regex/hex-color): The regex for a CSS hex color is /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i, which accepts # followed by 3, 4, 6 or 8 hex digits (the 4- and 8-digit forms carry alpha). - [IPv4 address regex](https://programmes.net/regex/ipv4): The regex for an IPv4 address is /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/, which accepts four dot-separated octets from 0 to 255 without leading zeros. - [UUID regex](https://programmes.net/regex/uuid): The regex for a UUID (versions 1–8) is /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, which checks the 8-4-4-4-12 hex layout, a version digit of 1–8 and the RFC 9562 variant bits. - [JWT (JSON Web Token) regex](https://programmes.net/regex/jwt): The regex for a JSON Web Token is /^eyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*$/, which checks for three base64url segments separated by dots, with a header that begins "eyJ" (base64 for '{"'). - [Base64 string regex](https://programmes.net/regex/base64): The regex for a padded Base64 string is /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/, which accepts groups of four Base64 characters with correct = padding at the end. - [ISO 8601 date (YYYY-MM-DD) regex](https://programmes.net/regex/date-iso-8601): The regex for an ISO 8601 date (YYYY-MM-DD) is /^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$/, which accepts a four-digit year, a month 01–12 and a day 01–31. - [Digits only regex](https://programmes.net/regex/digits-only): The regex for a digits-only string is /^\d+$/, which accepts one or more characters 0–9 and nothing else. - [Semantic version (SemVer) regex](https://programmes.net/regex/semver): The regex for a semantic version (SemVer 2.0.0) is /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/, which is the official semver.org pattern: MAJOR.MINOR.PATCH with optional pre-release and build metadata. - [Strong password regex](https://programmes.net/regex/strong-password): The regex for a strong password is /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^A-Za-z0-9]).{12,}$/, which uses four lookaheads to require a lowercase letter, an uppercase letter, a digit and a symbol, plus at least 12 characters. - [Credit card number regex](https://programmes.net/regex/credit-card): The regex for a credit card number is /^(?:4\d{12}(?:\d{3})?|5[1-5]\d{14}|2(?:2(?:2[1-9]|[3-9]\d)|[3-6]\d\d|7(?:[01]\d|20))\d{12}|3[47]\d{13}|6(?:011|5\d\d)\d{12})$/, which checks the issuer prefix and length for Visa, Mastercard, American Express and Discover. - [Phone number (E.164) regex](https://programmes.net/regex/phone-number-e164): The regex for an E.164 international phone number is /^\+[1-9]\d{1,14}$/, which requires a plus sign, a non-zero country code digit and at most 15 digits in total. ### [MIME Types](https://programmes.net/mime) The correct MIME type (Content-Type) for common file extensions — JSON, JavaScript, WebP, WOFF2, MP4 and more — with nginx, Apache and Express config. (207 pages; pattern: https://programmes.net/mime/{slug}, Markdown: https://programmes.net/mime/{slug}.md) - [.avif — image/avif](https://programmes.net/mime/avif): The MIME type for .avif files (AVIF image) is image/avif. - [.bin — application/octet-stream](https://programmes.net/mime/bin): The MIME type for .bin files (Binary data) is application/octet-stream. - [.css — text/css](https://programmes.net/mime/css): The MIME type for .css files (CSS stylesheet) is text/css. - [.csv — text/csv](https://programmes.net/mime/csv): The MIME type for .csv files (CSV) is text/csv. - [.docx — application/vnd.openxmlformats-officedocument.wordprocessingml.document](https://programmes.net/mime/docx): The MIME type for .docx files (Word document) is application/vnd.openxmlformats-officedocument.wordprocessingml.document. - [.html — text/html](https://programmes.net/mime/html): The MIME type for .html files (HTML document) is text/html. - [.jpg — image/jpeg](https://programmes.net/mime/jpg): The MIME type for .jpg files (JPEG image) is image/jpeg. - [.js — text/javascript](https://programmes.net/mime/js): The MIME type for .js files (JavaScript) is text/javascript. - [.json — application/json](https://programmes.net/mime/json): The MIME type for .json files (JSON) is application/json. - [.m3u8 — application/vnd.apple.mpegurl](https://programmes.net/mime/m3u8): The MIME type for .m3u8 files (HLS playlist) is application/vnd.apple.mpegurl. - [.md — text/markdown](https://programmes.net/mime/md): The MIME type for .md files (Markdown) is text/markdown. - [.mjs — text/javascript](https://programmes.net/mime/mjs): The MIME type for .mjs files (JavaScript module) is text/javascript. - [.mp3 — audio/mpeg](https://programmes.net/mime/mp3): The MIME type for .mp3 files (MP3 audio) is audio/mpeg. - [.mp4 — video/mp4](https://programmes.net/mime/mp4): The MIME type for .mp4 files (MP4 video) is video/mp4. - [.pdf — application/pdf](https://programmes.net/mime/pdf): The MIME type for .pdf files (PDF document) is application/pdf. - [.png — image/png](https://programmes.net/mime/png): The MIME type for .png files (PNG image) is image/png. - [.svg — image/svg+xml](https://programmes.net/mime/svg): The MIME type for .svg files (SVG image) is image/svg+xml. - [.ts — video/mp2t](https://programmes.net/mime/ts): The MIME type for .ts files (MPEG transport stream) is video/mp2t. - [.txt — text/plain](https://programmes.net/mime/txt): The MIME type for .txt files (Plain text) is text/plain. - [.wasm — application/wasm](https://programmes.net/mime/wasm): The MIME type for .wasm files (WebAssembly module) is application/wasm. - [.webm — video/webm](https://programmes.net/mime/webm): The MIME type for .webm files (WebM video) is video/webm. - [.webp — image/webp](https://programmes.net/mime/webp): The MIME type for .webp files (WebP image) is image/webp. - [.woff2 — font/woff2](https://programmes.net/mime/woff2): The MIME type for .woff2 files (WOFF2 font) is font/woff2. - [.xlsx — application/vnd.openxmlformats-officedocument.spreadsheetml.sheet](https://programmes.net/mime/xlsx): The MIME type for .xlsx files (Excel workbook) is application/vnd.openxmlformats-officedocument.spreadsheetml.sheet. - [.xml — application/xml](https://programmes.net/mime/xml): The MIME type for .xml files (XML) is application/xml. ### [CIDR Subnet Cheat Sheet](https://programmes.net/cidr) Every IPv4 CIDR prefix from /0 to /32: subnet mask, wildcard mask, total and usable hosts, binary mask and example ranges. (33 pages; pattern: https://programmes.net/cidr/{slug}, Markdown: https://programmes.net/cidr/{slug}.md) - [/0 subnet (0.0.0.0)](https://programmes.net/cidr/0): A /0 CIDR block has subnet mask 0.0.0.0 and contains all 4,294,967,296 IPv4 addresses — it matches any address (the default route). - [/8 subnet (255.0.0.0)](https://programmes.net/cidr/8): A /8 CIDR block has subnet mask 255.0.0.0 and contains 16,777,216 IP addresses, of which 16,777,214 are usable hosts. - [/16 subnet (255.255.0.0)](https://programmes.net/cidr/16): A /16 CIDR block has subnet mask 255.255.0.0 and contains 65,536 IP addresses, of which 65,534 are usable hosts. - [/20 subnet (255.255.240.0)](https://programmes.net/cidr/20): A /20 CIDR block has subnet mask 255.255.240.0 and contains 4,096 IP addresses, of which 4,094 are usable hosts. - [/22 subnet (255.255.252.0)](https://programmes.net/cidr/22): A /22 CIDR block has subnet mask 255.255.252.0 and contains 1,024 IP addresses, of which 1,022 are usable hosts. - [/23 subnet (255.255.254.0)](https://programmes.net/cidr/23): A /23 CIDR block has subnet mask 255.255.254.0 and contains 512 IP addresses, of which 510 are usable hosts. - [/24 subnet (255.255.255.0)](https://programmes.net/cidr/24): A /24 CIDR block has subnet mask 255.255.255.0 and contains 256 IP addresses, of which 254 are usable hosts. - [/25 subnet (255.255.255.128)](https://programmes.net/cidr/25): A /25 CIDR block has subnet mask 255.255.255.128 and contains 128 IP addresses, of which 126 are usable hosts. - [/26 subnet (255.255.255.192)](https://programmes.net/cidr/26): A /26 CIDR block has subnet mask 255.255.255.192 and contains 64 IP addresses, of which 62 are usable hosts. - [/27 subnet (255.255.255.224)](https://programmes.net/cidr/27): A /27 CIDR block has subnet mask 255.255.255.224 and contains 32 IP addresses, of which 30 are usable hosts. - [/28 subnet (255.255.255.240)](https://programmes.net/cidr/28): A /28 CIDR block has subnet mask 255.255.255.240 and contains 16 IP addresses, of which 14 are usable hosts. - [/29 subnet (255.255.255.248)](https://programmes.net/cidr/29): A /29 CIDR block has subnet mask 255.255.255.248 and contains 8 IP addresses, of which 6 are usable hosts. - [/30 subnet (255.255.255.252)](https://programmes.net/cidr/30): A /30 CIDR block has subnet mask 255.255.255.252 and contains 4 IP addresses, of which 2 are usable hosts. - [/31 subnet (255.255.255.254)](https://programmes.net/cidr/31): A /31 CIDR block has subnet mask 255.255.255.254 and contains 2 IP addresses, both usable as hosts on a point-to-point link (RFC 3021). - [/32 subnet (255.255.255.255)](https://programmes.net/cidr/32): A /32 CIDR block has subnet mask 255.255.255.255 and contains exactly one IP address — a single host. ### [Unix Signals](https://programmes.net/signal) Every Unix/POSIX signal — SIGTERM, SIGKILL, SIGINT, SIGHUP, SIGSEGV and the rest — with Linux and macOS numbers, default action, whether it can be caught, kill and trap commands. (34 pages; pattern: https://programmes.net/signal/{slug}, Markdown: https://programmes.net/signal/{slug}.md) - [SIGHUP (1)](https://programmes.net/signal/sighup): SIGHUP (1) is the "hangup" signal, sent when a process loses its controlling terminal and conventionally used to tell a daemon to reload its configuration. - [SIGINT (2)](https://programmes.net/signal/sigint): SIGINT (2) is the interrupt signal a terminal sends to the foreground process when you press Ctrl+C. - [SIGABRT (6)](https://programmes.net/signal/sigabrt): SIGABRT (6) is the abort signal a process sends itself by calling abort(), usually because a library or runtime detected a fatal internal error. - [SIGKILL (9)](https://programmes.net/signal/sigkill): SIGKILL (9) kills a process immediately; it cannot be caught, blocked or ignored, so the process gets no chance to clean up. - [SIGSEGV (11)](https://programmes.net/signal/sigsegv): SIGSEGV (11) is a segmentation fault: the process accessed memory it is not allowed to, such as a null or dangling pointer. - [SIGPIPE (13)](https://programmes.net/signal/sigpipe): SIGPIPE (13) is sent to a process that writes to a pipe or socket whose reading end has been closed ("broken pipe"). - [SIGTERM (15)](https://programmes.net/signal/sigterm): SIGTERM (15) politely asks a process to terminate; it is the default signal of kill and lets the program clean up before exiting. - [SIGTSTP (20)](https://programmes.net/signal/sigtstp): SIGTSTP (20) is the terminal stop signal sent when you press Ctrl+Z, suspending the foreground job. ### [Exit Codes](https://programmes.net/exit) What shell and process exit codes mean — 0, 1, 2, 126, 127, 128+n signal deaths like 130, 137 and 143, sysexits.h 64–78, and documented codes from curl, git, grep, make, pytest, cargo, go, eslint, ansible, rsync and systemd. (99 pages; pattern: https://programmes.net/exit/{slug}, Markdown: https://programmes.net/exit/{slug}.md) - [Exit code 0 (success)](https://programmes.net/exit/0): Exit code 0 means success: the command finished and reported no error. - [Exit code 1 (general error)](https://programmes.net/exit/1): Exit code 1 is the generic "something went wrong" status; what exactly failed is up to each program. - [Exit code 2 (misuse / usage error)](https://programmes.net/exit/2): Exit code 2 conventionally means incorrect usage — a bad option, missing argument or syntax error — or "serious trouble" for tools that use 1 as an answer. - [Exit code 124 (timed out)](https://programmes.net/exit/124): Exit code 124 is what GNU timeout returns when the command it was running hit the time limit and was sent SIGTERM. - [Exit code 126 (not executable)](https://programmes.net/exit/126): Exit code 126 means the command was found but could not be executed — usually missing execute permission or a file that is not a valid program. - [Exit code 127 (command not found)](https://programmes.net/exit/127): Exit code 127 means the shell could not find the command: it is misspelled, not installed, or not on PATH. - [Exit code 128 (fatal error (git))](https://programmes.net/exit/128): Exit code 128 is most often git's status for a fatal error; it is not a signal exit, because 128 + 0 would mean signal 0, which does not exist. - [Exit code 130 (SIGINT, Ctrl+C)](https://programmes.net/exit/130): Exit code 130 means the process was terminated by SIGINT (signal 2) — almost always because someone pressed Ctrl+C. - [Exit code 137 (SIGKILL, OOM-killed)](https://programmes.net/exit/137): Exit code 137 means the process was killed with SIGKILL (signal 9) — most often by the out-of-memory killer or a container memory limit. - [Exit code 139 (SIGSEGV, segfault)](https://programmes.net/exit/139): Exit code 139 means the process crashed with a segmentation fault (SIGSEGV, signal 11): it accessed memory it was not allowed to. - [Exit code 143 (SIGTERM)](https://programmes.net/exit/143): Exit code 143 means the process was terminated by SIGTERM (signal 15) — a normal, polite stop request from kill, docker stop, Kubernetes or systemd. - [curl exit code 6 (couldn't resolve host)](https://programmes.net/exit/curl-6): curl exit code 6 means curl could not resolve the host name — the DNS lookup failed. - [curl exit code 7 (couldn't connect)](https://programmes.net/exit/curl-7): curl exit code 7 means curl resolved the host but failed to connect to it. - [curl exit code 22 (HTTP error with --fail)](https://programmes.net/exit/curl-22): curl exit code 22 means the server returned an HTTP status of 400 or above and curl was run with --fail (-f) or --fail-with-body. - [curl exit code 28 (timeout)](https://programmes.net/exit/curl-28): curl exit code 28 means the operation timed out — either the connection or the whole transfer hit its time limit. - [curl exit code 60 (certificate verification failed)](https://programmes.net/exit/curl-60): curl exit code 60 means the server's TLS certificate could not be verified against the trusted CA certificates. ### [errno Values](https://programmes.net/errno) Every Linux errno — ENOENT, EACCES, EADDRINUSE, ECONNREFUSED, EPIPE, ENOSPC and the rest — with Linux and macOS numbers, the strerror message, what causes it, how to fix it, and how it surfaces in Node.js, Python and Go. (132 pages; pattern: https://programmes.net/errno/{slug}, Markdown: https://programmes.net/errno/{slug}.md) - [EPERM (1)](https://programmes.net/errno/eperm): EPERM (errno 1 on Linux) means "operation not permitted": the call needs privileges the process lacks, regardless of file permission bits. - [ENOENT (2)](https://programmes.net/errno/enoent): ENOENT (errno 2 on Linux) means "no such file or directory": a path, or a directory on the way to it, does not exist. - [E2BIG (7)](https://programmes.net/errno/e2big): E2BIG (errno 7 on Linux) means "argument list too long": the arguments plus environment passed to execve exceed the kernel limit. - [ENOEXEC (8)](https://programmes.net/errno/enoexec): ENOEXEC (errno 8 on Linux) means "exec format error": the kernel does not recognise the file as something it can execute. - [EAGAIN (11)](https://programmes.net/errno/eagain): EAGAIN (errno 11 on Linux) means "resource temporarily unavailable": the operation would block (non-blocking I/O) or a resource limit was hit for now — EWOULDBLOCK is the same number on Linux and macOS. - [EACCES (13)](https://programmes.net/errno/eacces): EACCES (errno 13 on Linux) means "permission denied": file permission bits, an ACL or a security module refused the access. - [EBUSY (16)](https://programmes.net/errno/ebusy): EBUSY (errno 16 on Linux) means "device or resource busy": something else is using the resource in a way that prevents the operation. - [EEXIST (17)](https://programmes.net/errno/eexist): EEXIST (errno 17 on Linux) means "file exists": the call needed the path not to exist, and it does. - [EXDEV (18)](https://programmes.net/errno/exdev): EXDEV (errno 18 on Linux) means "invalid cross-device link": rename() or link() was asked to move a file between different filesystems. - [ENOTDIR (20)](https://programmes.net/errno/enotdir): ENOTDIR (errno 20 on Linux) means "not a directory": a component used as a directory in the path is actually a file. - [EISDIR (21)](https://programmes.net/errno/eisdir): EISDIR (errno 21 on Linux) means "is a directory": the call needs a file, but the path is a directory. - [EINVAL (22)](https://programmes.net/errno/einval): EINVAL (errno 22 on Linux) means "invalid argument": an argument to the call is out of range or does not make sense for this object. - [EMFILE (24)](https://programmes.net/errno/emfile): EMFILE (errno 24 on Linux) means "too many open files": the process hit its own open-descriptor limit (RLIMIT_NOFILE). - [ENOSPC (28)](https://programmes.net/errno/enospc): ENOSPC (errno 28 on Linux) means "no space left on device" — but on Linux it can also mean out of inodes, or out of inotify watches. - [EROFS (30)](https://programmes.net/errno/erofs): EROFS (errno 30 on Linux) means "read-only file system": a write was attempted on a filesystem mounted read-only. - [EPIPE (32)](https://programmes.net/errno/epipe): EPIPE (errno 32 on Linux) means "broken pipe": a write went to a pipe or socket whose reading end has been closed. - [ENOTEMPTY (39)](https://programmes.net/errno/enotempty): ENOTEMPTY (errno 39 on Linux) means "directory not empty": rmdir() or a rename onto a directory needs it to be empty. - [EADDRINUSE (98)](https://programmes.net/errno/eaddrinuse): EADDRINUSE (errno 98 on Linux) means "address already in use": another socket is already bound to that address and port. - [EADDRNOTAVAIL (99)](https://programmes.net/errno/eaddrnotavail): EADDRNOTAVAIL (errno 99 on Linux) means "cannot assign requested address": the local address or port cannot be used on this host right now. - [ECONNRESET (104)](https://programmes.net/errno/econnreset): ECONNRESET (errno 104 on Linux) means "connection reset by peer": the other side (or something in between) sent a TCP RST and dropped the connection. - [ENOTCONN (107)](https://programmes.net/errno/enotconn): ENOTCONN (errno 107 on Linux) means "transport endpoint is not connected": the operation needs a connected socket. - [ETIMEDOUT (110)](https://programmes.net/errno/etimedout): ETIMEDOUT (errno 110 on Linux) means "connection timed out": the remote side never answered within the kernel’s retry window. - [ECONNREFUSED (111)](https://programmes.net/errno/econnrefused): ECONNREFUSED (errno 111 on Linux) means "connection refused": the host answered, but nothing is listening on that port (it replied with a TCP RST). - [EHOSTUNREACH (113)](https://programmes.net/errno/ehostunreach): EHOSTUNREACH (errno 113 on Linux) means "no route to host": the destination host cannot be reached. ### [ASCII Table](https://programmes.net/ascii) All 128 ASCII characters with decimal, hex, octal and binary codes, caret notation, C and JSON escapes, URL and HTML encodings, and what each control character does today. (128 pages; pattern: https://programmes.net/ascii/{slug}, Markdown: https://programmes.net/ascii/{slug}.md) - [ASCII 0: NUL — Null](https://programmes.net/ascii/0): ASCII 0 is NUL (Null), the string terminator in C — hex 0x00, octal 000, binary 00000000. - [ASCII 9: HT — Horizontal Tab](https://programmes.net/ascii/9): ASCII 9 is HT (Horizontal Tab), the tab character — hex 0x09, octal 011, binary 00001001. - [ASCII 10: LF — Line Feed](https://programmes.net/ascii/10): ASCII 10 is LF (Line Feed), the newline character on Unix, Linux and macOS — hex 0x0A, octal 012, binary 00001010. - [ASCII 13: CR — Carriage Return](https://programmes.net/ascii/13): ASCII 13 is CR (Carriage Return), the first half of the Windows CR LF line ending — hex 0x0D, octal 015, binary 00001101. - [ASCII 27: ESC — Escape](https://programmes.net/ascii/27): ASCII 27 is ESC (Escape), the byte that starts terminal escape sequences — hex 0x1B, octal 033, binary 00011011. - [ASCII 32: SP — space](https://programmes.net/ascii/32): ASCII 32 is the space character — hex 0x20, octal 040, binary 00100000. - [ASCII 48: 0 — digit zero](https://programmes.net/ascii/48): ASCII 48 is the digit "0" — hex 0x30, octal 060, binary 00110000. - [ASCII 65: A — uppercase letter A](https://programmes.net/ascii/65): ASCII 65 is the uppercase letter "A" — hex 0x41, octal 101, binary 01000001. - [ASCII 92: \ — reverse solidus (backslash)](https://programmes.net/ascii/92): ASCII 92 is the reverse solidus (backslash), "\" — hex 0x5C, octal 134, binary 01011100. - [ASCII 97: a — lowercase letter a](https://programmes.net/ascii/97): ASCII 97 is the lowercase letter "a" — hex 0x61, octal 141, binary 01100001. ### [JavaScript Key Codes](https://programmes.net/key) KeyboardEvent key, code and legacy keyCode values for every key — Enter, Escape, Space, the arrows, modifiers, letters, digits, F1–F24, the numpad and media keys — with copy-paste JavaScript. (128 pages; pattern: https://programmes.net/key/{slug}, Markdown: https://programmes.net/key/{slug}.md) - [A key](https://programmes.net/key/keya): On a US keyboard layout, the A key has event.key 'a' ('A' with Shift), event.code 'KeyA' and the legacy keyCode 65. - [1 key](https://programmes.net/key/digit1): On a US keyboard layout, the 1 key has event.key '1' ('!' with Shift), event.code 'Digit1' and the legacy keyCode 49. - [Enter key](https://programmes.net/key/enter): The Enter key has event.key 'Enter', event.code 'Enter' and the legacy keyCode 13. - [Tab key](https://programmes.net/key/tab): The Tab key has event.key 'Tab', event.code 'Tab' and the legacy keyCode 9. - [Space key](https://programmes.net/key/space): On a US keyboard layout, the Space key has event.key ' ', event.code 'Space' and the legacy keyCode 32. - [Backspace key](https://programmes.net/key/backspace): The Backspace key has event.key 'Backspace', event.code 'Backspace' and the legacy keyCode 8. - [Escape key](https://programmes.net/key/escape): The Escape key has event.key 'Escape', event.code 'Escape' and the legacy keyCode 27. - [Delete key](https://programmes.net/key/delete): The Delete key has event.key 'Delete', event.code 'Delete' and the legacy keyCode 46. - [Left Shift key](https://programmes.net/key/shiftleft): The Left Shift key has event.key 'Shift', event.code 'ShiftLeft' and the legacy keyCode 16. - [Left Control key](https://programmes.net/key/controlleft): The Left Control key has event.key 'Control', event.code 'ControlLeft' and the legacy keyCode 17. - [Left Alt key](https://programmes.net/key/altleft): The Left Alt key has event.key 'Alt', event.code 'AltLeft' and the legacy keyCode 18. - [Left Meta key](https://programmes.net/key/metaleft): The Left Meta key has event.key 'Meta', event.code 'MetaLeft' and the legacy keyCode 91. - [Up Arrow key](https://programmes.net/key/arrowup): The Up Arrow key has event.key 'ArrowUp', event.code 'ArrowUp' and the legacy keyCode 38. - [Down Arrow key](https://programmes.net/key/arrowdown): The Down Arrow key has event.key 'ArrowDown', event.code 'ArrowDown' and the legacy keyCode 40. - [Left Arrow key](https://programmes.net/key/arrowleft): The Left Arrow key has event.key 'ArrowLeft', event.code 'ArrowLeft' and the legacy keyCode 37. - [Right Arrow key](https://programmes.net/key/arrowright): The Right Arrow key has event.key 'ArrowRight', event.code 'ArrowRight' and the legacy keyCode 39. - [F5 key](https://programmes.net/key/f5): The F5 key has event.key 'F5', event.code 'F5' and the legacy keyCode 116. - [F12 key](https://programmes.net/key/f12): The F12 key has event.key 'F12', event.code 'F12' and the legacy keyCode 123. - [Numpad 0 key](https://programmes.net/key/numpad0): On a US keyboard layout, the Numpad 0 key has event.key '0', event.code 'Numpad0' and the legacy keyCode 96. ### [CSS Named Colors](https://programmes.net/colors) All 148 CSS named colors with HEX, RGB, HSL, WCAG contrast against white and black, tints, shades and similar colors. (148 pages; pattern: https://programmes.net/colors/{slug}, Markdown: https://programmes.net/colors/{slug}.md) - [black](https://programmes.net/colors/black): The CSS named color black has the hex value #000000, which is rgb(0, 0, 0) or hsl(0, 0%, 0%). - [blue](https://programmes.net/colors/blue): The CSS named color blue has the hex value #0000ff, which is rgb(0, 0, 255) or hsl(240, 100%, 50%). - [coral](https://programmes.net/colors/coral): The CSS named color coral has the hex value #ff7f50, which is rgb(255, 127, 80) or hsl(16, 100%, 66%). - [cornflowerblue](https://programmes.net/colors/cornflowerblue): The CSS named color cornflowerblue has the hex value #6495ed, which is rgb(100, 149, 237) or hsl(219, 79%, 66%). - [crimson](https://programmes.net/colors/crimson): The CSS named color crimson has the hex value #dc143c, which is rgb(220, 20, 60) or hsl(348, 83%, 47%). - [gold](https://programmes.net/colors/gold): The CSS named color gold has the hex value #ffd700, which is rgb(255, 215, 0) or hsl(51, 100%, 50%). - [gray](https://programmes.net/colors/gray): The CSS named color gray has the hex value #808080, which is rgb(128, 128, 128) or hsl(0, 0%, 50%). - [green](https://programmes.net/colors/green): The CSS named color green has the hex value #008000, which is rgb(0, 128, 0) or hsl(120, 100%, 25%). - [grey](https://programmes.net/colors/grey): The CSS named color grey has the hex value #808080, which is rgb(128, 128, 128) or hsl(0, 0%, 50%). - [lightgray](https://programmes.net/colors/lightgray): The CSS named color lightgray has the hex value #d3d3d3, which is rgb(211, 211, 211) or hsl(0, 0%, 83%). - [navy](https://programmes.net/colors/navy): The CSS named color navy has the hex value #000080, which is rgb(0, 0, 128) or hsl(240, 100%, 25%). - [orange](https://programmes.net/colors/orange): The CSS named color orange has the hex value #ffa500, which is rgb(255, 165, 0) or hsl(39, 100%, 50%). - [pink](https://programmes.net/colors/pink): The CSS named color pink has the hex value #ffc0cb, which is rgb(255, 192, 203) or hsl(350, 100%, 88%). - [purple](https://programmes.net/colors/purple): The CSS named color purple has the hex value #800080, which is rgb(128, 0, 128) or hsl(300, 100%, 25%). - [rebeccapurple](https://programmes.net/colors/rebeccapurple): The CSS named color rebeccapurple has the hex value #663399, which is rgb(102, 51, 153) or hsl(270, 50%, 40%). - [red](https://programmes.net/colors/red): The CSS named color red has the hex value #ff0000, which is rgb(255, 0, 0) or hsl(0, 100%, 50%). - [silver](https://programmes.net/colors/silver): The CSS named color silver has the hex value #c0c0c0, which is rgb(192, 192, 192) or hsl(0, 0%, 75%). - [skyblue](https://programmes.net/colors/skyblue): The CSS named color skyblue has the hex value #87ceeb, which is rgb(135, 206, 235) or hsl(197, 71%, 73%). - [teal](https://programmes.net/colors/teal): The CSS named color teal has the hex value #008080, which is rgb(0, 128, 128) or hsl(180, 100%, 25%). - [tomato](https://programmes.net/colors/tomato): The CSS named color tomato has the hex value #ff6347, which is rgb(255, 99, 71) or hsl(9, 100%, 64%). - [white](https://programmes.net/colors/white): The CSS named color white has the hex value #ffffff, which is rgb(255, 255, 255) or hsl(0, 0%, 100%). - [yellow](https://programmes.net/colors/yellow): The CSS named color yellow has the hex value #ffff00, which is rgb(255, 255, 0) or hsl(60, 100%, 50%). ## Answers Every answer, guide and cheat sheet also has a Markdown twin: append `.md` to its URL (e.g. https://programmes.net/answers/base64-vs-base64url.md). - [How to Base64 encode a string](https://programmes.net/answers/base64-encode-a-string): Base64 encoding converts text into an ASCII-safe string using 64 characters (A–Z, a–z, 0–9, + and /). Paste your text into a Base64 encoder and it returns the encoded value — for example, "Hello, world!" becomes "SGVsbG8sIHdvcmxkIQ==". - [How to decode a Base64 string](https://programmes.net/answers/decode-a-base64-string): To decode Base64, paste the encoded value into a Base64 decoder and it returns the original text. For example, "SGVsbG8sIHdvcmxkIQ==" decodes to "Hello, world!". - [How to decode a JWT token](https://programmes.net/answers/decode-a-jwt-token): A JWT is three Base64URL parts joined by dots: header.payload.signature. To decode it, paste the token into a JWT decoder, which Base64URL-decodes the header and payload into readable JSON. Decoding does not require the secret — the header and payload are not encrypted, only encoded. - [How to convert a Unix timestamp to a date](https://programmes.net/answers/convert-unix-timestamp-to-date): A Unix timestamp is the number of seconds since 1 January 1970 UTC (the epoch). To convert it, paste the number into an epoch converter to get the date and time. For example, 1700000000 is Tuesday, 14 November 2023, 22:13:20 UTC. - [How to convert JSON to YAML](https://programmes.net/answers/convert-json-to-yaml): JSON and YAML describe the same data model, so conversion is lossless. Paste your JSON into a JSON-to-YAML converter and it returns the YAML equivalent, turning object keys into indented mappings and arrays into dash-prefixed lists. - [How to convert YAML to JSON](https://programmes.net/answers/convert-yaml-to-json): Paste your YAML into a YAML-to-JSON converter to get the JSON equivalent. Indented mappings become objects, dash lists become arrays, and the result is standard, parseable JSON. - [How to convert JSON to CSV](https://programmes.net/answers/convert-json-to-csv): To convert JSON to CSV, the data should be an array of objects. A JSON-to-CSV converter uses the object keys as the header row and writes one CSV row per object, quoting values that contain commas. - [Cron expression examples (and how to read them)](https://programmes.net/answers/cron-expression-examples): A cron expression has five fields: minute, hour, day-of-month, month, and day-of-week. For example, "*/5 * * * *" runs every 5 minutes, "0 * * * *" runs hourly on the hour, and "0 9 * * 1-5" runs at 9:00 AM Monday–Friday. - [How to generate a UUID (v4)](https://programmes.net/answers/generate-a-uuid): A version-4 UUID is a 128-bit random identifier written as 36 characters in the form 8-4-4-4-12 hex digits, e.g. f47ac10b-58cc-4372-a567-0e02b2c3d479. Open a UUID generator and it produces one (or many) using your browser’s cryptographically secure random source. - [How to URL-encode a string](https://programmes.net/answers/url-encode-a-string): URL encoding (percent-encoding) replaces characters that are unsafe in a URL with a "%" followed by their hex byte value. For example, a space becomes %20, "&" becomes %26, and "=" becomes %3D, so the value can be placed safely in a query string. - [How to generate a SHA-256 hash of a string](https://programmes.net/answers/generate-a-sha256-hash): SHA-256 is a one-way cryptographic hash that turns any input into a fixed 64-character (256-bit) hex digest. Paste your text into a hash tool to get it — for example, the SHA-256 of "hello" is 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824. - [How to convert hexadecimal to decimal](https://programmes.net/answers/convert-hex-to-decimal): Hexadecimal is base-16, so each digit is worth 16 times the one to its right. To convert to decimal, multiply each digit by its place value and add them up — for example, hex 1A4 = 1×256 + 10×16 + 4 = 420. A number-base converter does this instantly. - [How to convert a HEX color to RGB](https://programmes.net/answers/convert-hex-to-rgb): A hex color packs red, green, and blue into three pairs of hex digits: #RRGGBB. To convert to RGB, read each pair as a 0–255 value — for example, #4f46e5 is rgb(79, 70, 229), because 4f=79, 46=70, and e5=229. - [How to format (beautify) JSON](https://programmes.net/answers/format-json): Formatting JSON re-indents it with consistent spacing and line breaks so it is readable, and validates it at the same time. Paste minified or messy JSON into a formatter and it returns a beautified version (and flags any syntax error). - [How to convert JSON to a TypeScript interface](https://programmes.net/answers/convert-json-to-typescript): A JSON-to-TypeScript converter infers a type from a JSON sample: each key becomes a property and each value’s shape becomes its type (string, number, boolean, arrays, and nested interfaces). Paste your JSON and it generates ready-to-use interfaces. - [How to generate a strong password](https://programmes.net/answers/generate-a-strong-password): A strong password is long and random. Use a generator that draws from your browser’s cryptographically secure random source and lets you set the length and character sets (uppercase, lowercase, digits, symbols). Aim for at least 16 characters with mixed types. - [How to hash a password with bcrypt](https://programmes.net/answers/bcrypt-hash-a-password): Bcrypt is a deliberately slow, salted password hash. Each hash embeds a random salt and a cost factor, so the same password produces a different 60-character hash every time — which is exactly what you want for stored passwords. Paste a password and pick a cost (work factor) to generate one. - [How to convert text to camelCase, snake_case, or kebab-case](https://programmes.net/answers/convert-text-to-camelcase): A case converter splits text into words and rejoins them in the target convention. "hello world example" becomes helloWorldExample (camelCase), hello_world_example (snake_case), or hello-world-example (kebab-case). - [How to create a URL slug from a string](https://programmes.net/answers/create-a-url-slug): Slugifying lowercases the text, replaces spaces with hyphens, strips punctuation, and removes accents — producing a clean, URL-safe string. "Hello World! A Post (2024)" becomes hello-world-a-post-2024. - [How to escape HTML special characters](https://programmes.net/answers/escape-html-special-characters): Escaping converts characters that have meaning in HTML — <, >, &, and " — into entities (<, >, &, ") so a browser renders them as text instead of interpreting them as tags. This prevents broken markup and is a basic XSS safeguard. - [How to check color contrast for WCAG accessibility](https://programmes.net/answers/check-color-contrast-wcag): WCAG accessibility sets minimum contrast ratios between text and its background: 4.5:1 for normal text and 3:1 for large text (AA), or 7:1 for AAA. A contrast checker computes the ratio from two colours — for example, black on white is 21:1, which passes every level. - [What does chmod 755 mean?](https://programmes.net/answers/what-does-chmod-755-mean): chmod 755 sets file permissions to rwxr-xr-x: the owner can read, write, and execute; the group and everyone else can read and execute but not write. Each digit is a sum of read (4), write (2), and execute (1), so 7 = rwx and 5 = r-x. - [How to generate Lorem Ipsum placeholder text](https://programmes.net/answers/generate-lorem-ipsum): Lorem Ipsum is scrambled Latin-like filler used to mock up layouts without real copy distracting from the design. A generator lets you choose how much (paragraphs, sentences, or words) and the output format (plain text, HTML, or Markdown). - [How to test a regular expression](https://programmes.net/answers/test-a-regular-expression): A regex tester runs your pattern against sample text and highlights the matches and capture groups live, so you can refine it without writing code. For example, the pattern \b\d{3}-\d{4}\b matches "555-1234" in "Call 555-1234". - [How to convert a Unix timestamp to a date in JavaScript](https://programmes.net/answers/convert-unix-timestamp-to-date-in-javascript): Multiply the Unix timestamp (in seconds) by 1000 and pass it to `new Date()`, because JavaScript dates count milliseconds: `new Date(1700000000 * 1000).toISOString()` returns "2023-11-14T22:13:20.000Z". Format it for people with `toLocaleString()` or `Intl.DateTimeFormat`. - [How to convert a Unix timestamp to a datetime in Python](https://programmes.net/answers/convert-unix-timestamp-to-date-in-python): Use `datetime.fromtimestamp(ts, tz=timezone.utc)` from the standard library: `datetime.fromtimestamp(1700000000, tz=timezone.utc)` returns `2023-11-14 22:13:20+00:00`. Passing `tz` gives a time-zone-aware datetime; without it you get a naive datetime in the machine’s local time. - [How to convert a Unix timestamp to a date in SQL](https://programmes.net/answers/convert-unix-timestamp-to-date-in-sql): Each database has its own function: PostgreSQL `to_timestamp(1700000000)`, MySQL `FROM_UNIXTIME(1700000000)`, SQLite `datetime(1700000000, 'unixepoch')` and SQL Server `DATEADD(SECOND, 1700000000, '1970-01-01')`. All return 14 November 2023 22:13:20 UTC, though MySQL displays it in the session time zone. - [How to get the current Unix timestamp](https://programmes.net/answers/get-current-unix-timestamp): Ask the system clock for the seconds elapsed since 1970-01-01 00:00:00 UTC: `date +%s` in a shell, `Math.floor(Date.now() / 1000)` in JavaScript, or `int(time.time())` in Python. The value is the same everywhere at a given moment, because Unix time is always UTC. - [What is the ISO 8601 date format?](https://programmes.net/answers/what-is-iso-8601-date-format): ISO 8601 is the international standard for writing dates and times from largest to smallest unit: `YYYY-MM-DD` for dates and `YYYY-MM-DDTHH:MM:SS` followed by `Z` (UTC) or an offset such as `+02:00` for date-times — for example `2023-11-14T22:13:20Z`. Strings in this form sort chronologically as plain text and parse unambiguously. - [How to convert UTC to local time](https://programmes.net/answers/convert-utc-to-local-time): Treat the UTC value as an instant and format it in the target IANA time zone: in JavaScript, `new Date('2023-11-14T22:13:20Z').toLocaleString('en-US', { timeZone: 'America/New_York' })` returns "11/14/2023, 5:13:20 PM". The time-zone database applies the right offset for that date, including daylight saving time. - [What is the difference between UUID v4 and UUID v7?](https://programmes.net/answers/uuid-v4-vs-v7): UUID v4 is 122 bits of randomness with no order, while UUID v7 starts with a 48-bit Unix timestamp in milliseconds followed by 74 random bits, so v7 values sort by creation time. Both are standard 128-bit UUIDs (RFC 9562): use v7 for database primary keys, and v4 when an ID must not reveal when it was created. - [What is a ULID?](https://programmes.net/answers/what-is-a-ulid): A ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit ID written as 26 Crockford Base32 characters: the first 10 encode a 48-bit millisecond timestamp and the last 16 encode 80 random bits. Because the timestamp comes first, ULIDs sort by creation time even as plain strings, for example `01ARZ3NDEKTSV4RRFFQ69G5FAV`. - [What is the difference between Base64 and Base64url?](https://programmes.net/answers/base64-vs-base64url): Base64url is Base64 with two characters swapped so the output is safe in URLs and file names: `+` becomes `-`, `/` becomes `_`, and the trailing `=` padding is usually dropped. Both are defined in RFC 4648 and encode the same bytes — the bytes `FB FF` are `+/8=` in Base64 and `-_8` in Base64url. - [How to Base64 encode a string in JavaScript](https://programmes.net/answers/base64-encode-in-javascript): In Node.js use `Buffer.from(text).toString('base64')`; in browsers use `btoa()`. `btoa()` only accepts characters up to U+00FF and throws on others such as "✓" or emoji, so convert the text to UTF-8 bytes with `TextEncoder` first — "héllo" encodes to "aMOpbGxv". - [How to pretty-print JSON in the terminal](https://programmes.net/answers/pretty-print-json-in-terminal): Pipe the JSON through `jq .` — for example `curl -s https://api.example.com/items | jq .` — or, with nothing extra installed, use Python’s built-in `python3 -m json.tool`. Both validate the JSON and print it indented; jq also adds colour and can filter the output. - [How to escape a string for JSON](https://programmes.net/answers/escape-a-string-for-json): Inside a JSON string, escape the double quote as `\"`, the backslash as `\\`, and control characters such as newline and tab as `\n` and `\t` (or `\u00XX`). Let a serializer do it: `JSON.stringify(text)` or Python’s `json.dumps(text)` returns a correctly escaped, quoted JSON string. - [How to compare two JSON objects](https://programmes.net/answers/compare-two-json-objects): Parse both documents and compare them structurally, because key order and whitespace do not matter in JSON: `diff <(jq -S . a.json) <(jq -S . b.json)` in a shell, `util.isDeepStrictEqual(a, b)` in Node.js, or `json.load(f1) == json.load(f2)` in Python. A JSON diff tool shows exactly which keys were added, removed or changed. - [How to query JSON with JSONPath (examples)](https://programmes.net/answers/jsonpath-examples): JSONPath selects parts of a JSON document with a path that starts at the root `$`: `$.store.book[0].title` picks one value, `$.store.book[*].author` every author, `$..price` every price at any depth, and `$.store.book[?(@.price < 10)]` filters by a condition. JSONPath is standardised as RFC 9535 (2024). - [What does /24 mean in CIDR notation?](https://programmes.net/answers/what-does-cidr-24-mean): /24 means the first 24 bits of the IPv4 address are the network prefix, leaving 8 bits for hosts: a netmask of 255.255.255.0 and 2^8 = 256 addresses. For example, 192.168.1.0/24 covers 192.168.1.0 to 192.168.1.255, of which 254 are usable hosts — the first is the network address and the last is the broadcast address. - [How many IP addresses are in a CIDR block?](https://programmes.net/answers/how-many-ip-addresses-in-a-cidr-block): An IPv4 CIDR block with prefix length n contains 2^(32 − n) addresses: a /24 has 256, a /16 has 65,536 and a /28 has 16. Subtract 2 for the usable hosts on an ordinary subnet, because the first address identifies the network and the last is the broadcast address. - [What is CORS?](https://programmes.net/answers/what-is-cors): CORS (Cross-Origin Resource Sharing) is the browser mechanism that lets a server allow web pages from other origins to read its responses. By default the same-origin policy stops a page on https://app.example.com reading a response from https://api.example.com; the API opts in by sending `Access-Control-Allow-Origin: https://app.example.com`. - [What is an ETag in HTTP?](https://programmes.net/answers/what-is-an-etag): An ETag (entity tag) is an HTTP response header that identifies one specific version of a resource, such as `ETag: "33a64df5"`. A client that cached the response sends the value back in `If-None-Match`; if the resource has not changed, the server replies `304 Not Modified` with no body, saving bandwidth. - [What is the difference between HTTP 401 and 403?](https://programmes.net/answers/http-401-vs-403): 401 Unauthorized means the request lacks valid credentials — the client is not authenticated and should log in or send a valid token. 403 Forbidden means the server understood who the client is (or does not care) but refuses access, so re-authenticating will not help. A 401 response must include a `WWW-Authenticate` header naming the auth scheme. - [What is the difference between a 301 and a 302 redirect?](https://programmes.net/answers/http-301-vs-302-redirect): A 301 Moved Permanently tells browsers and search engines the URL has moved for good, so they update links, transfer ranking signals and may cache the redirect indefinitely. A 302 Found is temporary: clients keep using the original URL. Use 308 or 307 instead when the request method and body must be preserved, as with a POST. - [What is the correct Content-Type for JSON?](https://programmes.net/answers/json-content-type): The media type for JSON is `application/json`, so send `Content-Type: application/json` with JSON request and response bodies. JSON exchanged between systems must be UTF-8 (RFC 8259), so a charset parameter is unnecessary — `application/json; charset=utf-8` is harmless but has no effect on compliant parsers. - [How to convert a curl command to JavaScript fetch or Python requests](https://programmes.net/answers/convert-curl-to-fetch-or-python): Map each curl flag to its equivalent: the URL stays the same, `-X` becomes the method, every `-H` becomes a header, and `-d` or `--data` becomes the request body (curl switches to POST when you pass `-d`). A curl converter does this automatically and outputs JavaScript fetch, Python requests or Node.js code. - [What is the difference between encodeURI and encodeURIComponent?](https://programmes.net/answers/encodeuri-vs-encodeuricomponent): `encodeURIComponent` escapes every character with a special meaning in URLs — including `/ ? : @ & = + $ #` — so use it for individual query values and path segments. `encodeURI` leaves those reserved characters intact and is only for encoding a complete URL. For example, `encodeURIComponent("a b&c=d/e?f")` returns "a%20b%26c%3Dd%2Fe%3Ff". - [Should a space be URL-encoded as %20 or +?](https://programmes.net/answers/url-encoding-space-20-vs-plus): Use `%20` — it means a space everywhere in a URL. `+` means a space only in `application/x-www-form-urlencoded` data, which is how HTML forms and `URLSearchParams` encode query strings; in a URL path a `+` is a literal plus sign. To send a real plus sign in a query value, encode it as `%2B`. - [How to generate a secure random string or token](https://programmes.net/answers/generate-a-secure-random-string): Use your platform’s cryptographically secure random generator, never `Math.random()`: `crypto.randomBytes(32).toString('base64url')` in Node.js, `secrets.token_urlsafe(32)` in Python, or `openssl rand -hex 32` in a shell. 32 random bytes (256 bits) is ample for session IDs, API keys and password-reset tokens. - [bcrypt vs Argon2: which should I use for passwords?](https://programmes.net/answers/bcrypt-vs-argon2): Prefer Argon2id for new systems: it won the 2015 Password Hashing Competition, is standardised in RFC 9106, and is memory-hard, which makes GPU and ASIC cracking far more expensive. bcrypt is still acceptable — OWASP lists it after Argon2id and scrypt — but it uses little memory and only hashes the first 72 bytes of a password. - [How to generate an HMAC-SHA256 signature](https://programmes.net/answers/generate-hmac-sha256-signature): Compute HMAC-SHA256 from a secret key and the message with your language’s crypto library — `crypto.createHmac('sha256', key).update(message).digest('hex')` in Node.js or `hmac.new(key, message, hashlib.sha256).hexdigest()` in Python. The result is a 256-bit tag (64 hex characters) proving the message came from a holder of the key and was not modified. - [What is the difference between MD5 and SHA-256?](https://programmes.net/answers/md5-vs-sha256): MD5 produces a 128-bit hash and is cryptographically broken — practical collision attacks have existed since 2004 — so it must not be used for signatures, certificates or passwords. SHA-256 produces a 256-bit hash with no known practical collisions and is the standard choice for integrity checks. "hello" is 5d41402a…c592 in MD5 and 2cf24dba…9824 in SHA-256. - [How to get the SHA-256 checksum of a file](https://programmes.net/answers/sha256-checksum-of-a-file): Run `sha256sum file` on Linux, `shasum -a 256 file` on macOS, or `Get-FileHash file -Algorithm SHA256` in Windows PowerShell, then compare the 64-character hex result with the checksum the publisher lists. For a list of published checksums, `sha256sum -c SHA256SUMS` verifies every entry at once. - [How to verify a JWT signature](https://programmes.net/answers/verify-a-jwt-signature): Recompute the signature over the token’s `header.payload` with the expected algorithm and key and compare it with the third part — in practice, call a library such as `jose` (`jwtVerify`) or PyJWT (`jwt.decode`) with the secret or public key and an explicit list of allowed algorithms. Then check `exp`, `iss` and `aud`: decoding alone proves nothing. - [What is the difference between HS256 and RS256 for JWTs?](https://programmes.net/answers/jwt-hs256-vs-rs256): HS256 signs a JWT with HMAC-SHA256 using one shared secret, so every service that can verify tokens can also create them. RS256 signs with an RSA private key (RSASSA-PKCS1-v1_5 with SHA-256) and verifies with the public key, so only the issuer can mint tokens while anyone can check them — the usual choice for identity providers and multi-service systems. - [How do TOTP two-factor authentication codes work?](https://programmes.net/answers/how-totp-codes-work): A TOTP (time-based one-time password, RFC 6238) code is an HMAC of the current 30-second time step, keyed with a secret shared between the server and your authenticator app, then truncated to 6 digits. Both sides compute it independently from the clock, so the code changes every 30 seconds and the secret never travels over the network after setup. - [How to run a cron job every 5 minutes](https://programmes.net/answers/cron-every-5-minutes): Use `*/5 * * * *`. The `*/5` in the minute field means “every minute divisible by 5”, so the job runs at :00, :05, :10 … :55 of every hour, every day. Add it with `crontab -e`, for example `*/5 * * * * /usr/local/bin/backup.sh`. - [How to list and edit cron jobs with crontab](https://programmes.net/answers/list-and-edit-cron-jobs): Run `crontab -l` to list your cron jobs and `crontab -e` to edit them in your default editor; the new schedule is installed when you save and exit. Use `sudo crontab -u alice -l` for another user. System-wide jobs live in `/etc/crontab` and `/etc/cron.d/`, whose lines include an extra user column. - [What does chmod 644 mean?](https://programmes.net/answers/what-does-chmod-644-mean): `chmod 644` sets a file to `rw-r--r--`: the owner can read and write (6 = 4 + 2), while the group and everyone else can only read (4). It is the standard permission for regular files — HTML, CSS, images and configuration — that others need to read but not change. - [What permissions should SSH keys and the .ssh folder have?](https://programmes.net/answers/ssh-key-permissions): Make `~/.ssh` 700 (`drwx------`), private keys such as `~/.ssh/id_ed25519` 600 (`-rw-------`), and public keys and `known_hosts` 644. Keep `authorized_keys` and `config` at 600. OpenSSH refuses to use a private key that other users can read, failing with “UNPROTECTED PRIVATE KEY FILE!”. - [How to convert decimal to binary](https://programmes.net/answers/convert-decimal-to-binary): Divide the number by 2 repeatedly and read the remainders from last to first: 42 → 21 r0 → 10 r1 → 5 r0 → 2 r1 → 1 r0 → 0 r1, so 42 in binary is 101010. In code, use `(42).toString(2)` in JavaScript or `bin(42)` in Python, which returns "0b101010". - [How to convert an RGB color to HEX](https://programmes.net/answers/convert-rgb-to-hex): Convert each of the red, green and blue values (0–255) to a two-digit hexadecimal number and join them after a `#`: rgb(255, 99, 71) → ff, 63, 47 → `#ff6347`. In JavaScript: `'#' + [r, g, b].map((n) => n.toString(16).padStart(2, '0')).join('')`. - [What is the difference between KB and KiB (and GB vs GiB)?](https://programmes.net/answers/kb-vs-kib): A kilobyte (KB) is 1,000 bytes in the SI decimal system, while a kibibyte (KiB) is 1,024 bytes in the IEC binary system. The gap grows at each step: 1 GB is 1,000,000,000 bytes but 1 GiB is 1,073,741,824. That is why a “500 GB” drive shows as about 465.66 GiB in tools that count in powers of 1,024. - [How to remove duplicate lines from a file](https://programmes.net/answers/remove-duplicate-lines): Run `sort -u file.txt` to sort the lines and drop duplicates, or `awk '!seen[$0]++' file.txt` to remove duplicates while keeping the original order. Plain `uniq` only removes adjacent duplicates, so use it after sorting: `sort file.txt | uniq`. - [How to find the Unicode code point of a character](https://programmes.net/answers/find-unicode-code-point): Ask for the character’s code point and print it in hex: `'é'.codePointAt(0).toString(16)` in JavaScript or `hex(ord('é'))` in Python both give e9, written U+00E9. The same character is stored as the two bytes C3 A9 in UTF-8 — the code point is the character’s number, the encoding is how that number is stored. - [What regex should I use to validate an email address?](https://programmes.net/answers/regex-to-validate-an-email-address): For form validation, a pragmatic pattern is `^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$`: a run of allowed characters, one @, a domain and a top-level domain of at least two letters. No regex can prove an address exists, so treat it as a typo check and confirm ownership with a verification email. - [What is the format of a Wi-Fi QR code?](https://programmes.net/answers/wifi-qr-code-format): A Wi-Fi QR code encodes a text string like `WIFI:T:WPA;S:MyNetwork;P:my-password;;` — `T` is the security type (WPA, WEP or nopass), `S` the network name (SSID), `P` the password, and an optional `H:true` marks a hidden network. iOS and Android camera apps recognise it and offer to join the network. - [What is a CORS preflight request?](https://programmes.net/answers/cors-preflight-request): A CORS preflight is the `OPTIONS` request a browser sends before a cross-origin request that is not “simple” — for example a `PUT` or `DELETE`, a JSON body, or an `Authorization` header. It asks, via `Access-Control-Request-Method` and `Access-Control-Request-Headers`, whether the real request is allowed, and the browser sends that request only if the response approves it. - [How do I allow multiple origins in Access-Control-Allow-Origin?](https://programmes.net/answers/access-control-allow-origin-multiple-origins): You cannot list several origins: `Access-Control-Allow-Origin` holds exactly one origin, `*` or `null`. To allow a set of sites, keep an allow-list on the server, compare the request’s `Origin` header with it, and echo back that one origin when it matches — plus `Vary: Origin`, so caches do not serve one site’s response to another. - [What is the difference between Cache-Control no-cache and no-store?](https://programmes.net/answers/cache-control-no-cache-vs-no-store): `no-cache` lets browsers and CDNs store a response but makes them revalidate it with the server — usually a cheap `304 Not Modified` — before every reuse. `no-store` forbids storing it anywhere. Use `no-cache` for content that must always be current, such as HTML pages, and `no-store` for sensitive responses like account pages or personal data. - [How do I add my site to the HSTS preload list?](https://programmes.net/answers/hsts-preload): Send `Strict-Transport-Security: max-age=63072000; includeSubDomains; preload` on HTTPS responses from your bare domain, redirect HTTP to HTTPS, make sure every subdomain works over HTTPS, then submit the domain at hstspreload.org. Once it ships in Chrome’s list — which Firefox, Safari and Edge also base theirs on — browsers use HTTPS for the domain even on the first visit. - [CSP nonce vs hash: which should I use for inline scripts?](https://programmes.net/answers/csp-nonce-vs-hash): Use a nonce when the server renders HTML per request: generate a fresh random value for every response, put it in the header (`script-src 'nonce-…'`) and on each `