background preloader

DIY Tunnelling

Facebook Twitter

Remote Blogging on Octopress - Syeong Gan. As I alluded to in a previous post, there is a major benefit to deploying Octopress with a custom buildpack that generates the site on any push to the repo—you can now blog from any machine that can run an instance of git. This opens up a world of options for remotely blogging.1 While none of the options are quite as friendly as Wordpress, Blogger, Tumblr, etc., they are still fairly trivial for someone who actually took the time to deploy Octopress in the first place. The General Setup If you have a working git installation, you only need a few additional steps to get started with remote blogging. First, you’ll need to copy your existing ssh keys to your home directory.2 Just copy the entire .ssh directory and you should be good to go. Note, if you are copying from a Windows machine to a Linux or Mac machine, you’ll need to set proper permissions for the files/directory.3 Next, you should clone the actual git repo that contains your blog.

Linux: Live USB Distributions Cloud IDEs iOS. The most useful SSH command - create a tunnel between localhost and a remote host. 16 Oct 2011 If you’re developing an app, it is extremely useful to be able to access your local development machine from an external url. For instance, when you open a Facebook app in a browser, Facebook sends a request to your canvas URL. One way is to use your IP address, but this probably won’t work if you’re at Starbucks or an airport, and it will change each time you reconnect to the internet. So what’s a reliable way to do this? Ssh -nNt -g -R :11223:0.0.0.0:3000 hoisie.com This forwards all requests from hoisie.com:11223 to localhost:3000. More generally, the command is: ssh -nNt -g -R :remoteport:0.0.0.0:localport user@host.com What are all the flags for? -n redirects stdin from /dev/null. Also, in your /etc/ssh/sshd_config server side, add this line: Some other useful SSH flags: -f is similar to -n, but supports passwords, and then executes ssh in the background.

For some reason most developers I talk to are oblivious to this trick. Reasonably Opinionated: Cheap, easy way to make your dev server available on the public internet. While solutions like localtunnel and showoff.io allow you to do this, they have some limitations both in terms of cost and functionality. The biggest problem is that it gets expensive for lots of developers or you can't use your own hostnames.

We've developed a alternative using DNS, a reverse proxy and an ssh tunnel that makes it trivial to allow public access to a any number of dev servers on demand. Here's how it works: Set up a reverse proxy (you can use Apache or nginx). Configure a wildcard CNAME record for *.dev.domain.com that points to your proxy server. . # /etc/hosts entry 33.33.33.11 jason.dev.domain.com To make your dev server publicly available, create an SSH tunnel. Ssh proxy@proxy.dev.domain.com -R 2000:jason.dev.domain.com:80 This setup allows the exact same host name to be used everywhere but have it hit the local dev box locally and have the same name resolve to the public proxy for development that require it.

Testing webhooks in development platforms. Webhooks were popularized by PayPal and have become commonplace now a days. A typical webhook service fires a POST to a URL of your choice whenever something interesting happens. You handle this request and respond accordingly. But you need to test webhooks regularly during development and it is a bit of a problem if your development server is inaccessible from the rest of the Internet. I have tried to solve this using ssh and nginx. For this method to work you need: Development server (which can hopefully process the webhook at /webhook) lets call it (D)SSH accessible server (S)nginx to be installed on the (S) We will ssh into the server with a 'backdoor' that will forward connections from (S) to (D).

Ssh -R 8888:localhost:80 user@(S) See man ssh for details Here we are telling ssh to create an incoming port (8888) on (S) and forward them to (D):80. Enter ngnix: nginx is a reverse proxy that can listen to calls from public address and forward them to local ports. The result: tl;dr.