Category: CLI
OCR .PDF datoteke
ocrmypdf -O 3 –tesseract-oem=3 –language=hrv –force-ocr –output-type pdf –sidecar OCR.txt inputFile.pdf temp.pdf Po završetku će datoteka “OCR.txt” imati tekst iz datoteke “inputFile.pdf”. Datoteka “temp.pdf” je…
PDF kontrast i to
magick convert -monitor -density 150 $inputFile -auto-level -gamma .4 -compress JPEG -quality 80 -adaptive-sharpen 2 -antialias -compress JPEG $outputFile https://imagemagick.org/ pdf xpdf jpg xjpg jpeg…
Powershell full history
type (Get-PSReadlineOption).HistorySavePath pwsh xpwsh xpowershell xhistory xfull sve xsve xall all xtotal total
choco install error “ERROR: The term ‘Get-AppInstallLocation’ is not recognized as the name of a cmdlet, function, script file, or operable program”
Pomakni folder C:\ProgramData\chocolatey\lib\chocolatey-core.extension.x.y.z\ u folder C:\TEMP\ U stvari nije bitno kamo, samo da nije tamo, a ne želim ti reči da obrišeš jer možda nešto…
Ubuntu upgrade fuckery
How to unfuck Problem grub-efi-amd64-signed : Depends: grub-efi-amd64-bin (= 2.06-2ubuntu7) but 2.06-2ubuntu10 is to be installed Rješenje sudo apt –only-upgrade install grub-efi-amd64-signed xapt xgrub
ExifTool
Jednostavan početak exiftool.exe -charset IPTC=UTF8 -charset filename=UTF8 -charset EXIF=UTF8 -charset ID3=UTF8 -keywords=’DatotekaProba123,DatumDatotetke=20201231′ -comment=’Proba123,šđč枊ĐČĆŽ’ -subject=’Proba123subjektum nestonesto’ -XMP:category=’Proba123,category,leKategorija’ …
Windows firewall i Powershell
New-NetFirewallRule -DisplayName "BlokirajOut443" -Direction outbound -Profile Any -Action Block -RemotePort 443,567-678 -Protocol TCP -Program C:\Windows\Notepad.exe Remove-NetFirewallRule -DisplayName "BlokirajOut443" pwsh ps xpwsh xps firewall xfirewall fw…
Nextcloud – Batch upload
Import iz commandlineta u NextCloud: curl -u <%USERNAME%>:<%LOZINKA%> -T X:\Proba123.pdf http://sljedecioblak.server.tld/remote.php/dav/files/datotetke/ xcurl xnextcloud upload batch cli commandline command line xcli xcommandline script xscript
Bjutifuliziran messages / system log
sudo apt install ccze -y tail /var/log/messages –sleep-interval=1 –follow | ccze -m ansi less messages syslog beautiful colors boje bojce nešto prekrasno xless xmessages xsyslog…
NCFTP (ncftpput, ncftpget, …)
https://www.ncftp.com/download/ ncftpput -F -u $ftpjuzerneijm -p $ftplozinka somware.org /folder_na_serveru/ datoteka_za_na_server.zip ftp xftp upload xupload ncftp xncftp
reg add
batch.bat reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts” /v nestonesto /t REG_DWORD /d 0 reg add regadd registry commandline cli command line xreg xadd xregadd xregistry xcommandline xcli…
Izmišljatelju lozinaka, izmisli mi lozinku
Generiraj alfanumaričku lozinku od 24 znaka bash.sh …(jednoga dana)… powershell.ps1 -join ((65..90) + (97..122) + (48..57)| Get-Random -Count 24 | ForEach-Object {[char]$_}) python.py …(jednoga dana,…
Kako izračunati CRC SHA
powershell.ps1 Get-FileHash -Path datoteka.zip # default=SHA256 Get-FileHash -Path datoteka.zip -Algorithm SHA1 batch.cmd certutil.exe -hashfile datoteka.zip SHA256 certutil.exe -hashfile datoteka.zip SHA1 bash.sh sha256sum datoteka.zip sha1sum…
Nadogradi chromedriver na najnajzadnjiju verziju
… @echo off curl http://chromedriver.storage.googleapis.com/LATEST_RELEASE > zz-chromedriver-LATEST_RELEASE set /p verzija=<zz-chromedriver-LATEST_RELEASE :: wget "https://chromedriver.storage.googleapis.com/96.0.4664.45/chromedriver_win32.zip" -O chromedriver_win32.zip echo wget "https://chromedriver.storage.googleapis.com/%verzija%/chromedriver_win32.zip" -O chromedriver_win32.zip wget "https://chromedriver.storage.googleapis.com/%verzija%/chromedriver_win32.zip" -O chromedriver_win32.zip unzip…
Postoji li datoteka ili ne, pitanje je tad
bash.sh if [ -f "datoteka.txt" ]; then echo "Postoji" ; fi if [ ! -f "datoteka.xyz" ]; then echo "Ne postoji"; fi batch.cmd if …
sed jednolinijaši
Pripazi da ti je editor u UTF8, da ti je konzola u UTF8, da ti je glava u UTF8 itd. Ako ijedno od toga nije…
OpenSSL – (de)šifriraj tekst
Šifriraj ..string echo LeTekst | openssl enc -e -aes-256-cbc -md sha512 -a -pbkdf2 -salt -pass pass:admin123 ..datoteku ‘original.txt’ openssl enc -e -in original.txt -out sifrirana.txt…
sendemail primjer
sendemail -f "posiljatelj@domena.tld" \ -t "primatelj@domena.tld" \ -u "[SWID#$(date +%Y%m%d%H%M)] Subjektum" \ -o message-file="datoteka_s_tekstom_poruke.txt" \ -s mailserver.domena.tld:26 \ -o username=posiljatelj@domena.tld \ -o password=admin123 \ -o…