Posted in Linux/Unix/OpenSource by: sean
2 Comments
07 Apr
I often use the find command as such:
grep foo `find . -name \*.php`
which looks for foo in all the PHP files. If the list of files gets too long for the shell, then xargs is the better option:
find . -name \*.php | xargs grep foo /dev/null
This breaks up the command into manageable chunks. The /dev/null [...]
Posted in Linux/Unix/OpenSource by: sean
No Comments
15 Nov
I’m noticing that more and more of the items that pop up in my feed reader are of the “Top N” variety. Some are decent, where the author breaks the topic down into subgroups and then shows one or two tools for each purpose. However some of them are just silly, such as the “top [...]
Posted in Linux/Unix/OpenSource, Personal by: sean
No Comments
27 Aug
(this is one of those “so I remember it” posts that might help others)
Edit: See below for a more accurate way to merge the trunk back into HEAD
I’ve got some code that I’m storing in SVN. In traditional SVN form, I’ve got my repo set up as
/trunk
/branches
So my work is done out of trunk, [...]
Posted in Linux/Unix/OpenSource by: sean
1 Comment
03 Nov
For some one off scripts I wanted to make use of a couple of models I created. I had no idea how simple it would be to load the rails environment from within a script:
require ‘config/environment.rb’
p MyModel.find(:first)
Sweet! Rails is so… thoughtful.
Posted in Linux/Unix/OpenSource by: sean
No Comments
29 Feb
Trying to figure out how to write a test based on screen scraping. Easiest example is to make sure that certain URIs redirect to the login screen.
Created an “automated” dir under app/tests/cases/, with a file called permissions.test.php:
<?php
class PermissionsTestCase extends CakeWebTestCase {
var $mysite = “http://test.mysite.com”;
[...]
Posted in Linux/Unix/OpenSource, Personal by: sean
No Comments
29 Feb
Testing models is straightforward, see http://bakery.cakephp.org/articles/view/testing-models-with-cakephp-1-2-test-suite
Testing a controller though… Why is there nothing good out there that tells you how to test a controller, other than references to Felix’s work that doesn’t use simpletest?
That said, testing a controller should look something like
- Create controller object
- Call an action
- Poke at the controller to make [...]
Posted in Linux/Unix/OpenSource, Personal by: sean
2 Comments
25 Dec
I’m giving 2 talks on using Wireshark to expose VoIP problems at Sharkfest ‘08 (schedule).Worker in a new boost free mobile ringtones maker trend. Details are sketchy, I think one of the talks is more of a hands on lab, the other is me talking. I’ve expanded on my techniques from the Linux [...]
Posted in Linux/Unix/OpenSource by: sean
No Comments
24 Nov
I’ve often had a dim view of web frameworks. At b5media we had more than one case where we’d send out some pretty basic development to be done, and we’d get it back, done in a framework that took more time to get running than it was worth. And, from a performance perspective, all [...]
Posted in Linux/Unix/OpenSource, Personal by: sean
No Comments
14 Nov
I understand how to work within the MVC (model, view, controller) system of development, but once I read skinny controller, fat model I realized what it’s all about. Even though it’s written for Ruby on Rails it’s easy enough to transport to your framework of choice.
I’ve heard the term “fat model” before, but really [...]
Posted in Linux/Unix/OpenSource by: sean
11 Comments
04 Nov
I’ve been learning the CakePHP framework recently, and came to need a simple user login system.
Judging by the documentation out there, ACLs are the way to do it. However after spending an hour trying to figure out all the contradicting articles out there I gave up. ACLs are very precise, all I need [...]