Author: barce

  • What Projects Are In The Works

    1. I wrote Noobwatcher.com as an emergency response to a misguided development process and as a solution for when the sysadmin won’t let you configure subversion the way the dev team and the company as a whole needs it.
    2. I wrote the number one Google entry for installing the sfGuardPlugin as of this writing, and wow, they still weren’t happy with my work.
    3. I worked closely with symfony developers to figure out some complicated undocumented symfony issues such as formatting errors in forms. Thanks, Dustin!
  • Beware the Recruiter Bait and Switch: Get References!

    There’s a slimy bait and switch tactic that’s been pretty common this year, and it’s the recruiter bait and switch. They send you a letter that looks like this:

    Dear Victim,
    
    Nice to find you on linkedin. I'm contacting you as your work experience looks
    like a good fit for roles at AwesomeCompany.com .
    
    Cheers, Slimy Recruiter
    

    Then they tell you that the job that they were originally trying to fill is gone, but they have other jobs available at SlaveLabor.com.

    The sad thing is that if you dig around, you find out that these recruiters never had a relationship with AwesomeCompany.com and are really just working for SlaveLabor.com .

    Takeaway: Get references from your recruiter of people that have placed.

  • 3 Ways to Green Your Office

    These 3 steps can easily green your office:

    1) Restrict your paper usage. Ya, I still use notebook paper, but I didn’t use the printer to print out a single sheet of paper in September. September should be “No Printing Month”. 😀

    2) Buy carbon credits. Your servers, laptops, electronic gadgets, cars or buses carbon emissions can be offset through carbon credits. A site like myclimate might spend the money on algae in the sea for more oxygen.

    3) Go Solar! With the Solio Charger for your iPhone, or solar backpacks from Voltaic Systems, you don’t ever have to plug into the grid again… as far as computing goes.

  • 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?