This file contains 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
# allow suspicious | |
xattr -d com.apple.quarantine <filename> | |
chmod 744 <filename> | |
# make visible | |
export LDFLAGS="-L/opt/homebrew/opt/icu4c@76/lib" | |
export CPPFLAGS="-I/opt/homebrew/opt/icu4c@76/include" | |
export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c@76/lib/pkgconfig" |
This file contains 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
ls -force | |
# battery status | |
$charge = Get-CimInstance -ClassName Win32_Battery | Select-Object -ExpandProperty EstimatedChargeRemaining | |
shutdown -r | |
# ping port | |
Test-NetConnection -ComputerName 10.99.245.6 -Port 443 |
This file contains 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
getnewaddress label | |
read x | |
walletpassphrase "$x" 60 | |
sendtoaddress 3AoTqnxsDEeeHsPrp90BbiCxCFxGpVk4mM 0.0019462 |
This file contains 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
dom_el.style.backgroundImage = `url("data:image/svg+xml;utf8,<svg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'><circle cx='50' cy='50' r='` + value + `' fill='%2399f' /></svg>")`; |
This file contains 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
cat server_ssl.cnf | |
``` | |
[req] | |
distinguished_name = req_distinguished_name | |
attributes = req_attributes | |
req_extensions = v3_req | |
prompt = no | |
[req_distinguished_name] | |
C = DE |
This file contains 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
#!/bin/sh | |
find ${1:-.} -type f -exec ls -lnq {} \+ | awk ' | |
BEGIN {sum=0} # initialization for clarity and safety | |
function pp() { | |
u="+Ki+Mi+Gi+Ti+Pi+Ei"; | |
split(u,unit,"+"); | |
v=sum; | |
for(i=1;i<7;i++) { | |
if(v<1024) break; | |
v/=1024; |
This file contains 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
*/6 * * * * python3 /root/delete_hetzner_disabled.py |
This file contains 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
\dt -- SHOW TABLES | |
\dT+ -- SHOW TYPES | |
\du -- SHOW USERS | |
\d table -- SHOW INFO | |
CREATE ROLE watcher PASSWORD 'secure' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN; | |
ALTER USER postgres WITH PASSWORD 'secure'; | |
GRANT USAGE ON SCHEMA public TO watcher; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO watcher; | |
SELECT * FROM pg_stat_database; (show processlist;) | |
SELECT setval('uploads_id_seq', (SELECT MAX(id) from "uploads")); |
This file contains 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
ssh-copy-id -i ~/.ssh/mykey user@host | |
export HISTCONTROL=ignorespace | |
split -l 10000 myfile segment | |
ssh -nNT -L 9001:host01:22 user@host02 | |
ssh -nNT -L 7777:localhost:8888 user@host02 | |
tar cf - DATA_DIR | gzip --to-stdout --fast | ssh root@host "cd /data; tar xzf -" | |
tar zc DATA_DIR | ssh root@host "tar zx -C DEST_DIR" | |
python -m smtpd -n -c DebuggingServer localhost:1025 | |
netstat -nlpt |
This file contains 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
# common GIT tips | |
git show HEAD~0:index.html | |
git log --graph --oneline --date-order --decorate --color --all | |
git diff --name-status master..somebranch | |
git diff somebranch master -- myfile | |
git commit --amend -m "New commit message" | |
git archive --format zip --output /full/path/to/zipfile.zip master | |
git archive --format tar --output ~/.tar master | |
git remote set-url origin git://new.url.here | |
git shortlog -s -n |
NewerOlder