Skip to content

Instantly share code, notes, and snippets.

View tekkub's full-sized avatar

Tekkub tekkub

View GitHub Profile

Create a tunnel to github with the git default daemon port like this:

$ ssh -L9418:github.com:9418 [email protected]

And clone repositories replacing github.com with localhost, like so:

$ git clone git://localhost/someuser/someproject.git

If you want to preserve the “correct” metadata, there are several options

Git has a config option called ‘core.gitproxy’ which allows you to use a command to tunnel the git:// protocol, which would normally go over TCP port 9418. So in my case, I’ve got a couple off-campus servers that I can use SSH tunnels with. I set up the typical SSH-based SOCKS proxy, thusly (you can also use apps like Shimo to manage tunnels for you):

$ ssh -D 1080 tycho@hostname

NOTE: If you are using ssh shared connection(controlmaster/controlpath), you will have to disable it(forwarding is not yet implemented in shared connection)

$ ssh -S "none" -D 1080 tycho@hostname

Then I use the tools which I’ve made available in this git repository to make cloning with the git:// protocol tunnel through SSH run transparently.

To use the tools, you need to first compile ‘connect.c’ and install the ‘connect’ binary to somewhere in your PATH (/usr/local/b

Create a tunnel to github with the git default daemon port like this:

$ ssh -L9418:github.com:9418 [email protected]

And clone repositories replacing github.com with localhost, like so:

$ git clone git://localhost/someuser/someproject.git

If you want to preserve the “correct” metadata, there are several options

@tekkub
tekkub / disk_throughput.rb
Created June 3, 2010 08:14
Drive read throughput tester
#!/usr/bin/env ruby
f = ARGV.first
size = File.size f
puts "Reading #{size/1024/1024} MiB"
t = Time.now
File.read f
total_time = Time.now - t
puts "%.1f sec - %.2f MiB/sec" % [total_time, size/1024/1024/total_time]

There are precompiled versions available for Windows, Linux (via apt-get/yum/etc) and Mac OS X. In addition to the precompiled versions, you can also install git via MacPorts. However, if you want the most recent version, or to install it in a non-standard location, compiling it from source is actually very easy (on Mac OS X at least).

You need to have Xcode installed, which provides a version of GCC. The most recent version can be obtained for free from the Apple Developer Connection. If you don’t have a fast internet connection or have some other reason not to download Xcode via Apple’s site, then you can always install Xcode from the Mac OS X DVD (from the folder labeled ‘Optional Installs’).

You can download the latest stable version of git from git’s website, in th

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/main_title" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/continue_label" />
<Button
android:layout_width="fill_parent"
local myname = ...
local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", function(self, event, addon, ...)
print(myname, event, addon, ...)
if myname == addon then LoadAddOn("Addon2") end
end)
$ ssh -v githubcorkscrew
OpenSSH_5.2p1, OpenSSL 0.9.8l 5 Nov 2009
debug1: Reading configuration data /Users/tekkub/.ssh/config
debug1: Applying options for githubcorkscrew
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to ssh.github.com [207.97.227.248] port 443.
debug1: Connection established.
debug1: identity file /Users/tekkub/.ssh/identity type -1
debug1: identity file /Users/tekkub/.ssh/id_rsa type 1
debug1: identity file /Users/tekkub/.ssh/id_dsa type -1