Developers

posted 05/13/08 by Rick Webb

We have some really awesome developers here. And they do awesome things.

Here are some recent posts from our employees about Developers:

Adding Custom Javascript and HTML to Textile Blog Posts

Here at The Barbarian Group, we use Textile for our blog to help make publishing fast and easy. But occasionally there are blog posts in which you want to have more control over the markup or you want to embed more sophisticated web objects than simple text and images. After struggling with several tough posts, I’ve spent some time learning how to work around these limitations. In this post, I’m demonstrating how to embed custom javascript code into a Textile blog post.
What happens if you simply add javascript to your post?

It won’t work, because any time Textile encounters a less than (<) or greater than (>) sign, it treats it as an html tag and acts accordingly. Fortunately, you can encapsulate your markup within <notextile></notextile> tags, and your code will remain entirely unadulterated by Textile.
To demonstrate this, below is an example of a simple bit of code that toggles the visibility of text sections using javascript.
Working Demo


Section 0 Heading
Section 1 Heading

(click to read more)

Vitamin T Digital Career Infographic

The life of a digital creative is no walk in the park. Cranky clients, fire-breathing creative directors, and the occasional warping from design work to development (with a side trip into content delivery); these are just a few of the everyday trials and pitfalls of the industry. After a while, the whole thing can start to feel surreal, almost like a video game.
We wouldn’t be video game connoisseurs worth our Triforce if we didn’t do something to try and help. So along with our friends at Vitamin T, we’ve provided a walkthrough to help put the world of a digital creative into perspective.
It’s everything you’ll need to help navigate the careers and skill sets across design, development and content delivery. It is important to begin with a character that will maximize your talents, because even though you may end up knee-deep in code eventually, attacking development with the wrong skills at the wrong time can be an intense challenge. But don’t worry. There are infinite possibilities to explore, and a few odd secrets, as well.

Principles of interaction design: #6 Don't be a dick

I recently spent the weekend with some friends whose teenage daughter has lost all but a shred of her vision. It is very likely that eventually she will be totally blind. I was amazed to see how well she adapts to a sighted world but still couldn’t help but reflect on the designs I create and wonder whether she can experience them fully.
Around the time of the last internet boom, bubble and burst the discussions I remember weren’t about web standards, but web accessibility. Flash was extremely popular but because it was a plugin that didn’t expose it’s code structure to the browser, screen readers for the blind couldn’t make any sense of it. As far as they were concerned a Flash object was no different than a single static image.
Today I am shocked to find that many of the younger designers I talk to aren’t aware that the ‘alt’ tag assigned to images in HTML was created so that screen readers could describe the image to vision impaired users. It seems to be thought of as another place to add marketing. A branded opportunity for when the mouse hovers an image.
Now in the wake of CSS3, HTML5, and closer browser alignment to standards the notion of ‘responsive web design’ seems to be the discussion of choice. I’ve even blogged about it. Responsive design is a great thing as it brings accessibility issues to the forefront. Specifically the accessibility of smaller screens, but combined with the latest coding practices the environment for visually or auditory impaired users is now at it’s greatest.
As interaction designers, coders, and creatives we need to be aware of everyone who may want to use our designs. We need to consider smaller screens, the elderly who rely on hearing devices, and a blind teenager who one day wants to be a writer and ask ourselves, is this design good enough for them? Am I being a dick?
Don’t be a dick.

Gastrodamus for Android

Announcing Gastrodamus for Android

I’m proud to announce the release of The Barbarian Group’s first android app, Gastrodamus. This of course is the Android version of the food truck tracking iPhone app that was released last month. It has all of the same features and food trucks that the iPhone version has, but now works on your Android 2.1+ devices.

My Very Own "Dropbox"

I have a certain… paranoia when it comes to “cloud” services. Especially the likes of Dropbox, iCloud, etc. The services that “just work.” However, I recognize the value of these services and would actually find them extremely useful. So one day I thought to myself, “Man I really need to solve this problem of having files that I need for my personal life tossed all across four (yes 4) computers.” And then I thought, “Maybe I should just give in and use Dropbox…” Of course then I read things like this and this. It isn’t that I have top secret military project files or anything, or that I have a bunch of illegal business goings on that I need to hide from law enforcement, but it is personal information. Stuff that anyone would care to have backed up in a safe, secure location, like banking information, taxes, passwords, etc. Stuff that you would want access to at the drop of a hat from any computer you were on. So…
I’ll make my own dropbox. Using my own server, and free open source software. Here is the process.
First you’ll want to have a server setup and hardened. Hopefully you’re able to do that because the process is too long for this guide. My personal dropbox is made up of 3 pieces of software, git, gitosis, and SparkleShare. You’ll also need to have SSH configured to use authentication keys instead of passwords.
For sake of ease, let’s say we’re using a 10.04 Ubuntu fully updated and patched server. First we want to install git so run:
sudo apt-get install git-core
Now that we have git installed we can grab the latest version of gitosis:
cd ~/

git clone git://eagain.net/gitosis.git

cd gitosis
Now we have the source for gitosis downloaded we need python and setup tools:
sudo apt-get install python-setuptools
And now, from the gitosis directory, we’ll install gitosis:
sudo python setup.py install
Cool. Next we need to set up a user to contain our repos and manage our ssl certificates. This user can be whatever, but for sake of ease in this tutorial we’ll just call it “git.” The home directory can be where ever you choose as well, but again, for sake of ease in this tutorial we’ll just put it in /home/git.
sudo adduser --home /home/git --group --system --shell /bin/sh --disabled-password git
That’ll create the user, the group, and a homefolder. It will also disallow password authentication which means we’ll have to use key authentication. Now we’ll have to add our first public key to gitosis so that we have admin access. First copy the public key of the machine you are working on up to the server and run the following where “my_kefile.pub” is your public key:
sudo -H -u git gitosis-init < my_keyfile.pub
That command will load the git user $PATH (important because we are running the gitosis-init binary) and run the gitosis-init binary as the git user. That will create our first git repo, gitosis-admin, and add our key so that we have access. Now a little cleanup. Every other gitosis install guide will tell you that you need to make sure the gitosis-admin post-update hook needs to be made executable. It has always been fine for me, but just incase run:
sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update
Alright! That is it for server setup. Good job. Let’s head back to your workstation now. Hopefully you have git already installed on your workstation, but if you don’t head here and download the appropriate installer. Crack open your terminal application and run the following:
git clone git@your.server.com:gitosis-admin.git
This will clone the gitosis admin configuration down to your computer into the directory you are currently in. If you cd into gitosis-admin and have a look around you should see a “keydir” and a “gitosis.conf” file. The keydir stores all the public keys that will have access to your git repositories. The gitosis.conf file is where you set up and configure access to repositories.
First let’s check out how repos are set up. Open up the gitosis.conf file. You should see the default configuration there already, it looks something like:
[gitosis]



[group gitosis-admin]

writable = gitosis-admin

members = nick_macbook
the [group ..] definition is an arbitrary definition, it can be whatever you want. Next “writeable = ... ” defines the name of the repository that is writeable by the group, in the default case the gitosis-admin repo. Finally “members = ... ” defines the keys that are members of the group, they are the filename of the key minus the .pub extension. So in this case I have a file in the “keydir” directory called “nick_macbook.pub.” I’ve made it a member of the group “gitosis-admin” which has writeable permissions on the repository “gitosis-admin” (write-ability implies read-ability in this case).
Now let’s set up our dropbox repo, add something like the following to gitosis.conf:
[group dropbox]

writable = dropbox

members = nick_macbook
Save the file and head back to terminal and run:
cd gitosis-admin

git commit -a -m "added dropbox repo"

git push
We just entered the gitosis-admin repo, committed the changes we made to gitosis.conf, and then pushed them up to the server. By doing that we created a new git repo that will become our “dropbox” folder. Sweet!
There is a lot to gitosis, but just know that you can add more keys to the keydir, then add the file names without the .pub extension to the “members” definition of any group to grant that key access to the group’s repository.
Finally let’s set up SparkleShare. Once you’ve downloaded the app and copied it to your applications folder, fire it up. After you do that SparkleShare will ask you to set up a remote folder. The “Address” will be your server’s hostname, and the foldername will be the name of the repository we just set up, in this case it is “dropbox.git.” As long as you have your keys set up properly in gitosis, when you hit “sync” SparkleShare will create a new directory in your home folder and boom! You’ve got a drop box. Add any files to that folder and SparkleShare will automatically commit and push them up to your remote server. It’ll also periodically pull down whatever the server has that the local working copy doesn’t. Neat eh?
A Couple Notes
You’ll obviously have to configure your firewall to allow traffic on port 22 for this to work. If you’re having trouble pulling down the repo in SparkleShare, did you remember to push your gitosis conf up?

Setting the swf Base Directory in HTML

Have you ever completed a flash project and started testing it online only to realize that the swf is looking for assets either in a different directory than the one you specified? Or that the folder that you have all your media stored is not in a relative directory like it was when working on it locally? There’s an easy solution that can be implemented without messing with any actionscript code.

Blackberry Enterprise Server

I recently set up a Blackberry Enterprise Server (BES). <sarcasm> What a fun adventure that was! </sarcasm> Installing and setting up BES is riddled with potholes and stumbling blocks, so I figured I’d share my insights.
I used these versions of os/software:
Windows Server 2008 R2
Blackberry Enterprise Server Express 5.0.2
Surprisingly, Windows Server 2008 R2 needs to be completely unpatched! This took the most time to figure out. I started with a completely patched version of Win2k8 and dialed back the patch level until BES actually started working. The problem is with the BES admin service. Any updates to Win2k8 starting with and following SP1 will cause the service to crash over and over and over again. So Win2k8 R2 it is!
Next you need to set up Active Directory. I won’t go into detail here, since it should be trivial and there are plenty of other tutorials that will be better documented and detailed elsewhere. But you start by launching Windows PowerShell and typing “dcpromo.”
After AD is all set, you’ll need to set up Exchange (if you don’t already have an Exchange server), since we don’t use Exchange I set up MAPI to connect to our MX.
Now onto BES! First you’ll need to request a license, which is free if you’re using the express version (http://us.blackberry.com/apps-software/business/). You’ll get an email eventually with a link to download and a site to pick up your license. Installation after that is fairly straight forward. You’ll have to set up a configuration database. You can use an already set up MSSQL server or BES will install MSSQL 2005 Express for you.
The only other gotcha comes towards the end of the installation process. You have to select wether you want BES admin to use Windows authentication from AD or using BES admin service authentication. If you don’t want to continue to use AD after BES setup (you don’t have to), then use BES admin service authentication.
After that you’ll start the BES services, try logging into the admin console. If you’re lucky you should see a log in page. Start adding users and activating devices!
If you weren’t so lucky, well lets move on to some troubleshooting first.
Troubleshooting
  • Windows firewall might be blocking the port you set the admin service up on, check that first and make sure it is open.
  • Try to start the BES admin service manually from the services panel, does it start?
  • Check the Windows event log, is BES admin crashing? If it is your patch level is too high.
  • Is IIS running? Did you set up BES admin on a port IIS has reserved? If so, kill IIS and try starting BES admin, does it work now?
Tips
  • Take your time, write down your process.
  • Don’t be afraid to start over.
  • The firewall really only needs TCP port 3101 to opened for outbound, initiated, bi-directional traffic. Otherwise you can lock it down pretty tight. Which you want to do because you’re tossing an unpatched Windows server into your mix.
Those are all my tips for setting up a Blackberry Enterprise Server, good luck!

New Stuxnet Thoughts

via Forbes
Some new, very interesting, theories about the origins of Stuxnet.
As far as China goes, I’ve identified 5 distinct ties to Stuxnet that are unique to China as well as provided a rationale for the attack which fits China’s unique role as Iran’s ally and customer, while opposing Iran’s fuel enrichment plans. There’s still a distinct lack of information on any other facilities that suffered damage, and no good explanations for why there was such massive collateral damage across dozens of countries if only one or two facilities in one nation state were the targets however based solely on the known facts, I consider China to be the most likely candidate for Stuxnet’s origin.