Skip to content

Instantly share code, notes, and snippets.

View Silenoid's full-sized avatar
🪐
The future is not like it used to be

Silenoid Silenoid

🪐
The future is not like it used to be
  • Swisscom
  • Netherlands, Rotterdam
View GitHub Profile
@Silenoid
Silenoid / MegaCMD-Linux-installation-and-setup.md
Last active December 29, 2025 21:19 — forked from iamnimnul/README.md
Install mega-cmd on Linux and making mega-cmd-server service running by itself

Install megacmd-bin from AUR.

Use the mega-cmd functions to login, sync stuff. Every time you'll run it, the mega-cmd-server will be started, but also stopped when exiting the mega-cmd console, not synching in background. In order to do that, make the mega-cmd-server command as a systemd service:

# Create the service file (see mega.service) and update "User=<your own user>"
sudo nano /etc/systemd/system/mega.service
sudo chmod 644 /etc/systemd/system/mega.service
sudo systemctl daemon-reload
sudo systemctl enable mega
@Silenoid
Silenoid / FixAudioFrequenciesForL4DModAudioFiles.ps1
Created May 6, 2023 20:52
A Powershell script that uses SoX and fixes the sample rate of the audio files in input to a different one so that the mod won't crash during the compilation od the sound cache
# Loop through each .wav file in the current directory
Get-ChildItem -Path . -Filter *.wav | ForEach-Object {
# Call sox and trim only the "Sample rate" line. From that line, then, trim the word "Sample rate"
$sampleRate = [Int32](
sox --i $_
| Select-Object -Last 7
| Select-String -Pattern "Sample rate.*" -AllMatches
| ForEach-Object { $_.Matches }
| ForEach-Object { $_.Value }
@Silenoid
Silenoid / NormalizeAudio.ps1
Created April 21, 2023 13:44
A Powershell script to normalize audio in bulk using SoX
# Loop through each .wav file in the current directory
$inputFiles = Get-ChildItem -Path . -Filter *.wav
$inputFiles | ForEach-Object -Parallel {
$newFilename = $_.BaseName + ".wav"
Write-Output ("Processing $newFilename")
$outputFile = Join-Path $_.DirectoryName "converted" $newFilename
# If the "converted" directory doesn't exists, create it
if (!(Test-Path "converted")) {