Skip to content

Instantly share code, notes, and snippets.

View quantumJLBass's full-sized avatar

Quantum quantumJLBass

View GitHub Profile
@quantumJLBass
quantumJLBass / logbackup-oneliner.ps1
Created December 19, 2023 07:50
powershell system auditing bk, self zipping and logs it's self too
& { param($excludeLogs) $d = Get-Date -Format "yyyy-MM-dd-HH-mm"; $zipPath = "D:\_audit\logs\Foo-$d.zip"; $errorLog = "D:\_audit\logs\ErrorLog-$d.txt"; $logDir = "D:\_audit\logs\Foo-$d"; $null = New-Item -ItemType Directory -Force -Path $logDir; $counter = 0; $total = (wevtutil.exe el).Count; wevtutil.exe el | ForEach-Object { $counter++; if ($Host.UI.RawUI) { Write-Progress -Activity "Processing Event Logs" -Status "$_ Processing" -PercentComplete (($counter / $total) * 100); } $time = Measure-Command { if ($_ -notin $excludeLogs) { try { $log = Get-WinEvent -LogName $_ -MaxEvents 1 -Oldest -ErrorAction SilentlyContinue; } catch { $_ >> $errorLog; continue } if ($log) { $logPath = "$logDir\$d-$($_.Replace('/', '-'))-bk.evtx"; Remove-Item -Path $logPath -ErrorAction SilentlyContinue; try { $exportResult = wevtutil.exe epl "$_" $logPath 2>&1; if ($LASTEXITCODE -eq 0) { try { Compress-Archive -Path $logPath -DestinationPath $zipPath -Update -CompressionLevel Optimal; } catch { $_ >> $errorLog; continue }; try
@quantumJLBass
quantumJLBass / gitreplace <file_path>
Created January 7, 2024 06:31
quick chat code - p1
![User](https://s.gravatar.com/avatar/79f1f829fd9bc1b63c4c2555d503c4f6?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fqu.png)
You
how to make a command to run from a windows terminal with powershell core 7.x so that I can do \`gitreplace <file\_path>\` and it have it go to the file and ultimately be running something like \` curl -L -o "ROADMAP.md" "https://raw.githubusercontent.com/{user}/{repo}/{branch}/ROADMAP.md"\` where the values for \`{user}\` and so on, are discern from git or the folders and file directly around the file(ie: the repo the file belongs to). I am surprised this is not already baked in .. is there an already done solution out there ? other ways please proceed
ChatGPT
ChatGPT
@quantumJLBass
quantumJLBass / contacted_bcc_email_001.csv
Last active March 16, 2024 03:28
contactlist_embeded
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 3 columns, instead of 1 in line 1.
Contact point, Status, Email
jkuzik@cityoflewiston.org
jklone@cityoflewiston.org
ghill@cityoflewiston.org
MayorJohnson@cityoflewiston.org
invinfo@isp.idaho.gov
Richard.Adamson@isp.idaho.gov
regs@fdic.gov
asbpolicy@fdic.gov
ombudsman@fdic.gov
@quantumJLBass
quantumJLBass / Clueless, 1995
Last active September 10, 2024 21:59
SQL stuff
As if!