You are currently browsing articles tagged blue­host.

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: , , , ,

I thought the sky almost fell down just then when I went to my gallery2 install­a­tion (/​gallery) and saw that it had a data­base error. “Noooo!!! I’ll have to spend hours rein­stalling and upload­ing again!” The error in ques­tion was

An error has occurred while inter­act­ing with the data­base.

If you get this error, don’t pan­ic. For me, it turned out that one of the data­base tables was cor­rup­ted and needed repair­ing. Log in to phpMy­Ad­min or to the mysql con­sole and check wheth­er any of the tables are lis­ted as cor­rupt. In my case, it turned out to be g2_CacheMap.

I snooped around some for­ums, and in the threads that had responses (a lot of for­ums have ques­tions left unanswered unfor­tu­nately), it seems like the blame lies with your host hav­ing a bad mysql setup or bad hard drives that cor­rupt at ran­dom. Shame on you, Blue­host.

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: , , , , , , , , , , ,