Limi’s Sphere of Influence

dabbling, frivolling, idling, loafing, loitering, playing and procrastinating

MGMT - Time to Pretend

Just a quick post to say that this is probably my track of the month. Originally found it through the film 21 and it also just got awarded “#3 Hottest New Music of 2008″ by Last.fm

  • 0 Comments
  • Filed under: Last.fm, Music
  • Had to go look this up today as we are using more named_scopes at work now, although couldn’t off the top of my head remember how to get a named_scope to take an argument nicely. Anyway, the solution is…

    named_scope :recent, lambda { |*args| {:conditions => ["created_at >= ?", (args.first || 10.minutes.ago)] } }

    Hopefully this helps someone out

  • 0 Comments
  • Filed under: Programming, Rails, Ruby
  • Getting VOIP phones working through a SpeedTouch 780 can be somewhat… frustrating. They seem to have a talent for wanting the NAT config option enabled, then decided that it doesn’t want it enabled at a random interval. The easiest fix is just to toggle the NAT options on and off in your phone configuration.

    However, if this fails to work it might be that your SpeedTouch has some SIP options enabled and is technically blocking your phone from being able to receive data from your phone provider.

    We have found 2 fixes, and if one doesn’t work, the other should, but we’ll apply both just to make sure. So let’s start off shall we!

    Connect to your SpeedTouch over Telnet and type the following…

    :connection unbind application=SIP port=5060
    :saveall

    connection
    appconfig application=SIP SIP_ALG=disabled
    :saveall

    After you’ve done that, if the phone isn’t already working, give it a quick reboot and try again. If it’s still not working, toggle the NAT options to whatever they aren’t already on and try then.

    Hopefully this gets someone else’s VOIP phone working correctly, as it seems to be one of the most annoying fixes I’ve had to do to get them working again.

    This is the easiest way to get RMagick installed in Ubuntu Intrepid Ibex for Ruby….

    sudo apt-get install libmagick++9-dev

    …then…

    sudo gem install rmagick

    Job done!

    If you had a previous installation of Aptana Studio in hardy and now that you’ve upgraded to ibex it no longer works then you aren’t alone. It no longer works since during the upgrade Firefox 2 was removed from your system, and there isn’t a way to put it back in as its been removed from the package manager.

    Luckily the fix is easy…

    sudo apt-get install xulrunner

    Then you’ll need to either edit or create a startup script for Aptana to use. So make a file called “runAptana.sh” in /usr/local/aptana and inside that put…

    #!/bin/bash
    export MOZILLA_FIVE_HOME=/usr/lib/xulrunner
    /usr/local/aptana/AptanaStudio

    Then, whenever you want to run Aptana use that script instead; otherwise you’ll get those nasty errors which hamper your daily work efforts!

    Subclipse is a SVN plugin for Aptana, and it allows you to interact with the SVN server from within the IDE. However getting this running properly on my Ubuntu 8.04 machine proved to be more challenging than just installing it.

    The problem I was having was that when I went to talk to the SVN server, it would always ask me for my username and password, there was no option to remember it. I thought this a little strange and upon visiting the preferences dialog (Window->Preferences->Team->SVN) I was greeted by a nice error “Failed to load JavaHL library”. Which of course meant I couldn’t change any options without it bitching that it wasn’t available.

    So how do we fix this? First off…

    sudo apt-get install libsvn-java

    Then, if you’re lucky, you should just have to restart Aptana in order for it to now detect it. However, if your machine was like mine and it didn’t detect it then you’ll need to do the following. Go to where Aptana is installed, for me this was /usr/local/aptana

    cd /usr/local/aptana
    gedit AptanaStudio.ini

    You’ll then need to add the following line to the end of this file

    -Djava.library.path=/usr/lib/jni

    That’s technically it, all you should need to do now is save the file, restart Aptana and it’ll be working for you. Well, I say you, I mean me :P

    So now that JavaHL is installed correctly, when I next talked to the SVN server, it once again, asked me for my login details, however a lovely “Save Credentials” checkbox appeared saving my sanity from inputting my details everytime. :D

    I recently started attempting to game on my Ubuntu machine using Wine, and I frequently play Warcraft III and World of Warcraft. However, when playing both of these I use Ventrilo to talk to my friends, so I thought easy, I’ll just run Ventrilo through Wine and have no problems. Wrong. Ventrilo does load up fine, however using Push-To-Talk is almost a useless option as it only works when Ventrilo is the active window. So to fix that someone make an application called VentriloCtrl (as of writing on version 0.5) and this simulates a keypress so that the push to talk functionality works from anywhere. So I set this up as one of the buttons on my MX revolution…

    The only downside however is that the key it presses is hard coded as the letter “A”, not exactly the best key since most gamers run with WSAD to move around and for about a week I was beginning to annoy people by every time I pressed ‘A’ to move around I was transmitting. A quick dig through the code shows us where the key is defined, currently on line 17…

    #define SIMULATEKEY XK_A // Simulate Key Press

    Excellent, so changing this should’nt be too hard. After a quick search around I found a nice long list of all the codes that you could use instead of “XK_A”…

    XK_BackSpace
    XK_Tab
    XK_Linefeed
    XK_Clear
    XK_Return
    XK_Pause
    XK_Escape
    XK_Delete
    XK_Multi_key
    XK_Kanji
    XK_Home
    XK_Left
    XK_Up
    XK_Right
    XK_Down
    XK_Prior
    XK_Next
    XK_End
    XK_Begin
    XK_Select
    XK_Print
    XK_Execute
    XK_Insert
    XK_Undo
    XK_Redo
    XK_Menu
    XK_Find
    XK_Cancel
    XK_Help
    XK_Break
    XK_Mode_switch
    XK_script_switch
    XK_Num_Lock
    XK_KP_Space
    XK_KP_Tab
    XK_KP_Enter
    XK_KP_F1
    XK_KP_F2
    XK_KP_F3
    XK_KP_F4
    XK_KP_Equal
    XK_KP_Multiply
    XK_KP_Add
    XK_KP_Separator
    XK_KP_Subtract
    XK_KP_Decimal
    XK_KP_Divide
    XK_KP_0
    XK_KP_1
    XK_KP_2
    XK_KP_3
    XK_KP_4
    XK_KP_5
    XK_KP_6
    XK_KP_7
    XK_KP_8
    XK_KP_9
    XK_F1
    XK_F2
    XK_F3
    XK_F4
    XK_F5
    XK_F6
    XK_F7
    XK_F8
    XK_F9
    XK_F10
    XK_F11
    XK_L1
    XK_F12
    XK_L2
    XK_F13
    XK_L3
    XK_F14
    XK_L4
    XK_F15
    XK_L5
    XK_F16
    XK_L6
    XK_F17
    XK_L7
    XK_F18
    XK_L8
    XK_F19
    XK_L9
    XK_F20
    XK_L10
    XK_F21
    XK_R1
    XK_F22
    XK_R2
    XK_F23
    XK_R3
    XK_F24
    XK_R4
    XK_F25
    XK_R5
    XK_F26
    XK_R6
    XK_F27
    XK_R7
    XK_F28
    XK_R8
    XK_F29
    XK_R9
    XK_F30
    XK_R10
    XK_F31
    XK_R11
    XK_F32
    XK_R12
    XK_R13
    XK_F33
    XK_F34
    XK_R14
    XK_F35
    XK_R15
    XK_Shift_L
    XK_Shift_R
    XK_Control_L
    XK_Control_R
    XK_Caps_Lock
    XK_Shift_Lock
    XK_Meta_L
    XK_Meta_R
    XK_Alt_L
    XK_Alt_R
    XK_Super_L
    XK_Super_R
    XK_Hyper_L
    XK_Hyper_R
    XK_space
    XK_exclam
    XK_quotedbl
    XK_numbersign
    XK_dollar
    XK_percent
    XK_ampersand
    XK_quoteright
    XK_parenleft
    XK_parenright
    XK_asterisk
    XK_plus
    XK_comma
    XK_minus
    XK_period
    XK_slash
    XK_0
    XK_1
    XK_2
    XK_3
    XK_4
    XK_5
    XK_6
    XK_7
    XK_8
    XK_9
    XK_colon
    XK_semicolon
    XK_less
    XK_equal
    XK_greater
    XK_question
    XK_at
    XK_A
    XK_B
    XK_C
    XK_D
    XK_E
    XK_F
    XK_G
    XK_H
    XK_I
    XK_J
    XK_K
    XK_L
    XK_M
    XK_N
    XK_O
    XK_P
    XK_Q
    XK_R
    XK_S
    XK_T
    XK_U
    XK_V
    XK_W
    XK_X
    XK_Y
    XK_Z
    XK_bracketleft
    XK_backslash
    XK_bracketright
    XK_asciicircum
    XK_underscore
    XK_quoteleft
    XK_lca
    XK_lcb
    XK_lcc
    XK_lcd
    XK_lce
    XK_lcf
    XK_lcg
    XK_lch
    XK_lci
    XK_lcj
    XK_lck
    XK_lcl
    XK_lcm
    XK_lcn
    XK_lco
    XK_lcp
    XK_lcq
    XK_lcr
    XK_lcs
    XK_lct
    XK_lcu
    XK_lcv
    XK_lcw
    XK_lcx
    XK_lcy
    XK_lcz
    XK_braceleft
    XK_bar
    XK_braceright
    XK_asciitilde
    XK_nobreakspace
    XK_exclamdown
    XK_cent
    XK_sterling
    XK_currency
    XK_yen
    XK_brokenbar
    XK_section
    XK_diaeresis
    XK_copyright
    XK_ordfeminine
    XK_guillemotleft
    XK_notsign
    XK_hyphen
    XK_registered
    XK_macron
    XK_degree
    XK_plusminus
    XK_twosuperior
    XK_threesuperior
    XK_acute
    XK_mu
    XK_paragraph
    XK_periodcentered
    XK_cedilla
    XK_onesuperior
    XK_masculine
    XK_guillemotright
    XK_onequarter
    XK_onehalf
    XK_threequarters
    XK_questiondown
    XK_Agrave
    XK_Aacute
    XK_Acircumflex
    XK_Atilde
    XK_Adiaeresis
    XK_Aring
    XK_AE
    XK_Ccedilla
    XK_Egrave
    XK_Eacute
    XK_Ecircumflex
    XK_Ediaeresis
    XK_Igrave
    XK_Iacute
    XK_Icircumflex
    XK_Idiaeresis
    XK_Eth
    XK_Ntilde
    XK_Ograve
    XK_Oacute
    XK_Ocircumflex
    XK_Otilde
    XK_Odiaeresis
    XK_multiply
    XK_Ooblique
    XK_Ugrave
    XK_Uacute
    XK_Ucircumflex
    XK_Udiaeresis
    XK_Yacute
    XK_Thorn
    XK_ssharp
    XK_lcagrave
    XK_lcaacute
    XK_lcacircumflex
    XK_lcatilde
    XK_lcadiaeresis
    XK_lcaring
    XK_lcae
    XK_lcccedilla
    XK_lcegrave
    XK_lceacute
    XK_lcecircumflex
    XK_lcediaeresis
    XK_lcigrave
    XK_lciacute
    XK_lcicircumflex
    XK_lcidiaeresis
    XK_lceth
    XK_lcntilde
    XK_lcograve
    XK_lcoacute
    XK_lcocircumflex
    XK_lcotilde
    XK_lcodiaeresis
    XK_division
    XK_oslash
    XK_lcugrave
    XK_lcuacute
    XK_lcucircumflex
    XK_lcudiaeresis
    XK_lcyacute
    XK_lcthorn
    XK_ydiaeresis

    Now obviously, over half of those are going to be quite useless as they will create key-presses resulting in keys being randomly typed. The best ones that I have found for use with Ventrilo & games are…

    XK_Pause
    XK_Break
    XK_Num_Lock
    XK_KP_5
    XK_Shift_Lock

    99% of the time these keys will have no effect on your games at all, so they are the safest keys to use for transmitting. Personally I use “XK_KP_5″ which is the same as pressing the number 5 on your keypad when num lock is off, ie. nothing happens. Using that key also doesn’t mean you have to have num lock off either as this is a simulated key press, so unless some game gets clever, or you use the num pad and have assigned this key to something else, its possibly the best key to use for Push-To-Talk since it does not get used for anything.

    So to change the key all you do is replace “XK_A” with whatever you want to use, then “make” and “make install” and you’re done :)

    I’ve been hunting around for a good music playing application for Ubuntu (8.04.1 - Hardy), and after some initial searching and testing I ended up on Amarok because I was impressed it used a proper database back end. Although, I’m not too impressed with the player itself, beyond 10,000 tracks and it starts to feel like your computer has turned into a jar of treacle.

    Anyway, since that I decided to try Songbird again. I had initially dismissed this after it wouldn’t read files from Samba shares, and at that time my external with my music was on another PC. Now that external is plugged into the Ubuntu machine, so off I went to download and try it again.

    The first hurdle, its not in the package system, and the official site doesn’t provide a .deb file, and I’m lazy. A quick google later and I have songbird_0.7.0-0~getdeb1_i386.deb!

    I get it installed, I go to run it and it’s pre-run wizard loads up asking me if I want to search for media and what plug-ins I want. Unfortunately at the end of this it goes off to download the files, then disappears, then starts again. Very frustrating. I try it again just to make sure it wasn’t some sort of cosmic ray interference or some such, unfortunately it repeats itself again.

    After about 30minutes of google abuse, installing older versions, uninstalling those older versions and installing the latest again, the solution is quite simple. Simply delete the “.songbird” directory from your own home directory. Now you would have thought that the package manager would have done that for me when I told it to “Completely remove this application including configuration files” obviously not…

    It seems that forums cost money (duh) so MPUK have vomited all over their forums with adverts, so here’s the next greasemonkey script to hide them (as in, hide not remove, as in, you still get the impression).

    MPUK Forum Adverts Hider v3.0a

    I came across The Unfinished Swan game, or rather, tech demo of this game while I was Stumbling around and it has an interesting idea for game play. From the video it has a feel like Portal and the maze parts of Max Payne, the game is simple yet partly challenging. The basic idea is that you are in a world of complete contrast, quite literally. The walls are either all white, or all black, and you have to navigate out the maze, but as its all white or black you cant see where to move until you fire your paint gun…


    I’ll be keeping an eye on this for when they release a playable demo, as I think it could do quite well. Hopefully this will be the 2nd game that Stumble has helped promote to me, the first was of course Audiosurf.

  • 0 Comments
  • Filed under: Gaming