Blog

  • Codebelay Needs Bloggers

    Hey Folks,

    I’ve been following the advice Jason Calacanis laid out about blogging as close as possible. He was asked what was the sing most important step in monetizing a blog network and he answered, “Create world-class content every day for a year.”

    I confess that I have not been that religious about posting, but I’ve been posting consistently during the week. Unfortunately, I’ve started doing freelance work and don’t have as much time as I’d like.

    I want to continue to provide really interesting, quirky and beyond the bleeding edge articles about the tech world. We would be the kind of team that already has been messing around with CouchDB, Erlang, or newLisp way before others would think it was cool or profitable. We would also be the sort of team that avoids the false and gilded bullshit that creates a zombie army of fanboys or fangirls. Seriously, that stuff is lame and counter productive. Instead, we would be a little Oasis of exploring and humanizing technology.

    If you want to be:

    • part of something where you can say what you think about the tech industry
    • like to write about tech
    • want your writing to be a part of a cool community

    Then I am interested in you.

    My site has been growing since following Calacanis’ advice, but I’m realizing that I can’t do this alone.

    Please send a writing sample and why you’d like to join in the fun that is CodeBelay.

    Cheers,
    Barce

  • Redboxing with Rails: Modal Windows FTW

    There’s a great lightbox plugin for Ruby on Rails called Redbox. Unfortunately, it doesn’t work out of the box, but here’s the patch for redbox.js:

    Replace:

    Element.setTop(window_id, boxTop);
    Element.setLeft(window_id, boxLeft);

    With:

    $(window_id).style.top = boxTop + “px”;
    $(window_id).style.left = boxLeft + “px”;

    Remove or comment out:

    Element.hide(‘RB_loading’);

    Remove:

    <div id=”RB_loading”></div>
  • Where Are The Tech Jobs Right Now? In Booze and Legal

    I wrote this to the San Francisco PHP Meetup List. I am posting it here because in a month or so I know a huge portion of you will be looking for work in the tech area.

    NYSE:IRM

    Subject: Re: [php-139] Headhunters/Recruiters: Some feedback please. 🙂
    From: barce
    Date: October 31, 2008 12:06:08 PM PDT
    To: SF PHP Meetup List

    Let me comment on what’s going on.

    I will tell you about two types of layoffs, and then two types of opportunities that I am benefitting from right now.

    1. Scapegoating Pathology in Layoffs. This is where staff gets laid off to “fix” a problem, and the problems are still there. Sure, they have one less mouth to feed, but they got rid of the wrong person. How can you tell? The problem is still there. Most recruiters have a hard time filling these spots b/c turnover is high. No amount of technical skill will solve this problem. You need people skills if you’re gonna fill this role.

    2. The Invisible Hand Layoffs. The company ends up with more capital and gains more worker productivity because the invisible hand is at work.

    I would say that from the Web 2.0 companies that are laying off people it’s 50/50 . If you are really hard up for a job, then your best bet is with a company that’s done scapegoating layoffs.

    That is the opportunity #1 that I mentioned, and examples of this are meevio.com which loses a lead every 3 months and Mahalo. Calacanis fired and is now looking for workers again. Talk about scapegating!

    Opportunity #2: Litigation Support. Right now a lot of companies have a financial strategy to stay alive, and that is sue. During this economic downturn you will see companies like DTIGlobal, Iron Mountain (NYSE: IRM) and other litigation support companies do well. Iron Mountain is already doing really well. I have a client in litigation support where I do light sysadmin work.

    Get a job in these areas. Recruiters won’t know about them because they are still trying to fill jobs where there is a scapegoating pathology.

    I wish you all the best of luck,
    Barce

    PS Beer is doing well right now, too, so look for tech work in the beer industry, or hell, do what I did right out of college, sell beer. It is fun work!

  • A Quick Guide to Noobwatcher

    curl -O http://svn.collab.net/repos/svn/trunk/tools/client-side/showchange.pl
    mv showchange.pl $HOME/bin
    svn co http://codebelay.com/noobwatcher
    mkdir watched_repositories
    cd watches_repositories
    cp $HOME/noobwatcher/trunk/noobwatcher.rb .
    svn co

    Create and edit a settings.yml file. Mine looksl like this:

    path: /Users/barce/nooblive/trunk
    repo: http://www.example.com/the_repo_I_am_watching
    diffs: /Users/barce/nooblive/diffs
    twitter_email: the_twitter_email_that_notifies_you@example.com
    twitter_password: the_password_to_the_twitter_email_that_notifies_you
    twitter_recipient: your_twitter_account
    sleepseconds: 60

    Start noobwatcher:

    ./noobwatcher.rb
  • Digital Cupid: How to Put Technology to Work For Your Love Life

    Are you sitting alone at your PC or Mac reading this blog? That’s okay. I forgive you. In an age of overtime, job transfers, and clawing your way up the corporate ladder, no one seems to have enough free time any more for leisure activities like going out, having a drink, or, most importantly meeting new people to do these things with. But believe it or not, with the aid of modern (and not so modern) technology, we can squeeze even this into our hectic lives.

    Let’s start with the obvious: computers. Not only can you check your email alerts from the comfort of your own cubicle, but there are online dating sites for everything from your own personal geekdom (SweetOnGeeks.com) to body type (LargeAndLovely.com) to any of the major religions on earth (JDate.com, ChristianSingles.com, and BuddhistOnlineDating.com just to name a few). Literally any kind of matchmaking site can be found with the right search engine. Even typing “flying spaghetti monster dating” into Google lands you a few interesting results.

    Evenamong online matchmaking sites there is great variety. At a site like Plenty of Fish, users are encouraged to not only fill out profiles but actively post in the site’s forums, which range in topic from relationship and dating issues to science and philosophy. (There are even a few active anime threads for the geek in you.) OKCupid offers its users a variety of fun tests and quizzes, and awards badges, such as “more
    independent,” “less old-fashioned,” and “more political,” that are displayed on a user’s profile, and can be used as conversation starters as well as a rudimentary screening process of a user’s personality. Both if these sites are free to use, as are countless others, so do not be dissuaded from joining the online dating phenomenon due to lack of funds, although there are also dating blogs which can help you in the world of dating and you can find at sites like www.groenerekenkamer.com/.

    Sellingyourself through online personals sites is not the only way to meet people through the internet, however. Couples are meeting and hooking up every day by posting on forums, joining newsgroups, exploring 3D virtual worlds (such as Second Life and Entropia Universe), and yes, even playing online games like World of Warcraft can help find you a mate. At least one young gamer proposed to his lovely lady at BlizzCon 2008, much to the delight and cheers of fellow congoers. (The happy couple originally met as rivals posting on RPGamer.com.)

    Basically, by being active online as you would be in real life had you the time (or in some cases adequate self-confidence), you can meet a wide range of people, many of whom you would not even have the opportunity to meet offline, so you can share romantic activities with these people including sex using accessories as a good anal vibrator for this purpose. The internet doesn’t just offer new ways to meet people, but ways to meet new kinds of people.

    But the internet isn’t your only avenue to a new and interesting social life. Due in large part to the high success rate of people meeting online, the more traditional print form of the personal ad is enjoying a resurgence in popularity, and should not be overlooked by the less computer savvy. Responding to an ad over the phone, though perhaps more daunting than email, forces a connection much sooner than digital communication, and gauging another person’s reactions and emotions is much easier through hearing his or her voice than reading words on a screen. It also forces you to maintain a conversation, while email sits in your inbox awaiting your attention.

    Printed personal ads offer just as much versatility as their online counterparts. Most newspapers across the country offer a personals section, which allows you to look locally, but there are also specialty magazines for various interests and religions that also run personal ads.

    Personal ads also, much like Twitter over LiveJournal, force you to be short, sweet, and if you can manage it, clever in hopes of catching that special stranger’s eye. Anyone glancing through a personal ads sheet can attest to the creativity used by many of its users, but this should by no means be a deterrent to the feint of heart. Personal ads are just another tool in your arsenal.

    In this on-the-go world, another old technology has come back to haunt us: the phone. More to the point, the rather passé telephone has been replaced by the more modern cell phone and text messaging. Yes, this includes the dating scene. For over fifteen years the Canadian company Teligence has offered social networking over the phone through services like Livelinks, Interactive Male, Fonochat, and a number of others.

    Now, sites like Match.com are getting into the phone business, too, with services like Match.com Mobile. Many sites are now combining online and offline options. Prime examples are Crush or Flush and Zogo, both of which users can access using their cell phones or PCs.

    Crush or Flush allows you to look at pictures and miniature profiles of singles in your area. If you like what you see, you “crush” them and hopefully make contact. If not, you “flush” them and move on. (People will not be notified if they are ever flushed, so you may surf guilt-free.)

    Zogo is perhaps the only totally free dating service for your cell phone (though this doesn’t mean your cell phone service provider won’t add on their own fees, depending on your terms of service). After searching through available profiles, you may add people to your favorites list, or invite them to talk to you. If you both agree to talk (via semi-anonymous text messaging provided by Zogo), you each receive a call from a third number to secure the anonymity of your phone number.

    Crush or Flush, Zogo, and their fellow SMS dating services are perhaps even handier than online-only sites, such as those listed in the above paragraphs, given that cell phones are more portable and get wider reception than even a laptop. Double bonus if your cell gets internet!

    Much like e-trading has done for the casual investor, modern technology adds far more than serendipity and well-intentioned coupled-up friends to our dating arsenal. Much as we might sometimes wish it otherwise, there really are no longer excuses for not meeting people other than our own apathy.

  • Remove ^M characters and more with repl.bash

    Hey folks, this is a goody but quicky.

    First off, respect the character encoding of a file. I don’t know how many devs out there violate this rule, but if you’re like me and Joel On Software, you’ll agree that you should respect the character encoding of a file.

    If you happen to see that your file has gotten code page 1252 aka Windows-Latin 1 in it, then you’ll have a variety of random characters like ^M or ?~@~Y or ?~@~\ or ?~@~] .

    Well, I wrote a script that removes these guys and makes sure that the file format of Unix is respected. Here it is:

    #!/bin/bash
    #
    # By: barce[a t]codebelay.com
    # ——————-
    # this script replaces microsoft special chars with plain ol’ ascii
    #
    # usage: ./repl.bash filename
    #

    # replace ^M characters
    perl -pi -e ‘s/\x{0D}\x{0A}/\x{0A}/g’ $1

    # replace garbage with single-quotes
    # ?~@~Y
    perl -pi -e ‘s/\x{E2}\x{80}\x{99}/\x{27}/g’ $1
    perl -pi -e ‘s/\x{80}\x{99}/\x{27}/g’ $1
    perl -pi -e ‘s/\x{80}\x{9c}/\x{27}/g’ $1
    perl -pi -e ‘s/\x{80}\x{9d}/\x{27}/g’ $1

    # replace garbage with asterisk
    # ?~@?
    # e280 a2
    perl -pi -e ‘s/\x{E2}\x{80}\x{A2}/\x{2A}/g’ $1

    # replace garbage quotes with plain quotes
    # start: ?~@~\
    # close: ?~@~]
    # e2 809c
    perl -pi -e ‘s/\x{E2}\x{80}\x{9C}/\x{22}/g’ $1
    perl -pi -e ‘s/\x{E2}\x{80}\x{9D}/\x{22}/g’ $1

    # replace garbage hyphens with plain hyphens
    perl -pi -e ‘s/\x{E2}\x{80}\x{93}/\x{2D}/g’ $1

    # replace garbage with ellipsis
    perl -pi -e ‘s/\x{E2}\x{80}\x{A6}/\x{2E}\x{2E}\x{2E}/g’ $1

  • Getting Around the Politics of Subversion with git

    This is the nightmare scenario. You are working with a coder who overwrites your changes in subversion. You’ve told this coder once, twice, three times, “Hey, please don’t do that. Hey, let’s talk about your changes before you commit them.”

    But this coder for some reason thinks that he or she is the gift of the gods when it comes to coding, and continues to overwrite your changes.

    This is where git comes in. If I had learned about this feature of git and the idea of accepting or rejecting changes in git sooner, I would have avoided the whole nightmare of re-comitting code and lengthy merge debates.

    Most projects you work won’t involve the worst case above. Most of the time, there will be a great developing rule that says never commit bugs into subversion. But whenever you have to re-factor code and commit each line, branching and then later merging can be an issue in subversion, and it’s slow too.

    On a project that I’m working on now the client wants only good code in svn which is great, and so I’m using git with svn. I got this idea thanks to Jakob Heuser. Thanks, Jakob!!!!

    This is where git comes in. Here’s a quick cheat sheet and it assumes you are using GitHub:

    mkdir newlispoauth
    cd newlispoauth/
    git init
    touch README
    git add README
    git commit -m ‘first commit’
    git remote add origin git@github.com:barce/newlispoauth.git
    git push origin master

    Now we have to pull in changes from subversion:

    mate .git/config

    In the config file add something that looks like this:

    [svn-remote “newlispoauth/trunk”]
      url = http://codebelay.com/newlispoauth/trunk
      fetch = :refs/remotes/newlispoauth/trunk

    Now we’re gonna fetch the subversion repo:

    git-svn fetch newlispoauth/trunk
    git checkout -b local-svn/trunk newlispoauth/trunk
    git svn rebase
    git checkout master
    git merge local-svn/trunk
    git mergetool # if there are conflicts with the README file above
    git add README # if you had to make changes with the mergetool
    git commit
    git push origin master

    Now you are working with “master” and “local-svn/trunk”.

    “master” is for your changes to share with your team on git-hub
    “local-svn/trunk” is for you and where you push changes to subversion.

    You basically pull in changes from newlispoauth/trunk and do your work in local-svn/trunk.

    Let’s put the changes in master into “newlispoauth/trunk” and commit those changes to subversion:

    git checkout local-svn/trunk # you did commit your changes in origin right?
    git merge master
    git-svn dcommit
  • The Clean Slate

    One of the great things about America is that you can start all over again by moving to a new town, or by just simply doing the thing you are afraid to do.

    I had the offer letter in my hand. It was for a profitable company that just secured enough VC to outlast the Great Depression, The Sequel. Experience told me that this was the most sensible thing to do, so I signed the offer letter. I would be making more money that any previous job I had, and the position would be this cushy middle-ware coder.

    But something nagged at me. So much of life is an illusion. For some reason, I felt that the secure, money-maker of a job was an illusion. I also felt that I was taking myself away from the game of business where I would right all the wrongs done to me. I am still aching freshly from some wounds that people gave me; people who dishonored me by claiming I was a coder of poor quality when just weeks before they were saying I was the best of coders. I worked weekends for these people when none of the other developers would. I volunteered the most for being on-call, and they dishonor me.

    Anyway, dear Readers, you in the industry know who these dishonorable people are, and because I decided to take the harder road of freedom, I am free to speak of them here. Why? Because in a world where faint praise is damning, there is no amicability in that. Because I will never, ever use the dishonorable as a reference. I will only use honorable references from honorable men, if I have to, but I really just want to free myself from references altogether. I will hack things out project by project and by the skin of my teeth, and be free.

    I turned the offer of security down.

    I chose total personal freedom.

    The crumb of freedom tastes better than the banquet of slaves.

    I have been learning so much in the situations that I’ve been in these past few days.

    My code is my reference.

    What would you choose? Security or Freedom?

  • How the FBI Would Have Tracked Palin’s Hacker If He Were L33ter

    It’s been a few weeks since Palin’s “hacker,” David Kernell, got caught because he left a reference to ctunnel.com in the screenshots of Palin’s email.

    Enjoy Jail, Punk!

    What if David Kernell was able to remove the references to ctunnel.com? What would the FBI have to do to catch him? And how would a would-be hacker avoid detection?

    1. The FBI would have to obtain records from Yahoo and 4chan, and these records would hopefully reveal the IP addresse(s) that accessed Palin’s account.
    2. The FBI would also have to search data retrieved from a descendant of Carnivore, a wiretapping software used for the Internet c. 2001. Such data could reveal the MAC address of the hacker. The MAC address would lead to the place of purchase for David’s network card.

    Even if David Kernell photoshopped ctunnel.com from the screenshots of Palin’s email, the FBI could still have catched him in two ways:

    1. The IP address at Yahoo or through Carnivore-like software would have led the FBI to ctunnel and then to David’s IP address.
    2. The MAC address gotten through Carnivore-like software at David’s ISP (which is not really likely) would have led the FBI to the store at which David’s computer was purchased. Something like “ping davids_IP && arp -a” would have to be run on a LAN level.

    So how else could David have avoided detection?

    1) He could have chained proxy servers.
    2) He could have used a combination of p2p networks like the ones used for downloading movies and music to get to the web pages.

    But even then, the FBI would still be able to catch him.

    The FBI could still log name server look ups, the very techology that allows your computer to see www.fbi.gov as 64.212.100.43. If a log of name server look ups matched the time stamps of when the hacked pages were accessed, then the FBI would have a strong reason to believe that the hacker was using the ISP that provided the name server lookup, and from there get to David.

    Okay, okay. Let’s say that David disabled name server lookups. Could the FBI catch him if he went as far as that?

    If somehow his MAC address got leaked that would lead right to whoever purchased his computer’s network card. If he paid cash for his network card on the black market, or Craig’s List, then the FBI would be on a wild goose chase.

    I think if he took all the precautions above, the FBI would be at a total loss for tracking Palin’s Hacker if he were l33ter.

    Thoughts?