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" | |
} |
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
lgtv --name MyTV --ssl startApp com.webos.app.homeconnect && sleep 4 && \ | |
lgtv --name MyTV --ssl sendButton up up right enter && sleep 2 && \ | |
lgtv --name MyTV --ssl sendButton enter && sleep 2 && \ | |
lgtv --name MyTV --ssl sendButton down down down left enter && sleep 2 && \ # number of `down`s here depends on the input ID; in this case I'm configuring HDMI 3 | |
lgtv --name MyTV --ssl sendButton down down down down down down down down down enter && sleep 2 && \ | |
lgtv --name MyTV --ssl sendButton up up up right enter && sleep 2 && \ # as noted above, number of `up`s here depends on input ID | |
lgtv --name MyTV --ssl sendButton exit |
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
find . -type d -name $dir -prune -o -name '$file' -execdir pwd \; | |
# Example: find . -type d -name node_modules -prune -o -name 'package.json' -execdir npm install \; |
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
local lgtv_path = "~/opt/lgtv/bin/lgtv" -- Full path to lgtv executable | |
local tv_name = "MyTV" -- Name of your TV, set when you run `lgtv auth` | |
local lgtv_cmd = lgtv_path.." --name "..tv_name | |
local my_input = "HDMI_3" | |
local other_input = "HDMI_4" | |
function get_command(command) | |
command = lgtv_cmd.. " " ..command.. " --ssl" | |
return command |
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 | |
#HotIf GetKeyState("CapsLock") | |
{ | |
1:: | |
{ | |
RunWait "lgtv --name MyTV --ssl setInput HDMI_3", , "Hide" | |
ToggleCapsLock() | |
} |
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 | |
Volume_Up:: | |
{ | |
audio_device := SoundGetName() | |
If InStr(audio_device, "LG TV SSCR2") | |
Run "lgtv --name MyTV --ssl volumeUp", , "Hide" | |
Else |
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
Get-NetFirewallRule | where { $_.Name -Like "*.exe" -and -not(Test-Path -Path $_.Name.Split('}')[1]) } |
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
# get processes by memory usage on busybox | |
ps | tail -n +2 | awk 'BEGIN {OFS="\t"}; { s = ""; for (i = 5; i <= NF; i++) s = s $i " "; print $3, s }' | sort -rnk 1 |
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
#!/bin/sh | |
# | |
#.Distributed under the terms of the GNU General Public License (GPL) version 2.0 | |
# | |
# script for sending updates to cloudflare.com | |
#.based on Ben Kulbertis cloudflare-update-record.sh found at http://gist.github.com/benkulbertis | |
#.and on George Johnson's cf-ddns.sh found at https://github.com/gstuartj/cf-ddns.sh | |
#.2016-2017 Christian Schoenebeck <christian dot schoenebeck at gmail dot com> | |
# CloudFlare API documentation at https://api.cloudflare.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
choco outdated -r | ConvertFrom-Csv -Delimiter '|' -Header 'Package name', 'Current version', 'Available version', 'Pinned?' | Format-Table |
NewerOlder