Skip to content

Instantly share code, notes, and snippets.

@gugod
gugod / Makefile
Created May 9, 2011 12:04
patchperl packed by fatpacker
all:
fatpack trace `which patchperl`
fatpack packlists-for `cat fatpacker.trace` >packlists
fatpack tree `cat packlists`
(echo "#!/usr/bin/env perl"; fatpack file; cat `which patchperl`) > patchperl
chmod +x patchperl
// =========================
// Example 1: using a @mixin
// =========================
// SCSS:
@mixin a_pink_box() {
float: left;
display: block;
color: pink;
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "kraihlight"
@aero
aero / demacboogi.pl
Created July 25, 2011 07:44
Rename MacOS X NFD hangule to NFC
#!/usr/bin/env perl
# 사용법
# perl demacboogi.pl *.zip #zip파일만 변환
# perl demacboogi.pl #모든파일 변환
use 5.010;
use strict;
use warnings;
use Encode qw/encode decode/;
use Unicode::Normalize qw/compose/;
use File::Copy;
@napcs
napcs / .tmux.clipboard
Created August 15, 2011 19:28
My tmux config
# configuration for osx clipboard support
set-option -g default-command "reattach-to-user-namespace -l sh"
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@aero
aero / remote_exe.vbs
Created September 29, 2011 08:20
Create process via Windows WMI
'How to use -> cscript remote_exe.vbs hostname "cmd /c dir"
strComputer = Wscript.Arguments(0)
strCommand = Wscript.Arguments(1)
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
errReturn = objWMIService.Create( strCommand , Null, Null, intProcessID )
Select Case errReturn
Case 0 WScript.Echo "Command successfully completed " & "Process ID: " & intProcessID
Case 2 WScript.Echo "Access Denied"
Case 3 WScript.Echo "INsufficient Privilege"
@aero
aero / remote_exe.pl
Created September 29, 2011 08:21
Create process via Windows WMI
#!/usr/bin/env perl
#How to use -> perl remote_exe.pl hostname "cmd /c dir"
use 5.010;
use strict;
use warnings;
use Win32::OLE;
use Win32::OLE::Variant;
my ($strComputer, $strCommand) = @ARGV;
my $objWMIService = Win32::OLE->GetObject("winmgmts:{impersonationLevel=impersonate,(security)}//$strComputer\\root\\cimv2:Win32_Process");
@aero
aero / remote_wmi.pl
Created October 4, 2011 05:40
Query remote serverinfo via Windows WMI
#!/usr/bin/env perl
#How to use
#> perl remote_wmi.pl hostname Win32_ComputerSystem
#> perl remote_wmi.pl hostname Win32_PerfFormattedData_PerfOS_System | findstr SystemUpTime
# Here's a list of a few Helpful classes to get you started.
# http://msdn.microsoft.com/en-us/library/windows/desktop/aa394084%28v=vs.85%29.aspx
# Win32_ComputerSystem
# Win32_Processor
# Win32_TimeZone
# ...
#!/usr/bin/env perl
use strict;
use warnings;
use Pod::Usage;
use Getopt::Long;
use File::Slurp 'slurp';
my %options;
GetOptions(\%options, "--show", "--help");