Sean’s Obsessions


  • I'm a happy Linode customer. This is a Linode 540 VPS. Linode periodically increases RAM and disk while keeping costs steady, which makes them the natural choice.
  • Archives

Archive for the 'Linux/Unix/OpenSource' Category

07 Apr

Piping with the find command and dealing with spaces

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 [...]

15 Nov

Top 1 best database management tool – and how to use it

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 [...]

27 Aug

svn merge

(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, [...]

03 Nov

Using Rails Models from within an external script

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.

29 Feb

Testing via screen scraping

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”;
[...]

29 Feb

How the hell do you test a controller?

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 [...]

25 Dec

I’ll be speaking at Sharkfest ‘08

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 [...]

24 Nov

Frameworks don’t suck

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 [...]

14 Nov

Skinny controller, fat model

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 [...]

04 Nov

A simple authentication system with CakePHP 1.2 and Auth Component

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 [...]

© 2010 Sean’s Obsessions | Entries (RSS) and Comments (RSS)

Powered by Wordpress, design by Web4Sudoku, based on Pinkline byGPS Gazette