Skip to content

Instantly share code, notes, and snippets.

@PProvost
PProvost / gist:292357
Created February 2, 2010 04:19
How to tunnel through Putty with RDP
RDP Tunneling via Putty and SSH
1. Putty to the external address using ssh (e.g. yourmachine.dyndns.org)
2. Figure out the IP address of the machine inside your network that you want to connect to
e.g. 192.168.1.110
3. Open putty settings and add the following to the tunnels section
Source: 3333
Destination:192.168.1.110:3389
@PProvost
PProvost / flac2mp3.sh
Created November 28, 2009 21:39
Convert a FLAC to MP3
for file in *.flac; do flac -cd "$file" | lame -f –-preset extreme – "${file%.flac}.mp3"; done
@PProvost
PProvost / shn2mp3.sh
Created November 28, 2009 21:17
A little helper script for converting shn to mp3
# Source: http://adventuresinswitching.blogspot.com/2008/04/convert-shn-shorten-to-mp3-or-flac-in.html
# convert all shn files in the current directory to wav
shntool conv -o wav *.shn
# convert all wav files in the current directory to mp3
for file in *.wav; do $(lame -V2 "$file" "${file%.wav}.mp3"); done
# clean up the mess
rm *.wav
@PProvost
PProvost / gist:177790
Created August 30, 2009 00:20
Wow Lua - convert from itemLoc to bag,slot
-- The following will convert from itemloc to inventory slot or container bag,slot
local ITEM_INVENTORY_PLAYER = 0x00300000
local ITEM_INVENTORY_BAGS = 0x00200000
local MASK_BAG = 0xf00
local MASK_SLOT = 0x3f
local bagMap = {
[0x000] = 0,
[0x100] = 1,
[0x200] = 2,
@PProvost
PProvost / gist:166202
Created August 12, 2009 00:26
Tekkub's setmetatable localization trick
-- Declare this near the top of your addon
local L = setmetatable({}, {__index=function(t,i) return i end})
-- Then for english use the english statement in the usage, like this:
tooltip:SetText( L["Click here to see something"] )
-- Later when you want to add a locale, change the declaration of L to include the new language in the base table
local L = setmetatable(GetLocale() == "koKR" and {
["Click here to see something"] = "something in korean",
} or {}, {__index=function(t,i) return i end})
@PProvost
PProvost / gist:134076
Created June 22, 2009 17:02
Disable SMS Virus on Windows
To kill/disable/prevent SMS from getting on your system:
1. Stop the CcmExec CcmFramework services (check HKLM:\System\CurrentControlSet\Services)
2. Wait until they're all down and happy
3. Delete the following folders:
x86:
\Windows\System32\CCM
\Windows\System32\CCMSetup
@PProvost
PProvost / gist:123691
Created June 4, 2009 16:14
A little hack to acces DTE without having an IServiceProvider
global::EnvDTE.DTE dte = Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(global::EnvDTE.DTE)) as global::EnvDTE.DTE;
global::EnvDTE.ProjectItem item = dte.Solution.FindProjectItem(relativeToPathName);
global::EnvDTE.Project project = item.ContainingProject;
@PProvost
PProvost / RotateImage.ps1
Created May 13, 2009 17:23
PowerShell script for rotating a set of images.
ls *.png | % {
write-host "Rotating " + $_.Fullname;
$img = new-object system.drawing.bitmap $_.Fullname;
$img.RotateFlip("Rotate270FlipNone");
$img.Save($_.FullName)
}
@PProvost
PProvost / MyAddons.txt
Created May 5, 2009 16:37
My Warcraft addons list
Name
----
!BugGrabber
!Swatter
acb_Auras
acb_BattleGround
acb_CastBar
acb_Cooldowns
acb_FlightTimes
@PProvost
PProvost / gist:96272
Created April 16, 2009 06:43
To generate a not too insane changelog
# To generate a not too insane changelog
# If only I could figure out how to make it show tags too
git log --name-status --pretty=oneline --abbrev-commit
# Or a shorter one...
git log --pretty=oneline --abbrev-commit