Twitter Updates

Monday, 31 August 2009

Recursively Search for file with text

Using the find command below in Unix/Linux/OS X terminal you can search from a given path recursively looking in all files for text that matches 'find this text'.

$ find ./searchPath/ | xargs -I {} grep -iHn 'find this text' {}


$ grep -R -iHn 'find this text' *

grep Options:
-i makes it incase sensitive
-H outputs the filename before the matching line.
-n outputs the matching line number before the matching line.
-R Recursive from current location

Ignore Subversion folders
$ find ./ -not -name *'.svn'* | xargs -I {} grep -iHn 'find this text' {}

Saturday, 22 August 2009

Directory to Podcast

Just finished (largelgy based on an example) a small simple php script to take files from a folder and turn into a podcast feed. Directory to Podcast PHP script.

This may be useful if you want to setup a cron script/server application on a home server to download your latest podcast shows. Using this script you can then reserve the downloaded files as a local podcast feed.

This is useful at home as your server can download at none bandwidth critical times, when your isp applies limits or around 9pm when the internet is going really slow. When your main machine is switched on the podcasts will download very quickly over your local network.

Tuesday, 11 August 2009

require_gem is now gem

I have been working through the Ruby on Rails 2 Create a blog in 15 minutes and it only took me a few hours, but was much quicker and gave me a better understanding of rails than finishing the book on rails I was reading.

After this I had wanted to add tags like most blogs and photo site now have. So I am currently working through a act_as_taggable tutorial.

The main point I want to make is that at some point the require_gem command has been replaced with gem.

incorrect: require_gem 'acts_as_taggable'
Correct: gem 'acts_as_taggable'

Monday, 3 August 2009

Easy Create DMG Files with background images

I just discovered this [1] helper application for creating DMG file for distributing your Mac Applications.

[1] iDMG

Easily define Icons and Background images.

Changing Icons for Shoes Rasins Programs

How to change Icons for compiled shoes applications. There is no configuration options in shoes for this but with some free tools you can change the included icons.

For Mac OS X dmg file if you open the .app as folder by right-click Show Package Contents, through an alternative file browser or go into it in the terminal and replace Shoes.icns and /Resources/Shoes.icns with your Mac Icon .icns of choice. My guide on creating these and replacing them in a xCode java application.

For windows you can use a free tool called IcoFX (but license says you are never allowed to charge for an application which include icons created with this tool) to create Windows icons .icn. Using the IcoFX resource editor you can then change the included icon for a .exe.