Archive for the 'computers' Category

Viewing the internet through someone else’s eyes

A couple of weeks ago I was culling my rss reader. I try to do this on a regular basis for a couple of reasons. The first is that my tech interests change over time. For a while I might want to read a bunch of Rails blogs, and then after a time, I may add a few blogs related to a project I am working on. Some blogs just die. For whatever reason the author stops posting, or the quality goes down. And sometimes, I realize I don’t have time to read you all, and the cruft has to go.

I am using Bloglines, and you can easily spot the feeds you are no longer reading, they are the ones with the (200) beside them. Bloglines will only keep the 200 most recent entries for you, after that it starts to kill off the old ones. I think it’s a sensible default. Frankly I find it refreshing. Most of the time developers are so afraid to make a decision that I would have guessed they would have cached things to a much higher number (assuming that infinity is not an option due to database constraints).

At any rate…Consistently Digg’s tech rss feed would be at 200 entries. I hate the Digg rss feed. It takes you to the comments and not the actual story. Digg comments are unmitigated clap trap. Not only are they particularly bad, they can make me quite angry.

I was getting ready to delete my Digg feed, when Bob suggested I could actually get an rss feed of the stories that he dugg. This was perfect, Bob would be my Mechanical Turk and weed through the crap and then I would see a distilled feed of Digg.

So far it’s been an interesting experiment. I have found a couple of things amusing. 1. Either Bob is too busy to keep up with much of Digg, or there is very little to “Digg” these days. I don’t get that many items in the feed. 2. It often occurs to me that this is largely how censorship would work, except my censor has a particularly bizarre sense of humor and a penchant for articles on alternative energy. 3. I wonder, and maybe Bob will speak up, does he ever think about what he is Digging now, and perhaps, change his behavior, if only subconsciously? I know that if somone were subscribed to my rss feed, I would go out of my way to make the feed really disjointed and fill it will bizarre entries…just to be funny.

As for the latter, I doubt it, however, what if all I could get to on the net were sites previously viewed by Bob (or anyone really, not picking on Bob), would that change the way the censor surfed? I bet it would, I know I would think about my every move online if that were the case.

OpenSolaris 2008.05

I installed the latest release of OpenSolaris 2008.05 today. I was lucky enough to have gotten a hold of a w1100z Sun Workstation donated by a buddy.

The install didn’t go as smooth as I would have hoped. Initially the clock was not set properly after having been turned off for an extended period. As a result the desktop would never load. I was able to kill the x session, and in gdm switch to failsafe-gnome, and set the clock. I completed the installation, but when I rebooted I was dropped at a grub prompt, and not the grub menu. I decided to run through the install one more time to make sure I hadn’t missed something. When I booted the live cd this time, with the clock not out of sync, it took me right to the gnome session, and I completed the install. Upon this second reboot, grub came up as expected.

Overall I was a little disappointed. I am happy to have the hardware, and now a functioning OS, but this was Sun hardware (albeit E.O.L. hardware). This should have just worked.

At any rate, there are lots of exciting things going on with OpenSolaris, and I recommend you take a look.

Most Common Bash

Just in the interest of standing on the shoulders of Patrick…and a bunch of other people…


npowell@delilah:~$ history|awk '{a[$2]++} END{for(i in a){printf "%5d\t%s\n",a[i],i}}'|sort -rn|head
  324   ls
  266   cd
  243   clear
  105   svn
  100   ssh
   80   vi
   58   sudo
   24   cp
   21   rm
   19   ll

ll is an alias to `ls -l`. I started off on Red Hat and they always included that by default. Kind of boring. I am surprised that clear was not the top spot, as I type it by reflex constantly.

More stupid Ubuntu tricks

I use emacs for the majority of my editing, however I use vim to edit config files. Most distributions will have a global vimrc that sets up vim to remember the last place it was in a file, and put you back there when you reopen that file. I find this to be a preferred behavior since I tend to make incremental changes to a config file and want to open it to the same section over and over again. Ubuntu for some reason has this section commented out in /etc/vim/vimrc:

if has("autocmd")
  au BufReadPost * if line("'\"") > 0 && line("'\"") < = line("$")
    \| exe "normal g'\"" | endif
endif

So I just snip that out of there and put it in my ~/vimrc. Happy configuring!

Ubuntu bug in reverse/forward search in bash?

For a long time now I have been addicted to using C-r (control-r) to do a reverse search in the terminal. If you haven’t done this, do it, it’s a huge time saver. Just hit C-r and start typing something unique from the command you are trying to recall.

I have a big history file (that’s what she said) on purpose, and being able to search back through it is nice. However one thing always bugged me, and I never got around to solving it, until today.

I would hit C-r and start typing, and then I would hit C-r a few more times to get back to the command I was actually looking for, except I ALWAYS got overzealous and went right past it. So I would hit C-c and start over. Then I thought, I bet you can go forward. Like any good Gnu/Linux user I typed man bash in my terminal and then /reverse.

Sure enough,

reverse-search-history (C-r)
  Search backward starting at the current line and moving ‘up’ through the history as necessary.  This is an incremental search.
 
forward-search-history (C-s)
  Search forward starting at the current line and moving ‘down’ through the history as necessary.  This is an incremental search.

That should work then. I pop out of my man reader, and hit C-r ssh


  (reverse-i-search)`ssh': ssh nathanpowell.org

Whoops! I meant to only go back to the one BEFORE that entry :). So I hit C-s…nothing. So I went to the modern forward slash of information, google.

I found this bug. It appears that, for whatever reason, C-s gets trampled on by C-s (stop). If you apply the workaround suggested there, it does indeed start to work. So I pushd the following onto my .bashrc (bad bash joke, and ultimately untrue since I added it to the bottom of the file, not the top of the “stack” *sigh* *groan*)


  stty stop undef

I don’t use stop in the shell so this will suffice for now, but it’s an interesting bug. I installed xterm, multi-gnome-terminal, and konsole, and only konsole was unaffected by the bug. So it’s an environment thing somewhere that konsole is not reading.

Does everyone else see this?

As seen on the webz

Q: Can I have more English documentations?
A: Now I’m working for it.

ATA over Ethernet

There are all kinds of ways to share storage on a network. AoE is one of them.

AoE couldn’t be easier to set up.

On the machine that will export a partition or hard drive, install vbladed. I installed it on my knoppmyth box here, as root:

  $ apt-get install vblade

Then fire it up on that machine, I export /dev/sda3 on eth0, as slot 0/shelf 0:

  $ vbladed 0 0 eth0 /dev/sda3

Then on the client machine install aoetools. I just used my Gutsy laptop:

  $ sudo apt-get install aoetools

Then discover, print out the drive details and mount the drive:

  $ sudo mkdir /mnt/aoe
  $ sudo aoe-discover
  $ sudo aoe-stat
      e0.0       244.249GB   eth1 up  
  $ sudo mount /dev/etherd/e0.0 /mnt/aoe/

Now, let’s watch some tv using ATA commands over Ethernet frames:

This gives us pretty cool low cost alternatives for SAN set ups.

Emacs keybindings for Firefox

When I was using OS X, one thing I liked was the C-a, C-e navigation when typing in text inputs or textareas (like the one I am using right now to type this).

If you are using Gnome, you can have this same functionality:

  gconftool-2 --set /desktop/gnome/interface/gtk_key_theme Emacs --type string

Add nmap to the bash-completion fun

Find this line in /etc/bash_completion:

complete -F _known_hosts traceroute traceroute6 tracepath tracepath6 \
        ping fping telnet host nslookup rsh rlogin ftp dig ssh-installkeys mtr

Add the word nmap to the end of that list.

Customizing Gnome and using gmrun

One of the apps I really liked on OS X was Quicksilver. However I really only used a small subset of what it was capable of. Mostly I found using it as a smart ‘Run Dialog’ was quite handy.

To that end I decided that I would bind a run dialog to the same key combo as I had used with Quicksilver.

Nothing in Gnome is straight forward and it took a little digging, but I figured it out. To set up our custom keybinding (we’re going to use <ctrl>+<alt>+r to launch our run dialog) you have to install or already have ‘gconf-editor’.

Fire up gconf-editor which appears to be an ill-conceived regedit and navigate to

apps -> metacity -> global_keybindings

Double click on the run_command_1 and then hit the key combination you want to use. (In my case <ctrl>+<alt>+r).

Now, we need to map that combo to a keybinding_command. Click on ‘keybinding_commands’ (right below ‘global_keybindings’ in the left hand pane) and double click on ‘command_1′. Type the word ‘gmrun’. You’re done with that part so go ahead and close gconf-editor.

If you haven’t already done so, install gmrun. `sudo apt-get install gmrun`.

Now we are ready to give it a shot. Hit the key combination you picked for your keybinding, and when gmrun appears, start typing. It supports tab-completion, so you really only need to hit a few letters and then the tab key.

One more gmrun tip before I end this post. You can create a ~/.gmrunrc file and set up certain behaviors (see man gmrun for a full list). For example in my gmrunrc I set it up to make Firefox handle urls in a new tab:

# Url Handler
URL_http = firefox -remote "openURL(%u, new-tab)"

Happy computing!

Next Page »