Strobemonkey Blog
Spotlight not finding applications

Spotlight wasn’t finding my applications, even after re-indexing from the command line”

sudo mdutil -E /

The solution is to specifically import the applications folder into spotlight:

arch -i386 mdimport /Applications

RabbitMQ on MacPorts requires py25-simplejson

sudo port install rabbitmq-server

gives this error:

---> Computing dependencies for rabbitmq-server
---> Building rabbitmq-server
Error: Target org.macports.build returned: shell command failed (see log for details)
Log for rabbitmq-server is at: /opt/local/var/macports/logs/_opt_local_var_macports_portdirs_rabbitmq-server/main.log
Error: Status 1 encountered during processing. To report a bug, see

after examining the log file the following was required:

sudo port install py25-simplejson

then re-run:

sudo port install rabbitmq-server

That installs fine but why’s it not part of the package dependencies - dunno?

Then attempting to start RabbitMQ thus:

sudo rabbitmq-server -detached

gives this:

Activating RabbitMQ plugins ...
0 plugins activated:
ERROR: epmd error for host "MacBook": address (unable to establish tcp connection)

MacBook is the name of the machine so the following should be added to /private/etc/hosts :

127.0.0.1 MacBook

and start RabbitMQ:

sudo rabbitmq-server -detached

WordPress deployed via Git may not be the smartest choice

Installed WordPress on PHP Fog, which looks lovely and slick.  Pulled the repository via Git, made changes, pushed and everything’s good.  Then installed a dodgy WordPress plugin via the admin interface (W3 Total Cache) which knocks out the admin interface.  Rectifying via FTP would take approximately 30 seconds - delete plugin folder and remove one PHP file.  Rectifying on PHP Fog requires a support request which takes, if you’ve done this on a Friday, at least 72 hours and counting.  Unless there are other ways to fix this?

CouchDB reinstate admin party

Once an admin party has been stopped, you can get it back by removing the admin user:

curl -X DELETE http://admin:password@127.0.0.1:5984/_config/admins/admin

Why I do this?  Me no tell.

rake aborted! undefined method `task’ for…

Seems to be an issue with rake 0.9.0.

Stick this into Gemfile:

gem 'rake','0.8.7'

and make sure you refer to 0.8.7 (and not 0.9.0) Gemfile.lock:

rake (0.8.7)

and just for good measure uninstall rake 0.9.0:

sudo gem uninstall rake -v 0.9

Oh Rails, when did we fall out of love?

Your website’s contact form is pish

You have a new subscriber or contact form on your site.

You want to:

a) get as many new clients as you can.

b) know how your prospect found your site.

c) get your data as clean as possible.

Which do you value most?

If you’re responsible for data quality then it’s c).

If you’re responsible for marketing then it’s b).

If you’re responsible for finding prospects then it’s a).

A while back I worked for an online bank; I’m not proud, it paid well. The bank had a multi-page form to collect all possible information from a potential client.

The data quality team wanted clean postal codes in the backend so the bank implemented Javascript checks on invalid postal codes. After one complaint(!), the bank removed that checking and accepted anything the potential client wanted to put into the box marked “Postal code”.

The form asked the potential client how they found out about the bank and there was a drop-down list with umpteen options; the most used option was “Other”, so the bank removed the drop-down list from the form.

If you’re looking at the bottom line, prospects are potential sales.  Ask as little as possible; anything more is shite.

Git submodules on Joyent no.de - https:// vs. git@

Strangeness.  When I have .gitmodules looking like this:

[submodule "lib/node-hoptoad-notifier"]
    path = lib/node-hoptoad-notifier
    url = https://github.com/felixge/node-hoptoad-notifier.git
[submodule "public/css/Absolution"]
    path = public/css/Absolution
    url = git@github.com:strobemonkey/Absolution.git

and I push to no.de the second submodule doesn’t appear. 

But when I change it to:

[submodule "lib/node-hoptoad-notifier"]
    path = lib/node-hoptoad-notifier
    url = https://github.com/felixge/node-hoptoad-notifier.git
[submodule "public/css/Absolution"]
    path = public/css/Absolution
    url = https://github.com/strobemonkey/Absolution.git

Then everything’s happy.  What’s that all about then?

MacVim and nerdtree

Download nerdtree_plugin.

Move “doc”, “nerdtree_plugin” and “plugin” folders to ~/.vim

Add the following to ~/.vimrc:

autocmd VimEnter * NERDTree

autocmd VimEnter * wincmd p

Go through: http://nodetuts.com/tutorials/11-express-part-iii-restful-forms.html

body.product is undefined but body produces:
{ ‘product[name]’: ‘Mac Book 2’,
‘product[description]’: ‘Apple 13 inch Mac Book Pro Notebook’,
‘product[price]’: ‘1000’ }

Need to use node = 0.3.

Error: session requires the “secret” option string for security node

Running Node Tuts episode 13 sample project in Express on node.js gives the following error:

node.js:63
    throw e;
    ^
Error: session requires the "secret" option string for security

There’s been a change to Connect (after v0.5.4) and it now needs needs a secret to be passed in, change this:

app.use(express.session( { store: MemStore( { reapInterval: 60000 * 10 } )  } ) ); 

to this:

app.use(express.session( { store: MemStore( { reapInterval: 60000 * 10 } ), secret: 'parptittyparp' } ) ); 

But get your own secret.