Case in point: File server and torrent slave

I like to show off these things when I put them together, so I hope you’ll forgive me if it looks like I’m gloating again.

 

This is a combination home file server and remote torrent downloader — nothing particularly fancy or unique at all. This is something any moderately capable geek can put together in under 30 minutes or so, plus installation time, and keep in use for a decade at least.

Personally I consider this overpowered for what it does. This is the 600m I have mentioned (unfortunately) several times in the past weeks — a 1.4Ghz Celeron with a better-than-average video card, a pair of Broadcom-based network interfaces and a long history of hardware failures.

The failure du jour, if we don’t count the fact that the wired network port is unresponsive, is a rather important series of keys on the keyboard. As I mentioned before, I do suppose I could set this free on ebay, recoup a little of the value and wash my hands of it, but I have run out of favors with my associate in America, and rather than run the risk of irritating a friend with too many requests to piggyback on their ebay account … it can become a file server.

As you can see I used Gnome Ubuntu for this, which is probably sheer madness, except that just getting the system installed was a bit of a trick. Without that 1-q-a-z-Tab row of keys, there is a lot that is missing from a console environment.

And it’s not just that the keys don’t work, they send garbage to the system, usually in a high-speed burst. So pressing “a”, for example, causes the volume to decrease, the window to maximize and four random characters to spill into the terminal. And sometimes the touchpad gets in on the action, forcing the pointer into the lower left corner. Bad news.

The obvious solution that you should already be typing into the “Reply” box is “ssh.” And for that answer your teacher would give you a gold star. The problem is that the network requires a little coaxing, since Ubuntu 9.10 cannot, apparently, install a Broadcom 4318-series wireless card without access to the Internet.

It’s the old Catch-22: You can’t get your network running, without access to the network. 😯

My solution was to use a leftover PCMCIA card to connect, install the fwcutter stuff with the Hardware Drivers utility, and then free myself of the cable. It was a liberating moment.

Now that I had full access to the wireless network, I installed ssh with Synaptic (because typing “sudo aptitude install openssh-server -y –without-recommends” has two a’s in it), edited the /etc/hosts.allow file by copying and pasting the letter “a” into the terminal anywhere “nano” or “allow” was necessary, and added sshd: ALL.

The rest becomes quite easy. ssh from the Thinkpad, install rtorrent, elinks, mc, htop, iftop, nfs-kernel-server and do a little text file setup.

Originally I was going to set nfs to offer only the “Public” folder for sharing, since that was created automatically for me. But it turned out to be somewhat impractical, and since I sometimes ssh into the machine and use the terminal while the system is mounted, there was little logic in forcing myself to move files out of one folder when I had access to its parent from another terminal. Or maybe that doesn’t make sense. …

In normal running mode, there is a detached session of screen in place, with rtorrent, mc, elinks and htop running in separate “windows.” I detach and let it run on its own, and reattach any time I want to check the system or make an adjustment. If I find a torrent I want to download, I can simply dump it in a watched folder, and rtorrent starts it automatically.

At the same time, I added the shared folder to my /etc/fstab, and set it to automatically mount on startup. Something like this works fine.

192.168.x.x:/home/guest /media/nas nfs auto,users,nolock 0 0

I couldn’t imagine a situation where the storage machine would be offline, and the Thinkpad would need access and not have it, so mounting on start seemed okay. I’m sure however, that Fate will have a situation to offer, given enough time. πŸ˜‰

One strange thing: Apparently, under Gnome, the network is inaccessible until someone signs in. No doubt there is a setting for that somewhere, but rather than actually search for the answer, I decided I was happy to sign in once, cue the network, then log off. The network apparently stays up in that situation, and I wanted the system to run with the login screen displayed anyway, so it works fine for me.

I also tweaked Gnome’s power management so I could close the lid on the machine without sending it to sleep. If for some reason the machine loses power (like, I kick the plug), it should survive for an hour or two before powering itself down. Of course, if it loses power, chances are the network has lost power, so … ?

But the best part really, and my favorite part of the entire experiment, was to imprison it in my closet. 😈 I picked up about US$6 in hardware at a local 100-yen shop, and I now have extension cords tacked to the corners, leading up to the topmost cavity of my closet. See for yourself.

 

If it looks like the cords are disappearing into the closet, they are. I needed about 5 meters of cord but the longest ones were 3 meters, so they couple in the closet, then run back out. I am a hack when it comes to cabling, but this isn’t too bad.

The beauty of this, of course, is that it is out of the way, takes up no space on my desk, needs no 10-meter network cable to reach the router, and has a battery backup for the 65W power supply. Mentally, I put that in the same bracket as my kitchen light bulb.

The downsides … well, like I said, I consider this an otherwise usable machine. If the keyboard weren’t so annoying — or if I were willing to drop US$65 for a keyboard plus shipping — it would go back to being functional, and not just a closet dweller. And although it’s not much of a fault, it’s a lot more powerful than it really needs to be.

But I have to repeat one small admission before closing: It’s true, like I said, I probably could not have put this together in Arch or Crux, because I couldn’t rely on the keyboard. For once, the GUI made it possible. πŸ™„

12 thoughts on “Case in point: File server and torrent slave

  1. vespas

    “[…]copying and pasting the letter β€œa” into the terminal […]”

    I’m sure you’ve heard of USB keyboards, right? πŸ™‚

    as for the network only when gnome is logged in, are you using NetworkManager instead of ifup/ifdown?

    Reply
    1. K.Mandla Post author

      You’re right, a USB keyboard might be a solution, but personally, I don’t like to use them with laptops.

      Part of the appeal to me is that laptops have a small footprint on my desk, and adding an external keyboard eats up space. Plus, this is a machine that I probably won’t keep for long, since it has a history of hardware issues. I’d rather not spend money on a machine with a miscreant streak.

      And really, it’s not that great of a machine. More and more, its value is in parts, not the whole.

      As far as the network, I have only used the desktop network manager. Should I be hotwiring rc.local to bring up the network instead? That was my initial thought, but logging in and then out worked for me.

      Reply
  2. tigrmesh

    Not everyone has a USB keyboard.

    I’ve had to do that copy/paste over a bad “a” key. It’s no fun. But it’s better than not being able to use the machine at all.

    Reply
  3. steve

    Just IMO of course but I have found a USB keyboard to be very useful in dealing with various pieces of semi-functioning hardware, I would consider it an indispensable tool

    Reply
    1. vespas

      exactly, even if you don’t use it regularly, I find an external keyboard to be a good debugging tool. They’re cheap, just keep one under your bed…

      as for the net, I don’t know the details on Arch, on suse yast lets you switch between ifup and networkmanager. I suppose all it does is indeed add entries to rc.local and remove networkmanager from autostart.

      Reply
  4. Pingback: Installing Crux 2.6 via ssh « Motho ke motho ka botho

  5. Pingback: A new mini keyboard « Motho ke motho ka botho

  6. Pingback: Rounding out a terminal-based Debian system « Motho ke motho ka botho

  7. Pingback: In-house shuffle « Motho ke motho ka botho

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s