Posted in Sigurnost UltraPametno

Kako opremom od $30 razjebat multinacionalne multimilijardske pizdarije zvane “Security”

https://www.wired.com/story/poland-train-radio-stop-attack/  

Posted in Powershell

Powershell – ANSI kodovi

"$($PSStyle.Background.Blue)$($PSStyle.Foreground.White) Jednostavno $($PSStyle.Reset)" https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_ansi_terminals?view=powershell-7.3 powershell pwsh posh ansi codes colors reset terminal xpowershell xpwsh xposh xansi xcodes xcolors xreset xterminal

Posted in Powershell

Powershell – Nasumične poruke pogreške

I powershell, kao i mnogi drugi programi, trpi od neznanja i/ili lijenosti programera i/ili developera te lakomosti korporacije-proizvođača. Stoga ni oni nisu posvetili mnogo pozornosti…

Posted in CLI Powershell

Powershell – Prikaz brojeva

powershell.ps1 Provjeri svoju kulturnost: [System.Globalization.CultureInfo]::CurrentCulture. Za donje primjere ti treba “hr-HR“, a vjerujem da i ostale Balkanske prčije daju isti rezultat. Ta pogledajmo koliko razreda…

Posted in Powershell

Powershell – Debug/trace

powershell.ps1 Dodaj u skriptu ili CLI jedno od dva: Set-PSDebug -Trace 1 Set-PSDebug -Trace 2 Poništi s Set-PSDebug -Off https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/set-psdebug?view=powershell-7.3 pwsh posh powershell debug trace script…

Posted in CLI Powershell

Powershell – Komandnolinijski parametri – Elegantna verzija

powershell.ps1 Ako imaš parametre – okej, ako nemaš – traži da upišeš tamo gdje je “mandatory”. Važno: ovo moraju biti prve linije u skripti, na…

Posted in Hardware

Registry i ini zapisi o USB uređajima

HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2 HKLM\SYSTEM\CurrentControlSet\Enum\USB HKLM\SYSTEM\CurrentControlSet\Enum\USBSTOR HKLM\SYSTEM\MountedDevices https://www.nirsoft.net/utils/usb_drive_log.html https://www.nirsoft.net/utils/usb_devices_view.html  

Posted in UltraPametno

“My name is Peder.. Develo Peder”

—o—

Posted in Powershell

Powershell – GUI input

$unos = [Microsoft.VisualBasic.Interaction]::InputBox("Opis šta se treba raditi blabla", "Naslov") hxxps://stackoverflow.com/questions/30534273/simple-inputbox-function  

Posted in Powershell

Powershell – CSV – Uzmi vrijednost određenog polja

podaci.csv Nema headera Jedan;111 Dva;222 Tri;333 poweshell.ps1 Učitaj $ceesve = Import-Csv "podaci.csv" -Delimiter ";" -Encoding "UTF8" -Header "Naziv","Vrijednost" Prikaži jedan podatak Write-Host ($ceesve | Where-Object…

Posted in Powershell Python

Varijabla – Je li “prazna”?

powershell.ps1 IF ($Varijabla.Length -eq 0) {Write-Host "Prazno"} python.py try: varijabla except: print("Prazno") varijabla xvarijabla prazna xprazna variable xvariable empty xempty check xcheck provjeri xprovjeri

Posted in Python

Python – Integer – Dolar EUR – Točka za tisućice – Poravnaj udesno

python.py import locale OperatingCashFlow = 1234567890123.45 width = 35 locale.setlocale(locale.LC_ALL, "hr-HR") print ("hr-HR") print ( locale.format_string( "%.2f", OperatingCashFlow, grouping=True ) . rjust ( width )…

Posted in Python

Python – Varijable operacijskog sustava

python.py import os TempFolder = os.environ[‘TMP’]) python os xos environment xenvironment system xsystem user xuser variables xvariables

Posted in Powershell

Powershell – Koji je dan u tjednu bio na dan yyyy-mm-gg

(Get-Date -Year 2022 -Month 01 -Day 01).DayOfWeek powershell xpowershell posh xposh pwsh xpwsh dayofweek xdayofweek danutjednu xdanutjednu dow xdow dut xdut find xfind calculate xcalculate

Posted in Excel Powershell

Powershell – Excel – Error OperationStopped 0x800A03EC 800A03EC x800A03EC

Koristiš Powershell ter umećeš fomulu u Excel datoteku. Kao i svaki normalan čovjek koji koristi HR postavke, delimiter ti je “;“. powershell.ps1 $plahtica.Cells.Item($row,$column).Formula = "=sum(A1;A2)"…

Posted in Windows

Windows 11 – Ukloni ikonu “Chat” iz Taskbara

Windows 11 Windows11 Win11 W11 chat icon ikona remove from taskbar x11 xWindows11 xWin11 xW11 xchat xicon xikona xremove xtaskbar

Posted in SysAdmin

Windows 11 – Dodaj korisnika u “Administrators” – Fakof! Modul ne prepoznaje Windows PIN, a točan je

Odnosi se vjerojatno na sve administrativne radnje, a ne samo na dodavanje korisnika u lokalne grupe. Problem Hoćeš dodati novog korisnika u neku Windows grupu….

Posted in Outlook SysAdmin

Outlook – Dark mode – Immersive reader

Ako prebaciš Outlook u “Black”, ali ti i dalje ne pokazuje ikonicu “Immersive reader” ili “Switch background / Dark mode”, pa je sve black osim…

Posted in Backup SysAdmin Windows

Kreiraj SystemRestorePoint

Ručno Start >> Run >> SystemPropertiesProtection >> pa slijedi upute batch.cmd Koristi se powershell 5 powershell -version 5 -command "Checkpoint-Computer -Description (Get-Date -UFormat %Y%m%d) -RestorePointType…

Posted in Backup SysAdmin Windows

Backup Registryja ERUNT-om

ERUNT https://www.bleepingcomputer.com/download/erunt/dl/96/ batch.cmd Koristi se Powershell 5 @echo off powershell -version 5 -command "c:\Progra~2\ERUNT\ERUNT.EXE D:\Backup\ERUNT\$(Get-Date -UFormat %Y-%m-%d) sysreg curuser otherusers" Upute Ako ti se sruše…