Archive

Archive for the ‘Technology’ Category

Gattica & RVM 1.9.2 NameError:

December 5th, 2011 No comments

NameError: uninitialized constant Gattica::Auth::VERSION

If you find yourself running into this error, you’re probably running Ruby 1.9.2
I don’t know why this is the case, but Gattica works fine without alterations with 1.8.7 but throws this error on 1.9.2

In such a scenario – do the following

Find the file auth.rb, it’ll be in some folder. I use RVM so its in the following path for me :

.rvm/gems/ruby-1.9.2-p180/gems/gattica-0.4.3/lib/gattica/auth.rb

To this file, add the following line

VERSION = '0.3.4'

That’s it. You need to add it prior to Line 14. Before module Auth

Categories: Technology Tags:

How I handle email.

December 5th, 2011 No comments

I get a ton of email, and I find that every time I get one, I must check it.

Here’s how I’m dealing with it thus far.If you use Gmail.Google Apps in conjunction with a smart phone this will likely work for you too.

First – turn on Sanebox : this alone is a lifesaver. Here you can take a shortcut, and just hand your inbox over to @SaneTop/ @SaneBox – what that means is that your inbox will only ever see emails that are important. I don’t do well for the following reason -

Second Turn on OtherInBox : This will go through all your emails and classify them (shopping, coupons, shipment notifications, social media, business, travel etc.)

Third on your phone do the following – (this is specifically for an Android phone) turn on sync for label :@SaneTop. Then turn off notifications for everything other than @SaneTop.

That way your phone only ever interrupts you for important emails, and leaves you alone the rest of the time. At the end of the day open up your inbox and see your neatly classified unimportant emails, and decide what to do with them.

2 quick notes : One – You MUST turn off auto-archive in OtherInBox for this to work as seamlessly as I am describing.

Second – Sanebox works significantly better than Priority Inbox, although I’m not sure why. This is merely anecdotal evidence, but SaneBox has never been wrong. I’ve trained it to move things form Important (@Sanebox) to Very Important (@SaneTop) but its never had false positive or missed a truly important email.

Categories: Technology Tags:

On Entrepreneurship

July 19th, 2011 No comments

Paul Kedrosky – The tilt thing…

Entrepreneurship is and should be irrational. You are taking on huge risks, showing immense ego, and trying something with an absurdly high failure rate. But it at these moments when it feels like you’re nuts not to try being entrepreneurial — the Valley being on “tilt” — that we have an outside chance of resetting the base rate at which companies get created in this country. While I tease people about it on a regular basis, especially journalists-turned-entrepreneurs, I wouldn’t have it any other way. Other than maybe the Harvard MBAs. (I kid. Mostly :-) )

Steve Blank at SXSW… to a roomful of future entrepreneurs. I’m paraphrasing.

You’re all insane. There are ten of you that will exit for about 10 MM Dollars. There’s 2 of you that will exit for more than 100 MM Dollars.

He paused for a beat, and then continued.

Right now, every one of you is feeling sorry for the other 385 people in this room.

Categories: Business, Technology Tags:

Using RVM & Ubuntu

June 28th, 2011 No comments

If you’re using RVM and attempting to setup a fresh server, do not forget to do the following

$ rvm package install readline
$ rvm package install zlib
$ rvm remove 1.9.2
$ rvm install 1.9.2

Seemed to solve most open issues for me.

Also, you need to system install somedev libraries. For instance I needed to run the following because bundle install failed:

sudo apt-get install libsqlite3-dev, libreadline5-dev, libncurses5-dev

That last statement btw – solves most problems with RVM and readlines. After that you can follow the directions on beginrescueend around readline
.

Categories: Technology Tags: , , , , ,

Server side facebook login status

June 28th, 2011 No comments

Was fiddling with the facebook API last night for something, and came across a strange gap.

There doesn’t seem to be an easy way (from the documentation) to get a server side loginstatus for the individual. This isn’t exactly an enterprise app I was building, was just checking to see if I could get something up and running quickly, when I came across this issue.

Let me describe the problem, and how I solved it, but it might not work for all.

The issue is simple – how can I tell, server-side, if someone is logged into facebook or not.
There are two flavors of logged into facebook

    logged in, but not known to my application
    logged in, and have authorized my application to do X,Y & Z

Scenario 1 is even more perplexing, but I’ll get to that in a second.

In scenario 2 – if you already have the users auth_token, then, with every call that you want to protect non logged in users from making, you can ask for some non-public information from the facebook Graph API. When facebook denies you that access, the user has gone offline, and you should log them off.

However, let me add in a twist, what if you have asked for offline access. In that scenario, facebook doesn’t expire the auth_token, and my proposed solution above doesn’t work.

What’s more perplexing about this is that there used to be a solution for this in the Facebook_Connect (now deprecated) API.
There was https://facebook.com/restserver.php which when sent the right auth_token, and method could return auth.getsession.

This might still work, but there is no reference to it in the documentation anymore, and the PHP SDK specifically refers to it as the “old” method. I’m going to assume things labeled in that manner aren’t going to survive very long.

So, this leaves me with only the JDK API that references anything about getLoginStatus. How do I use that to work with the rest of my application that is entirely server-side code (in Rails)?

Well, the answer is I don’t really.

Here’s what I did
Session outside of facebook’s session
I create and use my own session for the most part. The only way to start a session is to authenticate into facebook, but assuming you give me permission, I have offline access and can keep accessing your fb data. When the user wants to do something “sensitive”, I run the following script at the top of the page

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId : 'YOUR APP ID',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});

FB.getLoginStatus(function(response) {
if(response.session) {
fbCheckUserPerms();
} else {
//no user session available. Either, you don't know them, OR, they aren't logged into facebook.
if(response.status == "notConnected") {
// They are logged into facebook. Redirect them to a page that proposes they authorize your app, and tells them why.
alert("But is logged In");
} else {
//They are no longer logged into facebook. Redirect to a page that destroys the current session
}
}
});

</script>

Note, that this script is a little more than needed to make the solution work, but it also helps with scenario 1 from above. They are logged into facebook, but unknown to me. In that case, I take them to a page that describes the value proposition of my application and personalizes the page with the Registration & Login button social plugin.

If they are not logged into facebook, I forward them to a page within my application that destroys their session, and then forwards them to the login screen.
Not the most efficient way by a stretch, and clearly not all server-side, but I can make that work for now,

One thing to be careful of. If they are already on a sensitive information page – and then log out of facebook in another tab, just running this at the top of the screen might not be enough. You might have to rerun this script prior to submitting whatever it is that you don’t want to let them do when they aren’t logged into facebook.

M app doesn’t allow for much of this, so I’m fairly safe, just checking on page load.

RVM

June 25th, 2011 No comments

In order to maintain different versions of Ruby, Rails and Gems on your machine, nothing works better than RVM.

Ruby Version Manager also allows for different versions of rails, and gems, and you can switch simply by throwing in
rvm system

Or to create a different ruby/rails environment follow Wayne’s Gist here, reproduced below for posterity.

This example shows how to setup an environment running Rails 3 under 1.9.2 with a ‘rails3′ gem set.
∴ rvm update --head
# ((Open a new shell)) or do 'rvm reload'

# If you do not already have the ruby interpreter installed, install it:
∴ rvm install 1.9.2

# Switch to 1.9.2-head and gemset rails3, create if it doesn't exist.
∴ rvm --create use 1.9.2@rails3

# Install Rails 3 final
∴ gem install rails

# Check to see we now have Rails 3
∴ rails --version
Rails 3.0.0

After you create a rails app, remember to run bundle install – and you’ll have all the necessary gems as part of the appropriate rvm version.

Categories: Technology Tags: , ,

The business of music… Convenience and scarcity.

June 21st, 2011 No comments

Music faces crumbling record sales, and all time lows in terms of physical goods sold.

For now, let me make the hypothesis that music is merely a specialized form of content. If we are willing to accept that premise, we can proceed to see if the path of content at large can help explain the trajectory of music in particular.

Money money, the mighty dolla dolla
Got to get my grind on, grind on, grind on
I don’t wanna be broke no more
- Bone Thugs n Harmony in Money Money

Content has been on a long and fairly steady march towards “wanting to be free”. From the creation of the printing press, to blogger, creation of content was being democratized further and further. More and more tools emerge every day to empower content creation – including but not limited to blogger, tumblr, wordpress, and any number of other publishing platforms.

Distribution of content has also gotten consistently easier with various technologies for syndication emerging, and then becoming the invisible force behind the features and tools we use everyday (think ~ RSS). Same with consumption – you can read content almost anywhere, and everywhere – including mobile devices, e-readers, almost any connected device possible. We even have time-shifting technologies like Instapaper to allow us to consume our content when we desire, and Readability that alters the form of the content before we consume it.

Everyday is my day I’ma do it my way everyday.
Everything about me what they love about me everything
Everywhere that I be feel VIP baby
- Fabolous in Everything, Everyday, Everywhere

So we’ve established that content today wants to be available everywhere, anytime we want it, and in any format we want it. There are very few limits around where and how we consume our content, and most attempts at controlling how, when, how much, and where we consume our content have been met with ridicule.

If we return to the earlier hypothesis that music is merely a specialized form of content – then we can safely assume that music will follow a similar trajectory and wants the same things that content does – to be available everywhere, anytime, and in any format we want it. So long as it is convenient, and customers get the above described ability, they will in fact pay for content. If the content is scarce, truly scarce – customers will pay significantly more – they will pay cash and attention . The trick is how to make content scarce – and how to monetize their attention.

Creation of music is becoming easier and easier every day. New ways to consume music appear every day – most meant to help satisfy some observable customer behavior, or arcane studio requirements etc. However, in the end, the best (read most convenient at market price) customer experience will win.

Music has a fantastic ability to be converted into an experience. You can hear a song, but you experience a concert. Books, blogs, and regular content have to work harder to do that – its tougher to experience the New York Times for instance, than it is, say Lady Gaga. Experiences, by their very definition are scarce. The content is merely the gateway drug to the expensive experience.

See Trent’s letter here to see exactly how scarce an experience can be.

Finally – what is to become of music – do applications like grooveshark represent the future of music, and how we consume it? I sense, as Fred Wilson puts it – music will eventually be like dial tone, and everybody will be able to access it whenever needed.

Music will continue to provide every generation to come the experiences that become the touchstones of their lives, much like it did for all the generations before. The actual physical experience will be different, obviously as we have already moved from the experience of pulling an LP out of its sleeve – to spending hours trying to take the CD’s out of their plastic straight-jackets – to clicking mice.

In the future who knows what it will be, but if the trajectory is accurate, almost anybody will be able to make music(thats not to imply that they would be good at it), and similarly, everyone will have access to almost every track ever created at their fingertips whenever they want it. As with everything else, curation will become important, and scarce goods will become even more expensive than they are now.

Finally, in such a world – the customer’s attention will be the scarcest good of all – and it’ll be very very expensive. Customers will continually strive to be free of exclusive arrangements, network exclusivity and any limitations on how, when, or where they can consume their content.

Categories: Technology Tags: ,

What will e-commerce look like?

June 3rd, 2011 No comments

I’ve been thinking a lot about what e-commerce will look like in 10 years, or even half that time…

E-commerce as it stands today isn’t some new breakthrough technology-enabled process that was never possible before. Its still pretty similar to the act of what buying and selling looked like forever.

Customer wants something, customer goes to store, customer adds to cart, customer pays for it, customer checks out and leaves.

Note, the above could apply to a brick and mortar, or to an e-commerce player (such as my current employer – Quidsi Inc)

So what is different about online vs offline retail.

i) Unlimited shelf space.

Positive :

The constraints of what you can and cannot show customers is different in an online store vs a brick and mortar store. You can theoretically have a limitless collection of items, and are not constrained by the limits of shelf space in your store. No matter how large a store it is (think Costco) this is a very real limitation in the brick and mortar space. E-tailers are only subject to what inventory they can afford to purchase – but even that there are ways around (consignment, drop shipping, third party fulfillment, affiliate relationships etc.)

Negative :

Shelf space is a scarce resource and like all good scarce resources, brick and mortar stores monetize it. This is harder in an e-commerce world, and so e-tailers create scarcity in order to have an asset that they can monetize. (Landing pages, brand pages, micro stores within stores, the images on the home screen etc.) Also, the more products you add, the harder it gets to discover the right product for the customer.

ii) Supply chain

Positive :
E-tailers no longer need to manage and deliver product to stores across the nation. The complexities involved in keeping track of inventory per store, and its delivery is not trivial.

Negative :
The e-tailers cannot guarantee the same delivery experience across the country to all its customers, especially if it has only a limited number of warehouses. Also they cannot deliver the same immediacy that a physical store on your block can. Want something fast – no matter how quick an e-tailer can ship it to you – they cannot beat walking down the street and buying it in the corner store.

iii) Shopping Experience

Positive :
E-tailers can guarantee the same shopping experience to almost every customer that wanders into their URL.

Negative :
That experience has no local flavor to it, or for that matter any real personal interaction. Its a very impersonal shopping experience. No sales people, no friendly clerk to help you understand what you are purchasing etc.

I could go on, but you get the idea – in every way that e-commerce differs from traditional retail, there are opportunities for companies to be created and to grow. Here’s a few examples.

Discovery – Several large companies already exist to help customers discover the right product whether by search, navigation, merchandising etc. Endeca, Omniture, and a whole host of new start ups.
Delivery – E-tailers are competing nationwide to deliver fast free shipping and comapnies like webvan, freshdirect show that it is possible to take what would have seemed impossible only a short while ago and transform it into an online activity. Others will follow suit and the concept of local delivery for fast moving goods will become commonplace especially in urban areas. While this doesn’t exist yet, I think e-tailers (on the backs of delivery partners like UPS and Fedex) will also eventually allow you to pick a time-slot you want your package delivered (like Freshdirect allows now).
Personalization – Baynote, Certona, MyBuys, and a host of others are in the business of attempting to make the shopping experience more personal by showing you products, content, and experiences that they think are relevant to you at the appropriate time.
While all these are great, and the innovation and progress in this field does exist – I can;t help but wonder if this is what e-commerce will look like in 5 or 10 years.

However, several things have changed online, and they do allow for behaviors that were rarely possible before.

i) Access to information:
Information arbitrage is very difficult in a massively connected world.

ii) Access to similar people:
The ability to access a group of people that thinks and behaves like you is much more possible in today’s world than it has ever been before.

Why did I pick those two pieces to highlight? There are several other things that have changed, and are empowered by technology. However these two are going to do something interesting

Access to information includes price information. Eventually, customers will have total visibility across all products and categories. This will eventually drive prices to the lowest possible price as competition increases, and e-tailers will have to compete on something other than price. Alternately, they will create alternate streams of revenue and funnel the revenue into pricing.

Access to similar people is important because of the concept of the long tail. The minute I can find a large enough group of people interested in yellow doo-dads, I can afford to make, market, store, pick, pack and ship yellow doo-dads. The internet makes it easier and easier to find and/or create communities of people who are interested in something specific. This means no longer having to stock the products that will appeal only to the widest group of people. E-commerce will enable the carrying and selling of more and more niche products as communities pop up across the country that are willing to support and purchase such products. If you need at least 100 willing customers for yellow doo-dads, but they are spread across the country it will be impossible for a local store to carry them. Alternately, a huge chain of stores will carry one in every store in the hopes of finding the one person in that neighborhood who has a need for yellow doo-dads. However e-tailers with the ability to send the product to any corner of the country can and will move into such opportunities as they arise.

What does this mean for e-commerce? While I can’t claim to know the answer, here is what I think will happen.

    E-commerce, or atleast parts of it – will be commoditized. Scale will become all important. The ability to buy something online and have it delivered to your house as a particular time and date will become commonplace. The price will be reasonable and well known.
    As this happens, products will start to diverge from the lowest common denominator into ever increasing niche markets.
    Discovery of products is going to become ever more important, especially as the number of products available online explodes.
    Arbiters of good taste will be rewarded as e-commerce becomes a commodity, and ever increasing number of products show up online.
    Good taste isn’t objective – but subjective, so it means whatever you think it means. Large amounts of computing power are going to be spent trying to win the race to become trusted sources of good taste for as many people as possible.

There are several changes coming – curation will become more important, supply and demand will not look like it does now, and e-commerce tomorrow will see major innovation.

Disclaimer : The views above are mine and mine alone and do not represent those of my employer in any way shape or form. I am currently employed at Quidsi Inc, which was recently purchased by Amazon.

Categories: E-Commerce, Technology Tags:

Fresh Ubuntu Server (10.04)

March 27th, 2011 No comments

Lucid Lynx from nothing to Rails server :

I’m doing this on the Rackspace Cloud (which I’ve been using for all my machines). I have no security requirements for this server, go elsewhere for iptables etc. Before you begin – update & upgrade the server.

apt-get install build-essential
sudo apt-get update

1. Create a new user :
adduser <username>

This should ask you all the appropriate questions, create the home directory, and create the appropriate shell for you etc. This is better than creating useradd, for those above reasons.

2. visudo
Add the following line under this line

root ALL=(ALL) ALL
<username> ALL=(ALL) ALL

3. Install Mysql

sudo apt-get install mysql-server

Depending on what you are doing on this server you might also need the mysql-dev library

apt-get install libmysqlclient

4. Install Ruby

sudo apt-get install ruby rdoc libopenssl-ruby

5. Install RubyGems

wget http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz
tar zxvf rubygems-1.6.2.tgz
cd rubygems-1.6.2
sudo ruby setup.rb

6. Create symbolic link to gem directory

sudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem

7. Install Rails

sudo gem install rails

8. Install the mysql gem

apt-get install ruby-dev libmysql-ruby libmysqlclient-dev
gem install mysql

As of today, this process should install Ruby 1.8.7 from Ubuntu’s package, and Rails 3.0.5 (from ruby gems). This is a version higher than the Ubuntu repository. Rails does not support 1.8.6 or earlier, nor does it support 1.9.1, so always check your ruby version

ruby -v

Categories: Technology Tags:

DD-WRT & Netgear WNDR3700

February 28th, 2011 5 comments

A few weeks ago I finally upgraded my router. I’ve had the same wireless router for over 5 years now, and can strongly recommend it (D-Link Wireless G router). It rarely overheated, rarely dropped a line, and almost never never gave me any trouble.

Then the other day I moved something around, and when I replugged the wireless router in, I accidentally plugged the wrong power source into the router, and burnt it out.

So, needed a replacement. Did a little research, and finally settled on a Netgear WNDR3700. Its a dual band router, etc. You can find all the specs on AMZN here – Netgear WNDR3700. I don’t need to repeat them here.

I am not your average consumer. My network includes several networked devices in a combination of wireless and wired setups. I also run a couple of switches, and a couple of airport express’ and finally, two Network Attached Storage devices – so, I rely on my gateway router quite a bit – and I have specific requirements from it. Also I run 4 different OS’s inside the network.

First I’ll provide the consumer review, and if you just want to read your email from further away from your router, watch netflix, and hulu, this is a great router.

Setup is easy. The router interface can be reached at 192.168.1.1 and if you aren’t comfortable with that it comes with a CD to assist in the network setup. Once setup, its easy to connect to. It doesn’t drop connection easily – it provides great range, and it’ll do what you need it to do.

Feel free to stop reading now, if you don’t care what IPv6 vs IPv4 means.

When I upgraded routers, I also upgraded all my machines from various versions of Windows to Windows 7. This I was hoping was going to be a seamless upgrade, but it was not. It was painful, and in many many ways. However this isn’t a review of that particular story.

I do run several VM’s on a couple of machines. Previously I just used Bridge networking to get them access to the network. However after the upgrade to Windows 7, this became impossible. I wasn’t sure what I’d done to cause this – but it quickly became abundantly clear when I dug into the difference between “Home Network” and “Work Network” on Windows 7. I’ll leave that for another post as well. However to make a long story short – if you want it to work, depending on your VM’s OS – you either have to disable IPv6 on the Host, or move to “Work Network” which uses IPv4.

Anyways – to get back to the point. Netgear’s default firmware couldn’t give me the IP addresses for the machines connected to it most of the time. Also a lot of things that I could do with the DLink were not available in the default configuration. Network Address Translation – more specifically port translation isn’t available (not even in DD-WRT btw) which I used heavily to be able to access sshd on all my servers and ftp on them as well.

The firmware also had some trouble with my switches that were downstream from the router. They are both gigabit switches, and all the downstream computers have gigabit ethernet adapters however for some reason, the router would give the connection to the switch a megabit connection speed. I have no idea why, and after days of troubleshooting, I couldn’t figure it out.

After a month of trying to work with the default firmware, I loaded DD-WRT. It works beautifully. No connections dropped, all computers on the network visible, remote management of the router, no dropped packets, and stable nat. Still no port translation, but I moved my sshd servers to different ports for now.

The router doesn’t run hot. The 5Ghz channel which dropped connections frequently with the default firmware is now completely stable. The range is better (about 10% further). The signal is stronger (about 12 to 15% better signal to noise ratio) when compared to default firmware.

Finally – wireless-n. Since I cannot get the Airport Express devices to work with AES security, and I couldn’t get the 802.11n to work without it, I was basically screwed earlier. (Well technically I should not have been, but the 5Ghz basically sucked.) DD-WRT solved that for me.

Overall, the router works great for me now. One last feature I haven’t talked about, but has proved invaluable is the ability in DD-WRT to create virtual interfaces to two physical interfaces provided. I use this frequently, especially because I have certain devices that only connect to specific security protocols (WPA2 Enterprise only etc.)

Categories: Technology Tags: ,