DST=/mnt
find /var/lib -type f -size +1G -exec ls -lh {} \; | tee $DST/bigfiles_var_lib_$(date "+%H%M").log
find /var/lib -type f -size +1G -exec ls -lh {} \; | awk '{ print $5 ": " $9 }' | sort -rh > $DST/bigfiles_var_lib_$(date "+%H%M").sorted.log
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
# for hdd | |
device=sata4; sudo sh -c "echo 1 > /sys/block/${device}/device/delete" | |
# for usb | |
udisksctl power-off -b /dev/sdd |
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
for REPO in $(gcloud alpha container images list --repository=gcr.io/volterraio --sort-by="~TIMESTAMP"|grep -Ev '^NAME'); do \ | |
gcloud container images list-tags $REPO --format="table[no-heading](DIGEST,TIMESTAMP)"|\ | |
grep 2024-08 | xargs -I% echo $(basename $REPO) %; done |\ | |
clipivot count --rows=0 --val=3 |sort -g -t, -k2 -r |head -n 50 |
https://github.com/OpenVPN/easy-rsa/tree/master/doc
Init:
wget https://github.com/OpenVPN/easy-rsa/releases/download/3.0.1/EasyRSA-3.0.1.tgz
tar xzvf EasyRSA-3.0.1.tgz
cd EasyRSA-3*
vim vars # var.example
./easyrsa init-pki
Getting started guide to the unix password manager pass
. Manage gpg
encripted passwords (files) in
a standar directory-like hierarchy. Such files can be copied or stored in a git
repository.
- Install [pass][pass-homepage] (standard unix password manager):
Ubuntu/Debian:
$ sudo apt-get install pass
this directory holds CA key + wildcard certificates created for new infrastructure the CA key/cert is "ca-cert.pem/key"
TODO:
- create scripts to re-generate client certificates based on NEW CA
- develop procedure to generate client/server certs from template (partialy done)
- develop procedure to generate clr files + revocate certificate + distribute them on public places
http://fahdshariff.blogspot.cz/2012/12/sed-mutli-line-replacement-between-two.html
Sed: Mutli-Line Replacement Between Two Patterns
This post has some useful sed commands which can be used to perform replacements and deletes between two patterns across multiple lines. For example, consider the following file:
$ cat file
line 1
line 2
foo
line 3
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
❯ sudo sntp -sS time.apple.com | |
Password: | |
+9763418.309211 +/- 0.019967 time.apple.com 17.253.14.253 |
NewerOlder