Skip to content

Instantly share code, notes, and snippets.

View Axlfc's full-sized avatar
🛸
Working from outer space

Axel Axlfc

🛸
Working from outer space
View GitHub Profile
@Axlfc
Axlfc / convert_aac_to_wav.bat
Created December 18, 2024 14:57
Use ffmpeg to convert .aac to .wav from a folder
@echo off
setlocal enabledelayedexpansion
set "source_folder=C:\Users\AxelFC\Music\Recordings"
set "ffmpeg_path=C:\ffmpeg\bin\ffmpeg.exe"
for /R "%source_folder%" %%A in (*.aac) do (
set "filename=%%~nA"
set "file_without_extension=!filename:.aac=!"
"%ffmpeg_path%" -i "%%A" "%source_folder%\!file_without_extension!.wav"
param (
# Define a parameter for the folder path
[Parameter(Mandatory=$true)]
[string]$folderPath
)
try {
# Verify the path exists
if (-Not (Test-Path $folderPath)) {
Write-Error "The provided path does not exist or is not accessible. Please provide a valid path."
function Get-WifiMacAddress {
try {
# Get network adapters
$adapters = Get-NetAdapter | Where-Object { $_.InterfaceDescription -like '*Wi-Fi*' }
if ($adapters.Count -eq 0) {
Write-Error "No Wi-Fi adapter found."
return $null
}
function Get-WifiIPAddress {
try {
# Get network adapters with Wi-Fi in their description
$adapters = Get-NetAdapter | Where-Object { $_.InterfaceDescription -like '*Wi-Fi*' }
if ($adapters.Count -eq 0) {
Write-Error "No Wi-Fi adapter found."
return $null
}
function Get-ComputerModelAndManufacturerFolderName {
try {
$csModel = (Get-ComputerInfo).CsModel
$csManufacturer = (Get-ComputerInfo).CsManufacturer
$folderName = $csManufacturer + " " + $csModel
return $folderName
} catch {
Write-Error "Failed to retrieve computer model and manufacturer information."
}
}
function Get-EthernetMacAddress {
try {
# Get network adapters
$adapters = Get-NetAdapter | Where-Object { $_.InterfaceDescription -like '*Ethernet*' }
if ($adapters.Count -eq 0) {
Write-Error "No Ethernet adapter found."
return $null
}
function Get-EthernetIPAddress {
try {
# Get network adapters with Ethernet in their description
$adapters = Get-NetAdapter | Where-Object { $_.InterfaceDescription -like '*Ethernet*' }
if ($adapters.Count -eq 0) {
Write-Error "No Ethernet adapter found."
return $null
}
function Get-ComputerSerialNumber {
try {
$SerialNumber = (Get-WmiObject -class win32_bios).SerialNumber
return $SerialNumber
} catch {
Write-Error "Failed to retrieve computer model and manufacturer information."
}
}
Get-ComputerSerialNumber
function Check-DefaultBrowser {
$currentBrowserProgId = (Get-ItemProperty 'HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice').ProgId
return -not ($currentBrowserProgId -like "FirefoxURL-*")
}
function Check-DefaultPDFApplication {
$User = New-Object System.Security.Principal.NTAccount($env:UserName)
$sid = $User.Translate([System.Security.Principal.SecurityIdentifier]).value
$key = "HKU:\${sid}\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice"
@Axlfc
Axlfc / gist:168b24c3928ba8521772d8ed510a5620
Created December 15, 2023 17:14
Github Markdown Annotations
> [!NOTE]
> Highlights information that users should take into account, even when skimming.
> [!TIP]
> Optional information to help a user be more successful.
> [!IMPORTANT]
> Crucial information necessary for users to succeed.
> [!WARNING]