This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nslookup myip.opendns.com resolver1.opendns.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wslAddress = wsl ip -4 a show eth0 | wsl grep -Po 'inet \K[0-9.]*' | |
# This assumes you only have one interface containing 'WSL' in its name | |
$ifId = (Get-NetIPInterface -InterfaceAlias "*WSL*" -AddressFamily IPv4).ifIndex | |
route add -p $wslAddress mask 255.255.255.255 $wslAddress metric 256 if $ifId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$repo = $args[0]; | |
$outdir = $args[1] | |
$release = (curl -s https://api.github.com/repos/scito/extract_otp_secrets/releases/latest | ConvertFrom-Json).assets | where { $_.name -like "*.msi" -or $_.name -like "*.exe" } | |
# TODO: check there's only one item | |
$outFile = "$outdir\$($release.name)"; | |
curl -L $release.browser_download_url --output $outFile; | |
& $outFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires AutoHotkey v2.0 | |
#SingleInstance | |
Run "powershell -NoExit C:\Users\Ammaar.Limbada\Register-KvmEvents.ps1", , "Hide" | |
Persistent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use Get-PnpDevice with no parameters to get the name of the device | |
Get-PnpDevice -FriendlyName "AMD Radeon RX 6700" | Disable-PnpDevice -Confirm:$false ; Sleep -Seconds 5; Get-PnpDevice -FriendlyName "AMD Radeon RX 6700" | Enable-PnpDevice -Confirm:$false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Register-WmiEvent -Query "SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'win32_PNPEntity' AND TargetInstance.DeviceID like 'USB\\VID_045B&PID_0209%'" -SourceIdentifier KVMConnected -Action { lgtv --name MyTV --ssl setInput HDMI_4 } | |
Register-WmiEvent -Query "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA 'win32_PNPEntity' AND TargetInstance.DeviceID like 'USB\\VID_045B&PID_0209%'" -SourceIdentifier KVMDisonnected -Action { lgtv --name MyTV --ssl setInput HDMI_3 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"[feature]": { | |
"editor.defaultFormatter": "alexkrechik.cucumberautocomplete" | |
}, | |
"[java]": { | |
"editor.foldingImportsByDefault": true, | |
"editor.suggest.snippetsPreventQuickSuggestions": true | |
}, | |
"[javascript]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your key bindings in this file to override the defaultsauto[] | |
[ | |
// CamelHumps words | |
{ | |
"key": "ctrl+left", | |
"command": "cursorWordPartLeft", | |
"when": "textInputFocus" | |
}, | |
{ | |
"key": "ctrl+shift+left", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cleanUpGmail() { | |
var queries = [ | |
'from:(noreply@steampowered.com) in:inbox subject:(from your Steam wishlist on sale) older_than:7d', | |
'from:(no-reply@twitch.tv) in:inbox subject:(is live) older_than:1d', | |
'from:ebay.com subject:("is live!" OR "has been relisted") older_than:7d', | |
// Security alerts | |
'from:(no-reply@accounts.google.com) in:inbox subject:("Security alert" OR "New sign-in from") older_than:1m', | |
// 2FA | |
'from:(no-reply@email.gog.com) in:inbox older_than:1d subject:("two-step authentication" )' | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$videoFileBaseNames = ls *.mkv | % { $_.BaseName } # adjust file as necessary | |
foreach ($baseName in $videoFileBaseNames) | |
{ | |
$episode = $baseName.Split()[3] # adjust parsing of episode as necessary | |
$subfile = (ls *$episode*.srt)[0] | |
mv "$subfile" "$baseName.srt" | |
} |
NewerOlder