Samba Network Shares with Nautilus in Hardy Heron Part 2
Posted by Ryan Baxter Sun, 01 Jun 2008 23:07:00 GMT
Nearly a month ago I wrote about my problems connecting to the network shares of my Linksys NAS200 using Nautilus in Ubuntu, Hardy Heron. My fix was simple and it worked. Unfortunately, the solution’s WAF (Wife Acceptance Factor) was low. Apparently she didn’t think it was easy enough to execute smbmount from a Terminal window. Whatever :) I have since written a small shell script that is called from Session Startup.
Initially, the script failed to connect to my network shares because my wireless network connection hadn’t finished negotiating before the script was executed. I coded around this by creating a while loop that greps the output of a ping to my router. If successful, the mount_shares function is called. Otherwise. the thread will sleep for 10 seconds and try again.
#!/bin/bash
user="thorbardin/ryan%password"
root_dir="/home/ryan/Network Shares"
mount_shares() {
public_dir="$root_dir"/"Public on Thorbardin"
home_dir="$root_dir"/"Home on Thorbardin"
[ -d "$public_dir" ] || mkdir -p "$public_dir"
[ -d "$home_dir" ] || mkdir -p "$home_dir"
smbmount "//192.168.1.105/public disk" "$public_dir" -o user="$user"
smbmount "//192.168.1.105/ryan" "$home_dir" -o user="$user"
}
while [ 1 ]; do
if ping -c2 192.168.1.1 2>&1 | grep ttl; then
mount_shares
exit 0
fi
sleep 10
done
exit 0I’m already thinking about rewriting this script so that it scans my network using smbtree and automatically mounts all available network shares. That’ll be Part 3!
- Posted in Code Snippets
- Meta no trackbacks, 3 comments, permalink, rss, atom
Samba Network Shares with Nautilus in Hardy Heron
Posted by Ryan Baxter Tue, 29 Apr 2008 00:50:00 GMT
A couple of days ago I mentioned a few of my woes with the latest release of Ubuntu. Since then, I’ve installed Ruby on Rails and have found a work around for the continued problems I’ve had in accessing my samba shares using the “Connect to Server…” option in Nautilus. If you’re experiencing the symptoms described in bug report #208531, then you might want to give smbmount a try. From the command-line, type:
smbmount //{server}/{share} /home/{user}/{share} -o username={server_username}To unmount the share:
sudo umount /home/{user}/{share}I’m using this as a temporary solution until the bug in Nautilus is resolved. Your mileage may vary.
*The statements above were written under the assumption that you’ve created a folder within your home directory for mounting the share.
- Meta 1 trackback, no comments, permalink, rss, atom
Ruby on Rails with Hardy Heron
Posted by Ryan Baxter Sat, 26 Apr 2008 21:20:00 GMT
This Thursday, Canonical released Ubuntu, Hardy Heron, into the wild. Like many others, I immediately fired up a torrent and began downloading. From what I read of the aftermath, many launch day downloaders were not as lucky. Most Torrent servers became immediately inaccessible due to Hardy Heron’s popular demand. It has been three days and the US update servers are still saturated. This happens every release and can only mean that Ubuntu’s userbase is steadily growing.
My installation went well, but with any new OS release comes problems and Hardy Heron was not an exception. I couldn’t connect to my NAS through Nautilus. None of my browser extensions worked and Ruby on Rails was MIA. I decided to fix Rails first. Here are the steps I took to install Ruby on Rails on Ubuntu, Hardy Heron.
sudo apt-get install rubyAt this point I could not install Ruby on Rails with RubyGems because of the following exception:
/usr/bin/gem:23: uninitialized constant Gem::GemRunner(NameError)I opened up the source file and edited the offending line.
sudo gedit /usr/bin/gemAdding require ‘rubygems/gem_runner’ to the source file,
require 'rubygems'
require 'rubygems/gem_runner'I was then able to update RubyGems
sudo gem install rubygems-updateand install Ruby on Rails and the Mongrel web server.
sudo gem install rails mongrelAt this point I had a working version of Rails on my installation of Ubuntu, Hardy Heron. To get back to work the only thing missing was the NetBeans Ruby IDE. If you haven’t tried NetBeans for your Ruby on Rails projects, I highly recommend it. It’s located in the repos and only takes a few plugins to have Rails support out of the box.
- Meta 3 trackbacks, no comments, permalink, rss, atom
Compiling the Gosu Game Development Library on Ubuntu Feisty
Posted by Ryan Baxter Wed, 21 Nov 2007 01:40:00 GMT
I’ve had the itch this week to try out a few of Ruby’s game development libraries. I decided to start with Gosu. Gosu is a 2D game development library for the Ruby and C++ programming languages. It’s available for the Mac OS X, Windows, and Linux platforms and integrates with both the RMagick image processing library and the Chipmunk physics library.
Unfortunately the library is only available as a gem for Mac OS X and Windows. As a Linux user I’ve become accustom to compiling my own libraries, but this often means downloading and compiling dependencies, swearing, and a lot of Googling. I was lucky. Compiling Gosu only caused a few hairs to fall out.
If you’re an Ubuntu Feisty user, you’ll need to add the following line to the LargeImageData.hpp file located in the gosu-source-0.7.7/Gosulmpl/Graphics directory:
#include <boost/none.hpp>This line adds a reference needed on line 31 of the LargeImageData class. With this addition, you can then execute the commands below from the gosu-source-0.7.7/linux directory to compile the Gosu game development library.
$ autoconf
$ ./configure
$ makeThe make file provided with the source does not add the compiled gosu.so file to the Ruby lib directory. I chose to do this manually rather than edit the make file. Just issue the following command from the gosu-source-0.7.7/linux directory to add your newly compiled library.
$ sudo cp gosu.so /usr/lib/ruby/1.8/i486-linux/gosu.soWith a little elbow grease I successfully compiled the Gosu game development library on Ubuntu Feisty. I’ll dig into some tutorials next and post back with my results.
Be sure to check out Gosu’s, Getting Started on Linux, for a list of dependencies and compilation instructions.
/usr/lib/ruby/1.8/rinda/ring.rb:212:in `lookup_ring_any': RingNotFound (RuntimeError)
Posted by Ryan Baxter Sun, 18 Nov 2007 23:44:00 GMT
If you’re experiencing the error message above while using the Rinda distributed computing module in your Ruby script then try defining a Domain name in your Network Settings configuration. This has worked in my experience using Rinda and Ruby on Ubuntu Feisty.

- Meta no comments, permalink, rss, atom
rake aborted! No such file or directory - /tmp/mysql.sock
Posted by Ryan Baxter Sat, 06 Oct 2007 20:40:00 GMT
If you’re running into the above error message when trying to perform a Rails migration on Debian or Ubuntu then you might try adding the following line to your database.yml file:
socket: /var/run/mysqld/mysqld.sockMy database.yml file looks sorta like this:
development:
database: crunchlife_development
adapter: mysql
host: localhost
username: mysql_user
password: @!#?@!
socket: /var/run/mysqld/mysqld.sock
test:
database: crunchlife_test
adapter: mysql
host: localhost
username: mysql_user
password: @!#?@!
socket: /var/run/mysqld/mysqld.sock
production:
database: crunchlife_production
adapter: mysql
host: mysql.ryanbaxter.net
username: mysql_user
password: @!#?@!Good luck and happy migrations!
- Meta 8 comments, permalink, rss, atom

