22nd Aug 2009
Posted in Server stuff and installs, Web Development at 11:01 pm by admin
This weekend I got a chance, or rather was forced, to try out the SSH client I’ve had sat on my iPhone for the last few months.
I got an email from my boss who had just been tipped off about problem with our <a href=”http://www.sphinxsearch.com”>Sphinx</a> configuration. The usually very helpful stemming that Sphinx performs on search queries was causing “Live music” and “DJ music” events to come up when a user searched for “musicals”.
At this point I was in a cafe on Broadway Market with a coffee eyeing up the ample selection of vegan cakes. Getting to the point I whipped out my iPhone and logged into our webserver using <a href=”http://jbrink.net/touchterm/”>Touchterm</a>. I was relatively easily able to edit the Sphinx config file with vim (the command line editor that’s better than emacs), restart the server and reindex all our events, I later realised that changing the stemming config only requires a restart of searchd to take effect.
Thanks to the convenient shortcut overlays I could access the crtl, esc and arrow keys and also perform key shortcuts like ctrl+a to get to the start of the command because I forgot to type sudo.
Now I’m totally told I’m going to shell out a £2.99 quid for the pro version.
This weekend I got a chance, or rather was forced, to try out the SSH client I’ve had sat on my iPhone for the last few months.
I got an email from my boss who had just been tipped off about problem with our Sphinx configuration. The usually very helpful stemming that Sphinx performs on search queries was causing “Live music” and “DJ music” events to come up when a user searched for “musicals”.
At this point I was in a cafe on Broadway Market with a coffee eyeing up the ample selection of vegan cakes. Getting to the point I whipped out my iPhone and logged into our webserver using Touchterm. I was relatively easily able to edit the Sphinx config file with vim (the command line editor that’s better than emacs), restart the server and reindex all our events, I later realised that changing the stemming config only requires a restart of searchd to take effect.
Thanks to the convenient shortcut overlays I could access the crtl, esc and arrow keys and also perform key shortcuts like ctrl+a to get to the start of the command because I forgot to type sudo.
Now I’m totally sold I’m going to shell out a £2.99 quid for the pro version.
Permalink
30th Aug 2008
Posted in Server stuff and installs at 2:45 am by admin
I am (still) a proud owner of an Apple PowerBook, and it’s only now that in this overwhelmingly x86 world that things are starting to get a little awkward. I dual boot Ubuntu and OS X and as many people know running powerpc linux is full of unexpected trouble and disappointments.
Anyway so I was trying to install ferret (a ruby based full text search engine) through ruby gems (I’m using 1.0.1) and ran into a puzzling issue. It should have been as simple first install the rubygem, then the rails plug-in,
> sudo gem install ferret
> ruby script/plugin install svn://projects.jkraemer.net/acts_as_ferret/tags/ stable/acts_as_ferret
However the powerpc world is as cruel as it is neglected. Though this command seems to result in success when you try and use the library with your rails app or whatever you will encounter an error when starting the server, something like
Failed to load /usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.6/lib/ferret_ext.bundle (LoadError)
The reason for this is the Makefile that comes with this rubygem has the processor type hardcoded as i386, that’s intel x86 processors.
The solution: fix the makefile and compile it for your processor in a few easy steps.
Open your terminal and find your gems directory, mine is /usr/local/lib/ruby/gems/1.8/gems/ yours may vary due to 1.8, installation and ruby version.
> cd usr/local/lib/ruby/gems/1.8/gems/
Next Dig a little deeper into the ferret gem’s directory (assuming we have the same version it should be something like …
>cd ferret-0.11.6/ext
Delete all the existing binaries, they are of no use to you.
> sudo rm *.o ferret_ext.bundle
Fix that make file. Use your favourite text editor which must be vi right?
> sudo vim Makefile
With the file open type
:%s/i386/ppc
to globally replace i386 with ppc. Next type
:wq
to save and exit. Use something less trciky like textmate, BBEdit or pico if you’re not familiar with vi. On the other hand you could learn to use it before you bring shame upon yourself and your family.
Now we’re ready to recompile the thing, pretty simple!
> sudo make
This will compile all those little c files in there and create a new ferret_ext.bundle, for some reason this doesn’t really live here so last thing is to move to the right place
> sudo cp ferret_ext.budle ../lib
All done. Start your rails app and go.
Permalink