Skip to content

Instantly share code, notes, and snippets.

View fiddyschmitt's full-sized avatar

Fidel Perez-Smith fiddyschmitt

  • Brisbane, Australia
View GitHub Profile
@fiddyschmitt
fiddyschmitt / ddrescue.txt
Created November 30, 2022 00:53
ddrescue
ddrescue /dev/sda sda.img sda.img.log
--interpret ddrescue log
ddrescuelog --show-status sda.img.log
@fiddyschmitt
fiddyschmitt / compile cs to exe.txt
Created November 18, 2022 03:04
compile cs to exe
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" helloworld.cs
The following settings appear to result in a file that's not corrupted when the user logs off or shuts down without first stopping the OBS recording.
Recording Format: MP4
Custom Muxer Settings: movflags=frag_keyframe min_frag_duration=1000000
ddrescue
2024
Windows File Recovery (by Microsoft)
Autopsy
https://www.autopsy.com/
R-Studio Technician
@fiddyschmitt
fiddyschmitt / stop_obs_recording.ps1
Last active November 1, 2022 02:47
Send hotkey using powershell
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
# For some reason, the hotkey has to be sent multiple times
for ($i = 0; $i -lt 10; $i++)
{
#Ctrl + Alt + Shift + s
[System.Windows.Forms.SendKeys]::SendWait("^%+s")
}
@fiddyschmitt
fiddyschmitt / run_command.bat
Created October 14, 2022 04:04
Run command through git bash
"C:\Users\fidel\AppData\Local\Programs\Git\git-bash.exe" -c "cd 'C:\scripts'; ./sort_files.sh"
@fiddyschmitt
fiddyschmitt / Using netapi32.dll
Last active October 14, 2022 00:20
Get list of shares
http://www.pinvoke.net/default.aspx/netapi32/netshareenum.html
public class GetNetShares
{
#region External Calls
[DllImport("Netapi32.dll", SetLastError = true)]
static extern int NetApiBufferFree(IntPtr Buffer);
[DllImport("Netapi32.dll", CharSet = CharSet.Unicode)]
private static extern int NetShareEnum(
StringBuilder ServerName,
--Filename, size, creation date, last modification date,
find "`pwd -P`" 2>/dev/null -printf "%p|%s|%B@|%T@|%y\n"
--printf descriptions
https://www.gnu.org/software/findutils/manual/html_mono/find.html#Time-Formats
https://www.codedodle.com/find-printf.html
--hashes
find -type f -exec sha256sum "{}" + | tee hashes-sha256.txt
@fiddyschmitt
fiddyschmitt / gist:4aa1b69edb3f37171dfea78a51920e0f
Last active March 29, 2026 18:55
Make custom windows 10 iso using mkisofs
--extract the current iso
7z x en_windows_10_business_editions_version_20h2_updated_jan_2021_x64_dvd_533a330d.iso -oExtracted -r
--make changes
--repack the iso
https://unix.stackexchange.com/questions/531012/how-to-modify-an-installation-iso-and-keep-it-bootable
mkisofs --allow-limited-size -no-emul-boot -b "boot/etfsboot.com" -boot-load-seg 0 -boot-load-size 8 -eltorito-alt-boot -no-emul-boot -e "efi/microsoft/boot/efisys.bin" -boot-load-size 1 -iso-level 4 -udf -o "win.iso" "source/"
#!/bin/bash
#Ideally, we would download all specs at once using the following URL:
#https://bamboo-server/bamboo/rest/api/latest/project/GUCS/specs
#But it requires admin rights. So let's download them one by one.
#personal access token, created using the Bamboo web interface -> Profile
token="blah"
#curl -s -H "Authorization: Bearer ${token}" -H "Accept: application/json" https://bamboo-server/bamboo/rest/api/latest/search/plans?max-results=5000 | python -m json.tool > plans.json