- Enable IP forwarding
- Open regedit
- Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
- Change IPEnableRouter to 1
- Run services->Routing and Remote->start
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl6 | |
# see: | |
# * http://transfixedbutnotdead.com/2010/01/13/anyone_for_metaprogramming/ | |
# * http://transfixedbutnotdead.com/2010/01/14/anyone-for-perl-6-metaprogramming/ | |
# * http://fingernailsinoatmeal.com/post/292301859/metaprogramming-ruby-vs-javascript | |
# * http://transfixedbutnotdead.com/2010/10/31/perl6-metaprogramming-update/ | |
# below runs on Rakudo Star (2010.10 release). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# derived from http://h2np.net/tips/wiki/index.php?RubyOpenSSLDigitalSignatureSample | |
require 'openssl' | |
require 'base64' | |
include OpenSSL | |
group_name = 'secp521r1' | |
message = '10000 fartbux sent to bryce from a can of beans' | |
key = PKey::EC.new(group_name) | |
key = key.generate_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" | |
-- get current clipboard contents as a string | |
set CurrentClipboard to the clipboard as string | |
-- set the clipboad to your password | |
set the clipboard to "Y0urVPNPa$$w0rd" | |
-- start playing with the VPN | |
tell current location of network preferences | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Complete words from tmux pane(s) {{{1 | |
# Source: http://blog.plenz.com/2012-01/zsh-complete-words-from-tmux-pane.html | |
# Gist: https://gist.github.com/blueyed/6856354 | |
_tmux_pane_words() { | |
local expl | |
local -a w | |
if [[ -z "$TMUX_PANE" ]]; then | |
_message "not running inside tmux!" | |
return 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
Copy and paste this script into a new document in AppleScript Editor. | |
When saving, select "Script Bundle" as File Type. | |
Save the file to: "~/Library/Script Libraries/Access NSScreen.scptd" | |
Note: you may need to create the directory: "~/Library/Script Libraries" | |
Note: while this gist has the file ending "scpt", by selecting the | |
"Script Bundle" file type, the file extension "scptd" should be added. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- that is very similar to that of pandoc's HTML writer. | |
-- There is one new feature: code blocks marked with class 'dot' | |
-- are piped through graphviz and images are included in the HTML | |
-- output using 'data:' URLs. | |
-- | |
-- Invoke with: pandoc -t sample.lua | |
-- | |
-- Note: you need not have lua installed on your system to use this | |
-- custom writer. However, if you do have lua installed, you can | |
-- use it to test changes to the script. 'lua sample.lua' will |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
struct Point { | |
var x: Int = 200 | |
var y: Int! = 2 | |
var z: Int? = nil | |
} | |
class CPoint { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#coding=utf-8 | |
# | |
# Generate a list of dnsmasq rules with ipset for gfwlist | |
# | |
# Copyright (C) 2014 http://www.shuyz.com | |
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules | |
import urllib2 | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Please set your vpn connection name and password here | |
set VPNName to "VPN name" | |
set VPNpassword to "VPN password" | |
tell application "System Events" | |
tell current location of network preferences | |
set VPNService to service VPNName | |
end tell | |
set isConnected to connected of current configuration of VPNService |
OlderNewer