Cheat Sheet


GNU/Unix Systems Stress Test

sha1sum /dev/zero &

killall sha1sum


Windows user password bypass

Navigate to C:\Windows\System32

Rename utilman.exe to utilman2.exe

Rename cmd.exe to utilman.exe

Restart the pc

At the login prompt press the Ease of Access button, a command prompt will appear

Change the password of the selected user account

Once you changed the password, revert the names you changed earlier to the original ones


yt-dlp

Video massima qualità e metadati:

yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]" -ciw -o "%(upload_date)s - %(title)s.%(ext)s" --write-description --write-info-json --write-annotations --write-sub --write-thumbnail -v https://www.youtube.com/video_or_channel

Solo audio mp3:

yt-dlp --extract-audio --audio-format mp3 https://www.youtube.com/video_or_channel

PLAYLIST solo audio mp3:

yt-dlp --extract-audio --audio-format mp3 --yes-playlist https://www.youtube.com/playlist


Magic SysRq key

Riavvio forzato Linux: Alt + PrtScr(SysRq) + REISUB

Spegnimento forzato Linux: Alt + PrtScr(SysRq) + REISUO


DISM

dism /online /cleanup-image /restorehealth


Comandi tar per cassette LTO

Lista file: tar -b 512 -tvf /dev/stX

Scrivi: tar -b 512 -cvf /dev/stX [filename]

Leggi: tar -b 512 -xvf /dev/stX [filename]


Clone disco con dd:

dd if=/dev/sdX of=/dev/sdX bs=512 status=progress conv=noerror,sync iflag=fullblock


Comandi NTP Windows

netdom query fsmo --- Verifica qual è il PDC e quindi anche il server NTP di riferimento per il dominio

w32tm /query /configuration --- Controllo configurazione servizio NTP

w32tm /query /status --- Verifica stato servizio NTP

w32tm /query /peers --- Verifica raggiungibilità dei server NTP configurati

w32tm /resync --- Sincronizza manualmente l'ora con il server NTP

Comando per impostare il client NTP sul Domain Controller

w32tm /config /manualpeerlist:"0.it.pool.ntp.org 1.it.pool.ntp.org 2.it.pool.ntp.org" /syncfromflags:manual /reliable:yes /update && net stop w32time && net start w32time && w32tm /resync

Comando per forzare un PC del dominio a sincronizzare l'ora con il Domain Controller

w32tm /config /syncfromflags:domhier /reliable:no /update && net stop w32time && net start w32time && w32tm /resync