Kimptoc

Odds and Ends

Ebbsfleet United needs a little help

Hence this pledge:

http://www.pledgebank.com/2011playngbudget

To donate (£21.73), use this paypal link:

 

 

Thank you!

Every 6-12 months I need to setup a new mysql and/or postgres database – and by then have forgotten how to do it (again). So hopefully by writing it here, I will remember or at least know where to go in future.

Assumed this is on Ubuntu… and that mysql/postgres installed already.

MYSQL

Create the database

sudo mysqladmin create [dbname]

Create a user for that database, using the mysql tool (user has no password, can only logon from localhost)

sudo mysql

mysql> GRANT ALL PRIVILEGES ON [dbname].*
       to '[new user]'@'localhost';

POSTGRES

Create the db

createdb [dbname]
Create the user

sudo -u postgres createuser –superuser [new user]

 

As usual, work in progress, to be updated/added to as I learn a little/need more.

Hey you awesome Rails grafter,

Wondering if anyone is interested in getting this ebook/pdf?

http://robots.thoughtbot.com/post/7766484768/backbone-js-on-rails-a-new-dynamic-ebook

Its currently $39 until 1st August, but they have a group (10 copies) option for $199 – which seems to have no restriction on who the 10 are (ie not the same company etc). Hence $20 per person.

So, the point of my post – anyone interested in combining with me on this? Its done via github accounts – the book is being written on there.

My thoughts are I’d pay the $199 and then you pay me $20.

If interested, please mail me direct via chris at kimptoc dot net.

Thanks,
Chris

PS Paypal is fine :)

PPS Names  9 – yay, ordered it!

PPPS +2 extra… wonder if there will enough for another group order :)  … or maybe one of the 9 will change their mind :(

Also thanks to Riccardo for the SD Ruby Backbone presentation link. Also found a Peepcode ($12) screencast too. Obviously there is also the official Backbone site too :)

NOTE – just found out the book is at a really early stage

 

NOTE: If you are not using rvm, this may work more smoothly, but I want to use rvm, hence the pain :(

FIRST – make sure your Ubuntu box is ready for Ruby. If this is not done correctly, you may need to re-install ruby several times, which can get quite frustrating :(

sudo aptitude install build-essential bison openssl libreadline6
libreadline6-dev curl git zlib1g zlib1g-dev libssl-dev libyaml-dev
libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf
libc6-dev ncurses-dev subversion

Then install rvm

#Install RVM and ruby 1.9.2 on Ubuntu
sudo apt-get install curl build-essential libssl-dev libreadline5-dev
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
# Add to end of .bashrc file ...
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm"
; fi
# Open a new terminal
type rvm | head -n1 # Should see "rvm is a function"
rvm notes # to make sure of a good install
rvm install 1.9.2 # Installs ruby 1.9.2
rvm --default ruby-1.9.2 # Makes 1.9.2 the default ruby
ruby -v # Should see the 1.9.2 message

Now you should be able to follow the quick start guide, and “gem install heroku” should install it and its dependancies…

http://devcenter.heroku.com/articles/quickstart

Gem dependancies:

  1. rest-client
  2. mime-types
  3. launchy
  4. readline (although I thought we’d tried the readline workaround below)

Sources:

  1. Heroku Groups
  2. Ruby openssl issues – http://beginrescueend.com/packages/openssl/
  3. zlib issues – http://beginrescueend.com/packages/zlib/
  4. readline – https://rvm.beginrescueend.com/packages/readline/

Hi,

I frequently use my laptop on the train with little or no internet connectivity.

Thus, when testing locally developed gems, besides running their own test suites, its good to test them with my/an app that uses the gem.  But I want to do this without pushing the gem onto rubygems/github and then pulling it down again.

These are my notes on how I tried to do it – but I did not get it working…

Firstly, I use RVM and Bundler - so any solution needs to be compatible with that.

From this ascii/rails-cast, it seems there should be a rake task of “rake install” which will install into the current ruby/gem environment.

So, the plan is:

  • to switch to my app’s ruby/gemset
  • rake install my dev gem
  • test the app.

However, even though the gem list showed the new gem version, it was not being used.  Perhaps I need to run bundle update…

~chris

UPDATE:

I have found 2 options since this post:

Hi,

I have a printer linked to my Ubuntu server at home (sisko/10-ish), which is used for printing from anywhere in the house. It seems that the new AirPrint stuff in iOS4.2 can work with this, with a little jiggery pokery.

The links I have found on it so far are:

After following the above…

Sisko seems to have an issue with dbus and so is not appearing on the network ok – although it works for network printing from Mac OSX.

I also have a netbook running Ubuntu 10-something too – this seems to run dbus fine and appears on the network ok, but printing is not working…

Most importantly the printer shows up on the iPhone :)

Looks like I need to open up the CUPS security a little more…

Found this link which showed how to make OSX find CUPS printers:

https://bbs.archlinux.org/viewtopic.php?id=76914

Specifically:

cupsctl BrowseRemoteProtocols=cups

This link talks about amending papd config files, but doesnt seem to help:

http://www.zaphu.com/2008/04/29/ubuntu-guide-configure-netatalk-to-share-a-usb-printer/

[still not there yet, work in progress]

Wait a minute – its working!  It takes ages to send it from the iPad/iPhone, but its appearing on the printer – yay!

PS Sisko is mainly used for Time Machine backups – http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/

PPS I found this link with a script for generating the avahi service file, will give it a try.

http://www.sharedknowhow.com/2010/11/share-printer-with-airprint-under-linuxubuntu-10-04/

It seems to work – though just as slowly :(

I usually use

sudo apt-get update
sudo apt-get upgrade

But sometimes things get “kept back”, like for example kernel upgrades.

You can do these using this command.

sudo aptitude safe-upgrade

And it gives you the option for the other updates.

to steve.bullock@lewisham.gov.uk
cc camerond@parliament.uk,
cleggn@parliament.uk,
effordc@parliament.uk

Hello Mr Bullock,

I understand that given the recent budget cuts that the Playing for Success program in the Lewisham borough is at risk of being closed down.

If this is the case, I would just like to make a plea for it to be kept open.

Every term, around 75 children from the borough, your borough, are taken through a 10 week IT focussed training course, which helps build their confidence in themselves, in these tools and in their education in general. It has been doing this for several years now and the students enjoy it enough that the ones who take the primary version of the course are keen to come back and do the secondary version.

Its not the most perfect training course, its run on a shoestring, largely by volunteers, myself included (sorry, did I disclose I have a personal interest).

It does not solve all problems, for example this term we have had a few of the students drop out of the course because of badgering from their “mates” that it was not “cool” to do the course – but it is something, that some students can attend, can work towards completing – they get certificates presented from the Millwall FC team, at a presentation along with all the other students for that term.

I appreciate these are “tough” and we all need to tighten our belts, but even more so, I feel that closing down programs like this will mean less help for the most at risk in our society.

I look forward to response on this matter.

Regards,
Chris Kimpton

The long story is here: http://www.clintharris.net/2009/iphone-app-shared-libraries/

The short story is here.

Global Settings, i.e. do this once:

  1. Set up a shared build output directory that will be shared by all Xcode projects.
  2. Add a “Source Tree” variable that Xcode can use to dynamically find the static library project. (for each project to be shared)

Per Project Settings, i.e. for each project that uses the shared code

  1. Add the shared project to this project, DON’T select “Copy items into…”
  2. On linked project properties/General tab, select “Relative to COCOS2D_SRC”
  3. On the Target properties/General tab, add “Direct Dependencies” for the shared libs, e.g. cocos2d
  4. On the Target properties/Build tab, ensure there is no hard coded path in the “Library Search Paths” also add a “User Header Search Path” of $(COCOS2D_SRC)
  5. Drag the required static libraries from the shared project into the “Link Binary with Libraries” folder for your target.

And thats it :)