This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # To figure out the tag use: | |
| # | |
| # - change the version 25.10 to whatever | |
| # - match the tag in the --install-file option | |
| # - no dra? get here: https://github.com/devmatteini/dra | |
| # | |
| # gh release list --repo ClickHouse/ClickHouse --limit 10000 | rg 25\.10 | |
| dra download \ | |
| --install-file clickhouse-client-25.10.6.36/usr/bin/clickhouse-client ClickHouse/ClickHouse \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| uvx timetool 2025-12-01T08:20:18.174661485Z | |
| # output | |
| # 1764577218 | |
| # 2025-12-01T08:20:18.174+00:00 Dec 01, 2025 8:20:18 UTC | |
| # 2025-12-01T13:50:18.174+05:30 Dec 01, 2025 1:50:18 PM IST | |
| # ~26.6 minutes ago (1598.420771 seconds ago) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # list git tags in descending order | |
| # | |
| # tag format: vX.X.X | |
| git tag --list 'v*' --sort=-v:refname | |
| # get the latest tag | |
| # | |
| # tag format: vX.X.X | |
| git tag --list 'v*' --sort=-v:refname | head -n1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Where caddy on ubuntu stores the actual certificates | |
| /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/domain/domain.key | |
| /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/domain/domain.crt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # List tables when using a custom schema other than 'public' in postgres | |
| # 'BASE TABLE' table_type filter ensures only tables are listed and not views | |
| # | |
| # Replace <schema-name> with your schema name | |
| select table_name from information_schema.tables where table_schema = '<schema-name>' and table_type = 'BASE TABLE'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # need admin password | |
| sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Usage by formulae | |
| echo "=== Formulae ===" | |
| du -sh $(brew --cellar)/* 2>/dev/null | sort -h | |
| # Usage by casks | |
| echo "=== Casks ===" | |
| du -sh /opt/homebrew/Caskroom/* 2>/dev/null | sort -h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # List all the roles for a predefined role | |
| # | |
| # gcloud iam roles describe [PREDEFINED_ROLE] | |
| gcloud iam roles describe roles/owner | |
| gcloud iam roles describe roles/editor | |
| gcloud iam roles describe roles/viewer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # assuming the certificate is in a file at /tmp/cert.txt | |
| cat /tmp/cert.txt | openssl x509 -text -noout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Check if 'something' is just a plain JavaScript object | |
| // like a map of keys and values. | |
| function isObject(something) { | |
| const type = Object.prototype.toString.call(something); | |
| return something === Object(something) && type !== "[object Array]" && type !== "[object Function]" && type !== "[object Date]" && type !== "[object RegExp]" && type !== "[object Set]" && type !== "[object Map]"; | |
| } | |
| // truthy | |
| console.log("{}", isObject({})); | |
| console.log("Object.create(null)", isObject(Object.create(null))) |
NewerOlder