James Morris - JMOZ

I pretend I know PHP and internet stuff. Currently contracting at TimeOut London.

    • 0
      5 Dec 2011

      How to find out your Ubuntu version

      • Edit
      • Delete
      • Tags
      • Autopost

      To find out your Ubuntu version (or codename) use the lsb_release command which will “print distribution-specific information”:

      $ lsb_release -a
      No LSB modules are available.
      Distributor ID: Ubuntu
      Description:    Ubuntu 11.04
      Release:        11.04
      Codename:       natty

      Or if you just want the string of the codename:

      $ lsb_release -s -c
      natty
      • views
      • Tweet
    • 2
      11 Mar 2011

      Firewatir and sudo gem update --system

      • Edit
      • Delete
      • Tags
      • Autopost

      Trying to install Ruby, Cucumber and Firewatir on Ubuntu Maverick leads to a problem i'm sure i've seen before.  I've installed Ruby/Rails numerous times on Linux boxes and it never ever works first time.  For the amount of time Ruby has been around you'd think they'd get it to work on a Linux/Debian install easily (like PHP/MySQL/Apache), but no, always a frigging problem.

      Anyway, i've used apt-get to install ruby and rubygems.  From that you can then install the cucumber gem ok but the firewatir gem breaks:

       $ sudo gem install firewatir
      ERROR:  Error installing firewatir:
              hoe requires RubyGems version >= 1.4. Try 'gem update --system' to update RubyGems itself.
      
       

      If you then try sudo gem update --system you'll get:

      $ sudo gem update --system
      ERROR:  While executing gem ... (RuntimeError)
          gem update --system is disabled on Debian, because it will overwrite the content of the rubygems Debian package, and might break your
      Debian system in subtle ways. The Debian-supported way to update rubygems is through apt-get, using Debian official repositories.
      If you really know what you are doing, you can still update rubygems by setting the REALLY_GEM_UPDATE_SYSTEM environment variable,
      but please remember that this is completely unsupported by Debian.
      
       

      The reason it won't work is that the packaged version that's in the Maverick repositories is 1.3x.  You need to remove the package using apt-get and then use the latest source instead:

       $ sudo apt-get remove rubygems
      

      Then download rubygems from their website at http://rubygems.org/pages/download.  Once you've extracted it and gone into the directory run:

       $ sudo ruby Downloads/rubygems-1.6.1/setup.rb 
      RubyGems 1.6.1 installed 
      
       

      You'll have to re-install the Cucumber gem but now the Firewatir gem should work:

       $ sudo gem install firewatir
      Fetching: xml-simple-1.0.14.gem (100%)
      Fetching: rake-0.8.7.gem (100%)
      Fetching: hoe-2.9.1.gem (100%)
      Fetching: s4t-utils-1.0.4.gem (100%)
      Fetching: user-choices-1.1.6.1.gem (100%)
      Fetching: commonwatir-1.8.0.gem (100%)
      Fetching: firewatir-1.8.0.gem (100%)
      Successfully installed xml-simple-1.0.14
      Successfully installed rake-0.8.7
      Successfully installed hoe-2.9.1
      Successfully installed s4t-utils-1.0.4
      Successfully installed user-choices-1.1.6.1
      Successfully installed commonwatir-1.8.0
      Successfully installed firewatir-1.8.0
      7 gems installed
      
       

      More info here:

      http://stackoverflow.com/questions/3643870/gem-update-system-is-disabled-on-debian-error

      • views
      • Tweet
    • 4
      7 Jan 2011

      Double Netbeans icon on Docky

      • Edit
      • Delete
      • Tags
      • Autopost

      For the past couple of weeks i’ve been putting up with a bug where my Docky shows two instances of Netbeans.  The icon on the dock acts as a launcher which creates another Netbeans icon instead of using just the single icon and lighting up.  The problem is due to Netbeans being a Java app and is also down to the way Docky handles window matching.

      I did a bit of googling and found the cure at http://www.issathen.co.uk/?p=14.

      To get Docky to work nicely with Netbeans 6.9.1, create a file, netbeans-6.9.1.desktop, and stick the following contents inside it:

      #!/usr/bin/env xdg-open
      
      [Desktop Entry]
      Encoding=UTF-8
      Name=NetBeans IDE 6.9.1
      Comment=The Smart Way to Code
      Exec=/bin/sh "/home/foo/netbeans-6.9.1/bin/netbeans"
      Icon=/home/foo/netbeans-6.9.1/nb/netbeans.png
      Categories=Application;Development;Java;IDE
      Version=1.0
      Type=Application
      Terminal=0
      StartupWMClass=java-lang-Thread
      

      Obviously adjust the paths so they match up with your Netbeans location.  Alternatively, copy the Netbeans icon from your Ubuntu Applications -> Programming menu bar to your desktop and edit it.

      Either way, once you’ve got the file with the crucial StartupWMClass=java-lang-Thread appended to the bottom, drag it onto your Docky and it should work correctly!

      • views
      • Tweet
    • 0
      8 Dec 2010

      Skype plugin for Pidgin on Ubuntu Lucid crashes!

      • Edit
      • Delete
      • Tags
      • Autopost

      Aaaarrgghhh!  Someone please fix this!

      After installing the pidgin-skype package, then when trying to add a Skype account in Pidgin it crashes.  The output of pidgin -d gives:

      (10:06:24) account: Connecting to account someaccount.
      (10:06:24) connection: Connecting. gc = 0x2904170
      (10:06:24) GLib: GError set over the top of a previous GError or uninitialized memory.
      This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
      The overwriting error message was: Failed to execute child process "skype" (No such file or directory)

      I just want to be able to use Skype and MSN alongside each other in Pidgin.  Please make it work.

      • views
      • Tweet
    • 0
      8 Mar 2010

      Install PHP 5.3 on Ubuntu Karmic Koala from dotdeb packages

      • Edit
      • Delete
      • Tags
      • Autopost

      First up, add the dotdeb repository.

      Fire up vim and add the following 2 lines to /etc/apt/sources.list:

      deb http://php53.dotdeb.org stable alldeb-src http://php53.dotdeb.org stable all

      Now do a sudo apt-get update to update your packages.  The next step may fail but give it a go anyway.

      Use Aptitude to install the PHP 5.3 packages.

      sudo aptitude install php5-cli php5-common php5-cgi php5-mysql php5-curl libapache2-mod-php5 php5-memcache php5-xdebug

      If this goes through ok, well done!  In my case I had dependency issues that could not be satisfied.  The package libicu38 was needed but could not be found in the repos in my sources.  I did a quick google and could see that libicu38 had been taken out of Karmic but was available in Jaunty security, so add that repo to the sources file:

      deb http://security.ubuntu.com/ubuntu jaunty-security main

      Now do a apt-get update and then:

      sudo aptitude install libicu38

      Now go back to the previous step and try to install the PHP 5.3 packages again, hopefully they should work now.

      You can now try and see if php 5.3 is working, issue php -v at the command line and see if it works correctly, once working you’ll get:

      PHP 5.3.1-0.dotdeb.1 with Suhosin-Patch (cli) (built: DecĀ  5 2009 20:08:29) Copyright (c) 1997-2009 The PHP GroupZend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH

      In my case I had a couple of errors that needed fixing - PHP complained about a date setting and xdebug also shouted a bit.  They were easily fixed.

      Edit xdebug.ini.

      Fire up vim and edit /etc/php5/conf.d/xdebug.ini, you need to change the extension line so it’s a zend_extension and maybe also set the full path to the xdebug.so file (depending on if you set your include path in php.ini):

      zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so

      Edit php.ini.

      vim /etc/php5/apache2/php.ini and find the line that starts with ;date.timezone and change it to:

      date.timezone = Europe/London

      To get xdebug to work correctly you need to enable html errors:

      html_errors = On

      Finally do a sudo apache2ctl restart and everything should be working!

      • views
      • Tweet
    • Search

    • My Sites

      • James Morris
      • Mixcloud Downloader
      • Shoreditch Vietnamese
      • I HEART Shoreditch
    • Tags

      • php
      • Symfony2
      • FOSUserBundle
      • clouddownload.co.uk
      • roles
      • shoreditch
      • symfony
      • 301
      • SplObserver
      • SplSubject
      • android
      • api
      • codename
      • command
      • console
      • contract
      • cucumber
      • delete
      • docky
      • dotdeb
      • errors
      • exif
      • firewatir
      • foursquare
      • http
      • imagick
      • iphone
      • mario
      • maverick
      • mixcloud
      • netbeans
      • news
      • nginx
      • observer
      • php 5.3
      • pidgin
      • poker planning
      • put
      • ruby
      • scrum
      • session
      • shit
      • shoreditchvietnamese.co.uk
      • skype
      • stripImage
      • sudo gem update --system
      • super hub
      • twitter
      • version
      • vietnamese
      • virgin media
      • watir
    • Archive

      • 2011 (22)
        • December (3)
        • November (4)
        • September (3)
        • August (3)
        • July (1)
        • May (2)
        • April (4)
        • March (1)
        • January (1)
      • 2010 (1)
        • April (1)
    • Contributors

      James Morris
    • Obox Design
  • James Morris - JMOZ


    30383 Views
  • Get Updates

    Subscribe via RSS
    TwitterFacebookLinkedIn