Blog

  • Saving Time on Subversion Merging: svn merge Manually

    I just ran a benchmark on merging files using Eclipse which then calls subversion and running subversion manually on a 28MB repository.

    The results are interesting.

    svn merge destination_url@HEAD source_url@HEAD destination_folder

    took exactly 7 minutes

    Using a subversion merge in eclipse on the same repo and revision took 10 minutes.

    Take away: use svn merge on the command-line.

    Ya, I’d love to go back to using git.

  • Part II of NoobWatcher: Automatically Reporting Server File Changes

    With Noobwatcher, I’m now able to be really on top of subversion commits. But now it’s time to start working on part II, the part that keeps track of my server configuration and makes sure that it’s correct for all the servers that I want to use.

    I’m taking a look at Tripwire. Are there any libraries that you use for automatically checking if files have changed?

  • How Do You Avoid Presentation Disaster?

    It’s been a rough few days at work. We got hacked. I had to cancel a lunch with some pals at the Reverie. @alicetiara and @walnotes were gonna be there and everything was set for a pretty convivial conversation and some fun debate.

    But the code used for my presentation didn’t work because the machine it was working on wasn’t configured correctly. There might have been an issue with someone overwriting my code, too.

    How do you avoid presentation disaster?

    For my part, I’m creating a tool called Noobwatcher that:

    • checks the repo for changes every N seconds — because of a high noobage level, I’m gonna check every second
    • the moment that there is an update send the diff to me via IM, email, twitter. Take your pick.
    • check the server configuration files important to my code every N seconds
    • the moment a configuration file changes send the diff to me via IM, email, twitter — might as well use pownce, too.

    Have you had to set something like this up? If so, what solution did you use?

  • Symfony Has a Swift Plugin for Sending Gmail

    It’s easy to send emails using your gmail account with the Swift Plugin.
    Here’s some sample code below

    
    $to          = 'somebody@example.com';
    
    $htmlMessage = "OH HAI!";
    $textMessage = "*OH HAI!*";
    
    $connection = new Swift_Connection_SMTP(
      sfConfig::get('app_email_smtp_server'),
      sfConfig::get('app_email_smtp_port'), 
      Swift_Connection_SMTP::ENC_SSL
    );
    
    $connection->setUsername(sfConfig::get('app_email_username')); # gmail email
    $connection->setPassword(sfConfig::get('app_email_password')); # gmail password
    
    $mailer = new Swift($connection);
    $message = new Swift_Message("Your subject goes here. OH HAI!");
     
    $message->attach(new Swift_Message_Part($htmlMessage, 'text/html'));
    $message->attach(new Swift_Message_Part($textMessage, 'text/plain'));
     
    // Send,
    // try and catch
    try {
      if (!$mailer->send($message, $to, sfConfig::get('app_email_username'))) {
        throw new Exception('mailer error');
      }
    } catch (Exception $e) {
        sfContext::getInstance()->getLogger()->info(
          "Caught swift send error exception:\n" .  
          $e->getMessage(). " ".
          $e->getFile() . ": Line ".
          $e->getLine() . "\n", $e->getTraceAsString(), "\n"
      );
    }
              
    $mailer->disconnect();  
    
  • sfGuardPlugin: The Extra Documentation

    Hey Folks,

    The Symfony project has a section called sfGuardPlugin Extra Documentation.

    It’s worth a read, especially the part about using the sfGuardUserProfile calls.

    The docs haven’t been updated since March, so if something isn’t working, please refer to my previous blog post on installing the sfGuardPlugin.

    I’d like to state that personally, there isn’t really the right way to do this. Sometimes you already have a table that has a username and password. You can skip using the sfGuardAuth password tables by doing the following:

      sf_guard_plugin:
        algorithm_callable: md5
        success_signin_url: @homepage
        profile_class: sfGuardUserProfile
        profile_field_name: account_id
        check_password_callable: [Account, checkPassword]
    

    The important line here is check_password_callable, where you are telling symfony to use the Account table and to use your own checkPassword method.

  • The Friday Five for This Weekend the 19th of September

    1. I’m going to LapPoP on Sunday to meet the maker of ICanHasCheezburger and Tablefy.
    2. Have you played with getting Yelp on the Command-line using Ruby? I have using yelp.rb which is a script I made.
    3. Film Night at Dolores Park might be a good bet if weather turns out to be pleasant.
    4. I’ll be reading some philosophy at the Reverie.
    5. Ponder this quote from Jaspers:

    from Karl Jaspers, in “Man in the Modern Age” (1930/1)

    Part V: What Mankind Can Become

    2. Maintenance of Selfhood in the Contemporary Situation

    Technical Sovereignty

    Technisation is a path along which we have no choice but to advance.
    Any attempt to retrace our steps would mean the life would be rendered
    increasingly difficult until it would become impossible. Invective is
    of no use here; we have to overcome. The world of technique, therefore,
    must be taken as a matter of course; so much so that all that goes on
    within it must lie almost outside the field of active attention. As
    contrasted with the need that all our activities must be more
    successfully grounded upon advance technique, we have to cultivate our
    awareness of the non-mechanisable to the pitch of infallibility. To
    render the world of technique absolute would be destructive of
    selfhood, and therefore our sense of the value of technical achievement
    must be permeated with a new significance.

  • How Will the World’s Financial Crisis Affect Web 2.0?

    During the last tech down turn, I was unemployed for about a year and ate into most of my savings. The first job I was able to get was stacking candles at a store for minimum wage. I had a lot of trouble making ends meet, and often spent nights worrying if I would make rent. I swore to myself that I’d never be in such bad shape again.

    In 2003, my poverty was something I’d like to believe I chose, and romanticized, perhaps because it wasn’t hardcore poverty. I knew others who fared worse, who never enjoyed the first dot-com gravy train, or who had bought homes in 1999 thinking that they’d always make $80,000 a year as a secretary. I made half that as a coder in 1999 because I didn’t believe it was right to make that much. Now, I’ve tossed that idealism aside and really am out there to make as much as I can get.

    It’s 2008, and I see that the douche bags of Wall Street through their greed have managed to get my attention in the form of a world financial crisis. I see that most Americans by not saving have also created a mole hill out of things. I see that we cannot believe in an economic system of rational agents because now we are not.

    The big take away is to save, save, save.

    Just like in Fight Club, the things you’ve owned are now owning you.

    The big question: How Will the World’s Financial Crisis Affect Web 2.0?

    In what structured ways will the world around us crumble?

  • 16 Years of Telnet Access to The WELL Ends on 9/24

    When I logged onto the WELL via SSH today, I got the following message of the day:

       You own your own words. This means that you are responsible for
       the words that you post on The WELL and that reproduction of those
       words without your permission in any medium outside of The WELL's
       conferencing system may be challenged by you, the author.
    
       ******************************************************************
    
          Support is in the wellcome conference, at (415) 645-9300,
          at http://www.well.com/help or by mail at helpdesk@well.com 
    
       ******************************************************************
    
       Access change:  Effective Wednesday Sep 24, we will start blocking 
       telnet access to well.com, and will require that all shell users 
       connect to well.com via an SSH client instead of a telnet client.  
       If you're still using telnet for Unix and Picospan sessions, see 
       news.3126.1638 for details on updating your security.
    
    

    I applaud the security change that is coming to the WELL, but it is also a sign that the Internet will never be a safe place.

  • Stack Overflow Answers Your Hardest Tech Questions

    From Jeff Atwood, the blogger who gives you Coding Horror, your hardest tech questions get answered at Stack Overflow. I wanted to see if somebody had coded a way to edit text fields in Vim, and bam, there was the answer.

    picture of stack overflow
    The idea behind Stack Overflow is that the collective wisdom of technologists will always be better than the experts.

    So far it has surpassed my expectations on the quality, obscurity, and speed at which tech questions get answered.

    Will entropy, otherwise known as spam, kill this site? Or is its reputation system good enough to prevent that?

    Has anybody stumped Stack Overflow yet?

    As always, your comments are very welcome.

  • Yahoo’s BOSS API Example and Notes on Yahoo’s Hackday

    For Yahoo’s hackday, I was able to finish up this script in Ruby that returns back search results from yelp and chowhound from Yahoo’s BOSS API. The great thing about it is that you can hit the API an unlimited number of times!

    Here are a few notes that should help anybody the next time they attend a hackday – Yahoo’s or anyone else’s:

    • The night before install libraries you think you won’t need. I really wish that I had prawnto installed. I got mired in prawnto idiosyncracies, and was out of the race pretty quick.
    • Good coders are fast. According to Eran Lahav-Hammer, one of the authors of OAuth, good coders can code an OAuth implementation in the language of their choice in less than one day. Are you a good coder?
    • Have fun! It’s a pretty rare opportunity to have so many folks in the industry in one spot.