Skip to content

Instantly share code, notes, and snippets.

@askvictor
askvictor / gist:44a89af135fb245b7e1d
Created June 2, 2014 02:39
Messy hack for Plugin.pm in squeezebox youtube plugin to deal with full youtube URLs
(my $x1, my $x2, my $x3, my $x4, my $x5) = ($args->{'search'} =~ /(youtu be\/|youtube com\/(watch\?(.*&)?v=|(embed|v)\/))([^\?&"'>]+)/);
if ($x5) {
$url = 'youtube://' . $x5;
}
@askvictor
askvictor / PapercutCheck.vbs
Created July 22, 2013 00:02
Due to the Papercut client crashing on some network conditions, the script can be triggered off Windows event ID 10000 to check if the client is connected to the work network. If so, and the papercut client isn't running, this will re-launch it.
'Trigger off event ID 10000 (Network Connected) to check if we're on the papercut network, and if
'PaperCut client is running. If it's not, try to start it.
strSearchSuffix = "REPLACE_WITH_DOMAIN_SUFFIX_TO_CHECK"
strFindProcessName = "pc-client.exe"
wscript.sleep 5000 'sleep 5 seconds to allow network to configure
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set objShell = CreateObject("WScript.Shell")