Skip to content

Instantly share code, notes, and snippets.

View johngh's full-sized avatar
🏝️
Looking forward to enjoying time on Aotea

John Harrison johngh

🏝️
Looking forward to enjoying time on Aotea
View GitHub Profile
@johngh
johngh / putty_sessions.vbs
Created December 14, 2012 18:29
VBS script to launch a list of putty sessions (called by their saved session name in PuTTY)
Set objShell = CreateObject("WScript.Shell")
dim hosts
hosts = "host1 host2 host3 host4 host5 host6"
dim host
for each host in split(hosts)
objShell.Exec "C:\Program Files\PuTTY\PUTTY.EXE -load " + host
next
@johngh
johngh / putty_hosts.vbs
Created December 14, 2012 19:56
VBS script to launch a list of SSH sessions to user@host[1-6]
Set objShell = CreateObject("WScript.Shell")
dim user
user = "john"
dim hosts
hosts = "host1 host2 host3 host4 host5 host6"
dim host
for each host in split(hosts)
@johngh
johngh / SSH Links List
Last active December 10, 2015 06:08
I wrote this to make a list of ssh:// links to hosts found in the webpage.
@johngh
johngh / Context SSH Links
Created December 27, 2012 22:32
Add ssh:// (and rdp://) URLs after recognised hostnames found in web pages.
;; 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" )
{
@johngh
johngh / MoveMsgToFolder.vba
Last active December 12, 2015 00:09
Outlook 2007 macro to move the currently focussed open message to a pre-defined folder. I assigned this macro to a button on the Quick Access Toolbar.
Sub MoveMsgToFolder()
'Outlook VB Macro to move currently open mail item to a target folder
On Error Resume Next
Dim ns As Outlook.NameSpace
Dim moveToFolder As Outlook.MAPIFolder
Dim myItem As Outlook.MailItem
@johngh
johngh / MoveMsgToFolder.ahk
Created January 31, 2013 11:11
AutoHotkey macro to bind Alt-J to Alt-6 to run Outlook macro in message window.
!j::
WinGet, Active_ID, ID, A
WinGet, Active_Process, ProcessName, ahk_id %Active_ID%
if ( Active_Process ="OUTLOOK.EXE" )
{
; Match strings anywhere in the window title
SetTitleMatchMode, 2
numericPrefix = 1
ctrlXPrefix = 0
@johngh
johngh / transpose-table
Created February 10, 2013 03:28
Transpose an HTML table
#!/usr/bin/perl
#
#
#
use warnings;
use strict;
use HTML::TreeBuilder;
my $tree = HTML::TreeBuilder->new_from_file(shift);
@johngh
johngh / add_wrapper.ahk
Last active December 15, 2015 00:08
Press <Windows+N> to add JIRA "{noformat}" tags around the selected text, or by themselves if no text is selected.
$#N::
;; insert {noformat} tags
cb_tmp := SelectedViaClipboard()
StringReplace cb_tmp, cb_tmp, `n,, All
if ( cb_tmp ) {
SendInput {{}noformat{}}`n%cb_tmp%{{}noformat{}}`n
}
else
{
@johngh
johngh / .Xresources
Created April 22, 2014 23:32
Configure your xterm colours
!
! For all [xa]term,put this in your
! ~/.Xdefaults or ~/.Xresources:
!
! Defaults for all xterm clients
XTerm*background: black
XTerm*foreground: gray
! XTerm*highlightColor: white
! XTerm*highlightTextColor: black