You are currently browsing articles tagged ssh.

At around 3am Sydney time, You­Tube went down:

Google’s mon­keys are still slav­ing away at it as I write this. And it looks like it’s just affect­ing Aus­tralia:

For future ref­er­ence, if you’ve got a box out­side Aus­tralia with ssh access, you can always quickly set up a proxy like so:

ssh -D 1337

This sets up a SOCKS proxy on loc­al­host (your own com­puter) at port 1337 (sub­sti­tute port num­ber to taste) — then simply point your browser at it. With this, I veri­fied that the You­Tube out­age at the very least didn’t affect the United States, by ssh-ing into nointrigue​.com, which is hos­ted in the US.

Related post from a while ago: Sil­ver­hawks: Get­ting around con­tent restric­tions. (Using -D with ssh is easi­er than the meth­od with Privoxy men­tioned in that post, though.)

Happy Aus­tralia Day.

Tags: , , ,

One of the attrac­tions of Blue­host, my host, is the abil­ity to ssh into your box, which makes admin­is­ter­ing your site that much easi­er if you know how to use the *nix com­mand line. (See related post.)

I’ll just write about two things that I’ve worked out recently.

Les­son #1: Read the README file.

Well duh, you say. The story is, I’ve had the bash_​completion script for some time (a really use­ful exten­sion that makes typ­ing on the com­mand line that much easi­er), but I’ve nev­er quite worked out why it didn’t work. Now I know why. It’s because I naively assumed that the script was the meat of it, and simply called it from .bashrc, expect­ing it to just work. It would, ordin­ar­ily, but I don’t have it installed in /etc which is where it expects to be (it’s in my home dir­ect­ory). If you have some­where else like me, you will need to set the $BASH_COMPLETION vari­able and modi­fy the script to reflect where you’ve actu­ally put it.

Les­son #2: If you didn’t set up the sys­tem your­self, things might not be as you expect them to be.

SUITS has a bunch of use­ful scripts that you can use to improve your com­mand line exper­i­ence on the under­gradu­ate IT serv­ers, and I copied them over to my account on nointrigue​.com because I like them so much. One of these scripts sets nice col­ours for the com­mand line. It was all work­ing fine until I real­ised Tor­toiseS­VN could no longer access the Sub­ver­sion repos­it­or­ies via svn+ssh, fail­ing with the error “con­nec­tion closed unex­pec­tedly”. I figured some­thing I added recently was inject­ing garbage into the stream. It turns out it was the col­our-adding script! But why? It was pro­tec­ted like this:

if [ -n "$PS1" ]; then
        . ~/.bash/colors

That means that it should only have been run if it was run­ning in an “inter­act­ive” ter­min­al, and the col­our-adding script should not have been called if I was using svn+ssh. After some more pok­ing around, I found this in /etc/bashrc (which was being called from .bashrc):

# For some unknown reason bash refuses to inherit
# PS1 in some circumstances that I can't figure out.
# Putting PS1 here ensures that it gets loaded every time.

Uhh, ok, nice work, Blue­host. I guess not many of their cus­tom­ers actu­ally use ssh. At least there was a com­ment.

But even if it was called, why the col­our-adding script was fail­ing in the first place? It turns out that tput colors fails if $TERM is not set, which hap­pens to be so when using svn+ssh. (Actu­ally, this would not nor­mally pre­vent me from access­ing my Sub­ver­sion repos­it­or­ies. The com­mand line svn seems to ignore errors; how­ever, Tor­toiseS­VN dies the moment it sees any­thing unto­ward.) My ulti­mate solu­tion was to simply pipe error to /dev/null.

Tags: , , , ,

In this tutori­al, I’m going to write about a num­ber of things that will be use­ful to you if you have your own web­site host­ing. This art­icle is geared for begin­ners, and requires no pre­requis­ites apart from some com­mon sense! Now, I host nointrigue​.com on a shared Linux serv­er with Blue­host, which means that my web­site shares a phys­ic­al com­puter with a num­ber of oth­er users. This setup is fairly com­mon, so I’ll be writ­ing with an assump­tion that this is the kind of arrange­ment that you have. I’ll cov­er some basic, but use­ful, shell com­mands to make your life easi­er, and explain how to install addi­tion­al soft­ware on your host.

Read the rest of this entry »

Tags: , , , , , , , , , , ,