Archive

Archive for the ‘Tech’ Category

Google Gears in Firefox 3.5 in Linux x64_64

July 19th, 2009 No comments

I recently posted about getting Firefox working in Ubuntu Jaunty 9.04 x86_64.  Updates to Firefox 3.5.1 were recently pushed to the repositories, and after updating, Gears stopped working again.  Use the Gears build here for Firefox 3.5.1 Linux x86_46, linked to from this Google Groups post.

It really would be nice if 64-bit Linux was supported by Google rather than having to find these work-around builds.  Clearly it works for us, what is the holdup?

SSHD: Allow SSH Connections from localhost only

July 16th, 2009 No comments

I am doing some MPI development on my notebook using the MPICH MPI implementation.  This implementation needs an rsh/ssh connection to work properly.  I was reluctant to run a full sshd instance on my notebook as I didn’t want to open up port 22 to the world to attempt to gain access (even with password authentication disabled, root login disabled, etc.).  I did some digging and found that the sshd_config setting 'ListenAddress' would allow me to force sshd to bind to the interface associated with the specified address.  So, for example:

ListenAddress 127.0.0.1

tells sshd to bind to lo, the loopback device. This means connections over eth* and wlan* will not work as sshd isn’t even listening on these interfaces. As far as I can tell this will do exactly what I’m looking for as I only want ssh working on my local machine and not over interfaces other than lo.

Firefox 3.5 in Ubuntu Jaunty 9.04

July 13th, 2009 2 comments

I’ve finally moved permanently to Firefox 3.5 in Ubuntu Jaunty (9.04).  Initially I installed it by following the instructions found here and here.  However, I didn’t put the time in to update my extensions, so I ended up reverting back to the 3.0.* series.  I installed by adding the Security Team’s PPA to my package sources list, but that is apparently no longer necessary.

The two extensions I couldn’t live without were Tab Mix Plus and Google Gears.  After some digging, I found a TMP thread with a link (xpi) to a development build that works with Firefox 3.5.  Also, I found a Google groups thread and a blog post with a few links to Linux x86_64 builds of Gears.

Once I upgraded these two extensions I was happy enough to continue using 3.5 permanently rather than just playing with it for an hour or so.

Note: The builtin support for OGG video is amazing.  The problem is it’s only in Firefox right now, so I don’t really expect to see widespread adoption of it.  However, it is one great step towards getting rid of plugin-based video based on flash.

Installing nVidia driver 185.18.14 with real time linux kernel 2.6.28-3-rt

July 10th, 2009 5 comments

This article discusses how to get the NVidia Linux graphics driver working with the real time linux kernel version 2.6.28-rt under Ubuntu (Kubuntu) 9.04 on AMD 64.

Read more…

Git over SSHFS

July 8th, 2009 6 comments

While working at NCAR, I stumbled into a situation where I needed to use Git over an sshfs mounted directory.  After beating on git and looking at its source code and not making much progress, I finally found a very simple solution related to how I mount the sshfs directory.

Read more…

Reversing Python list/string objects

May 4th, 2009 No comments

I was interested in the relative performance of reversing a python list using the idom list[::-1] rather than the reverse method of the list class. Additionally I wanted to see if this idom was efficient for reversing strings compared to converting to a list, reversing that list, and joining the elements again using ''.join(reversed_list). Here are the results:

Reverse list, slicing: (0.58000000000000007, 0.64144396781921387)
Reverse list, method: (0.20000000000000018, 0.19551301002502441)
Reverse string, slicing: (0.45000000000000001, 0.49545693397521973)
Reverse string, list: (3.71, 3.7981550693511963)

Read more…

Ubuntu Jaunty Update Notifications

April 28th, 2009 No comments

I just noticed that Jaunty changed the way that it notifies the user about updates. Rather than a notification in the systray, it displays the update-manager window automatically. To revert to the systray notification, you need to change a Gnome settings value using either gconftool on the command line or gconf-editor. Change the value /apps/update-notifier/auto_launch to false using one of these tools:

gconftool -s --type bool /apps/update-notifier/auto_launch false

Environment Variables and GNU Screen

March 9th, 2009 2 comments

I am an avid user of GNU screen.  However, one problem I’ve run into lately in Ubuntu involves the interaction of persistent screen sessions and less-than-persistent X sessions.  I’ve found that after starting a new X session, new environment variables are set (such as DISPLAY, SSH_AGENT_PID, and SSH_AUTH_SOCK).  This causes an incosistency between my X session’s variables and those that exist in my persistent screen session.  This post discusses my solution to this issue.

I’m currently running the currently unreleased Ubuntu Jaunty on virtually all of my machines.  At times, such as when resuming my notebook, I find that my X session has died.  This is not that much of an inconvenience for me—I do most of my work within a screen session that exists as long as the machine stays running, regardless of what X decides to do.  However, services such as ssh-agent must be restarted when creating a new X session and along with this restart comes a new set values for SSH_AGENT_PID and SSH_AUTH_SOCK.  In addition, it is possible that DISPLAY may change as well.

While these variables have changed, the screen sessions values have not been updated.  So when I re-attach to the running screen session and attempt to use ssh, I find that rather than using the running ssh-agent process to cache my passphrase, I am prompted in my terminal to enter the passphrase.  If I were able to use the updated environment variables I could use the ssh-agent process and all would be fine.

As I normally do, I googled for this issue and ran across this solution to the problem.  Rather than reiterate the details presented in this post, I simply show the two zsh functions I’ve written, as they differ sightly from the afore mentioned post:

grabvars()
{
VARS="SSH_AGENT_PID SSH_AUTH_SOCK DISPLAY"
 
#For each variable in $VARS
for x in $(echo $VARS) ; do
eval echo $x=\$$x | sed  's/=/="/
s/$/"/
s/^/export /'
done 1>$VARSLOC
}
 
sourcevars()
{
if [[ -f $VARSLOC ]]; then
source $VARSLOC
fi
}

Note that VARSLOC names the file that the export statements should be written to.

How do I use these two functions?  sourcevars is called every time a new shell is created (I’ve simply added a call to this function in ~/.zshrc).  grabvars is only called when I create or attach to a screen session, so I’ve aliased ‘screen’ to be ‘grabvars; screen’.  So now when I first login and create a new terminal, this terminal has the updated environment vars.  I do a ‘screen -DR session_name’ to attach, which then calls grabvars, the correct values are written to VARSLOC, and my screen session is attached.  If I create a new window in my screen session, the correct variables are now set.  If I want the updated variables in an exsiting window, I simply call ‘sourcevars’.

Categories: Tech Tags: , , , , , , , , ,