Skip to content

Instantly share code, notes, and snippets.

View asgaut's full-sized avatar

Asgaut Eng asgaut

View GitHub Profile
@asgaut
asgaut / DriverHelper.ps1
Last active June 5, 2024 11:11 — forked from jdoubleu/DriverHelper.ps1
Windows RNDIS driver for Linux/RaspberryPi
# script parameters
param(
[ValidateSet("Sign", "UntrustCertificates")]
[string] $Mode = "Sign",
[string] $InfFile,
[string] $CommonName = "linux.local",
[switch] $Force
)
@asgaut
asgaut / .remove-win-paths.sh
Created April 3, 2022 09:48
Shell script for removing Windows paths from WSL Linux $PATH variable
# Shell script for removing Windows paths from WSL Linux $PATH variable
# Save the script in the $HOME directory and run with
# . $HOME/.remove-win-paths.sh
# or create an alias:
# alias rwp='source $HOME/.remove-win-paths.sh'
PATH=$(grep -v '^/mnt/c/'<<<"${PATH//:/$'\n'}"|paste -sd:)
@asgaut
asgaut / Microsoft.PowerShell_profile.ps1
Last active July 9, 2025 08:39
My powershell startup script + Oh-my-posh config
# Oh-my-posh fancy command prompt
# ===============================
# Documentation: https://ohmyposh.dev/
# First run:
# winget install JanDeDobbeleer.OhMyPosh -s winget
& ([ScriptBlock]::Create((oh-my-posh init pwsh --config "$HOME\posh-theme.omp.json" --print) -join "`n"))
# Git autocompletion
@asgaut
asgaut / settings.json
Created January 6, 2021 08:54
JSON snipped for Miniconda in Windows Terminal
{
// Miniconda Powershell prompt for local user install (non-admin install)
"guid": "{1caa0dad-35be-5f56-a812-afceeeaa1234}",
"name": "Miniconda",
"commandline": "%windir%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy ByPass -NoExit -Command \"& '%USERPROFILE%\\Miniconda3\\shell\\condabin\\conda-hook.ps1' ; conda activate '%USERPROFILE%\\Miniconda3' \"",
"icon": "%USERPROFILE%\\Miniconda3\\Menu\\Iconleak-Atrous-PSConsole.ico",
"hidden": false,
"startingDirectory": "%HOMEPATH%"
}
@asgaut
asgaut / checkpath.ps1
Created April 14, 2020 12:43
Check user and system path variables for duplicate entries
# Run with administrator privileges
$RegKey = ([Microsoft.Win32.Registry]::CurrentUser).OpenSubKey("Environment", $True)
$PathValue = $RegKey.GetValue("Path", $Null, "DoNotExpandEnvironmentNames")
$RegKey.Close()
$UserPathValues = $PathValue.Split(";", [System.StringSplitOptions]::RemoveEmptyEntries)
Write-host "Current User path:`n " ($UserPathValues -join "`n ")
$RegKey = ([Microsoft.Win32.Registry]::LocalMachine).OpenSubKey("SYSTEM\CurrentControlSet\Control\Session Manager\Environment", $True)
$PathValue = $RegKey.GetValue("Path", $Null, "DoNotExpandEnvironmentNames")
@asgaut
asgaut / demod-ils.py
Last active February 27, 2024 10:09
Plot DDM, SDM and RF of ILS signal logged with RTL-SDR during ground crossover in front of runway
# Plot DDM, SDM and RF of an ILS IF-signal (saved as wav file by SDR#)
# Bandwidth = 32 kHz when input sample rate = 2.048 MHz (decimated by 64)
# Asgaut Eng/2016-10-03
import numpy as np
import scipy.io.wavfile as wav
import scipy.signal as signal
from scipy.fftpack import fft, fftfreq, fftshift
import matplotlib.pyplot as plt
@asgaut
asgaut / spectrum.py
Created October 2, 2016 21:09
Convert IQ samples in wav file to array of complex numbers and plot spectrum as function of time
# Plot spectrum of wav file saved by SDR# as function of time (3D plot)
# Bandwidth = 32 kHz when input sample rate = 2.048 MHz (decimated by 64)
# Asgaut Eng/2016-10-02
import numpy as np
import scipy.io.wavfile as wav
import scipy.signal as signal
from scipy.fftpack import fft, fftfreq, fftshift
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D