Skip to content

Instantly share code, notes, and snippets.

@serf
serf / list_hosts.php
Created June 1, 2012 12:07
List all hosts in the date subdirectories of a directory.
<form>
<select name="hostname">
<option value="">- Select Host -</option>
<?php
$collector_dir = '/var/tmp/days';
$hosts = array_unique(explode("\n", shell_exec("/bin/ls $collector_dir/*")));
foreach ($hosts as $host) {
if ( strstr($host,"/") ) {
@serf
serf / PuTTY_Launcher.ahk
Created May 16, 2012 13:41
AutoHotkey Script: Launch PuTTY with Selected Text
;; Start SSH session using the currently selected text as the target hostname.
$#S::
; Putty copies selected text to the clipboard so you don't need to copy it
; doing Ctrl-Insert throws away what you already have in the Clipboard.
; Can't use Ctrl-C in putty, because it sends that to your session as ^C
WinGet, Active_ID, ID, A
WinGet, Active_Process, ProcessName, ahk_id %Active_ID%
if ( Active_Process ="putty.exe" )
{