gaiety / docker-reclaimed-space-prune.sh

0 curtidas
0 bifurcações
1 arquivos
Última atividade 1752986346
Docker system prune with reclaimed space results
1 RESULT=$(docker system prune -a -f | grep "reclaimed space")
2
3 echo "Docker system prune: $RESULT" # Reclaimed space 12GB

gaiety / date-time-bash.sh

0 curtidas
0 bifurcações
1 arquivos
Última atividade 1752986119
Simple variables for the current date and time, great to include in logs for small scripts
1 currentDate=$(date +"%m_%d_%Y")
2 currentTime=$(date +"%T")
3
4 echo "Hello! It is $currentTime on the $currentDate" >> my-log.log

gaiety / Rsync the Linux Root Dir

0 curtidas
0 bifurcações
1 arquivos
Última atividade 1752986011
Without the cruft! It's nice to do a partial system root backup of Linux with rsync, this has a lot of excludes already for you.
1 rsync -a \
2 --log-file=$logFile \
3 --exclude=/swap.img \
4 --exclude=/snap \
5 --exclude=/dev \
6 --exclude=/mnt \
7 --exclude=/proc \
8 --exclude=/sys \
9 --exclude=/tmp \
10 --exclude=/var/tmp \

gaiety / userIsTypingStuff.js

0 curtidas
0 bifurcações
1 arquivos
Última atividade 1752984618
Hack for JavaScript check to see if the user might be typing somewhere
1 let userIsTypingStuff = document.querySelectorAll('input:focus, textarea:focus').length !== 0;

gaiety / Dynamic Length Arrays in JavaScript

0 curtidas
0 bifurcações
1 arquivos
Última atividade 1752983856
1 let arrayOf100Things = [...Array(100).keys()];
Próximo Anterior