Yearly Archives: 2011
Quick and dirty ssh tunnel setup
My quick and dirty setup to set up a SSH tunnel to home machines from our remote web server.
This sets up a way to access our home machine via our remote web host – just do a ssh -p PORTNUM localhost
when logged in at USERNAME@REMOTESERVER.NET
Setup of keys; creating a passphrase
First, make sure that you’ve created an RSA public/private key pair:
ssh-keygen -t rsa |
I had to use this since I completely forgot the old passphrase I set up in the past. Now, rather than copy over to authorized_keys to the remote server it is far nicer to use:
ssh-copy-id -i ~/.ssh/id_rsa.pub USERNAME@REMOTESERVER.NET |
Passphrase permanence
To stop you from being asked for the passphrase every time you want to SSH into the remote server do:
ssh-add |
.. on the (home) machine you want to access. Follow the prompts to ‘record’ your passphrase. Now we can move onto the actual port forwarding itself.
Basic port forward
Now, on the (home) machine you did a ssh-add
to, I’ve set up the forward with:
while true; do ssh -C -R PORTNUM:localhost:SSH_PORT USERNAME@REMOTESERVER.NET; sleep 5; done |
The SSH_PORT
is normally 22. I use sleep 5
so there is some time to escape out of this infinite loop if I want to cleanly close the session running this bash script. Thus the script is left running on untouched unless I need to kill it off.
You know it was a good day if you didn’t bite or hit anyone.
– Nathanial Parizek (age 4)
Wisdom of a 4 year old
Gallery3 + WordPress 3.2.1 = FFFFFFFUUUU
I know that a WordPress on top of Nginx isn’t all unique but unfamiliar to me, but this fiddling was ridiculous!
I have set up a Gallery3 install (since they’ve stopped maintenance of Gallery2 I believed that I should also use the most active and stable version). Oh boy, was that awful: I realized late that they have intended to depend on Javascript; signs of a design approach I am strongly against. Later, after much pain of creating a custom theme for my gallery (deserving it’s own rant mainly containing one four-letter word rhyming with ‘truck’), I wanted to be able to import images from this to WordPress using the Gallery3 Picker plugin. Given that it had rave reviews and a good method of integrating with WordPress, I thought the install would be painless. I guess anything mainstream written in PHP is going to be anything _but_..
So, after much frustrating FFFFFFFUUUUUUUUUU away from sharp pointy objects and a large crowd of random victims, I found this (gallery3-picker/picker.php
line 320):
320 | if ($http_status == 302) |
Now, the plugin tries something smart: it first tries the /index.php
then if that fails retries with the plain URL – assuming that it does SEO rewrites.
If you took a moment to examine my Nginx setup you may have noticed this line:
location ~ \.php$ { try_files $uri =404;
.. So if it cannot find a file, it throws a 404 – naturally. Delving into it, the final URL the plugin was after adds a /path/to/rest
at the end: so the actual URL hit for me would return 404 at the first pass, not to retry the next.
I have my tweak at least:
320 | if ($http_status == 404 || $http_status == 302) |
Geez, it’s as if you are hungry but the only option is a greasy burger at a fast-food joint you wanted to avoid. Then you discover that your patty is underdone and they demand that you use their unintuitive stove to cook it yourself. Hmmm.. this food talk makes me slightly less angry and more hungry – time for lunch!
The history of web browsers; their popularity put into a more graphical perspective – and eerily similar to what most geeks would of expected (if I’m one example). Oh Opera, you need more love! (Via Pinterest)
JQuery, I thought you turned out ok, but now you tell me I can’t animate
too many things? You said you fixed something earier but I don’t believe you
JQuery, I thought you turned out ok, but now..
Some people insist that they’re city folk, which I fail to understand. Who the hell likes to be in a constantly noisy, crowded environment – it causes (di)stress needlessly.
The following is just a small subset of reasons why I like it here in this little market town:
- The ‘gale, our local
- The Half Moon, our local if we’re in town
- The local grocer
- A rich history, and funky old school
- Good dining out options
- Plenty of ramble space