Linux Online Partition Resize without LVM

This will allow you to extend your linux disk to grow its size. This is really helpful for Virtual Machines. You will have to reboot the VM at the end, but you don’t need a boot disk.

Print out the partition table

Delete the old partition /dev/sda and create a new one. MAKE SURE you use the SAME Start offset as the original!!! Otherwise, it will not boot.

Add the bootable flag if the partition you are resizing was bootable.

Write the partition table to disk.


Noogler Week 1 in New York City


The Boulder office doesn’t provide training, so my first week at Google was spent in New York City where the other half of the Drive team is located. My wife and I decided to go up a few days earlier and see the sights since neither of us had ever been to NY. We saw all of the requisite touristy things and most importantly– we ate at some amazing restaurants: Momafuku Saam Bar, The Spotted Pig, Scarpetta, and Bar Americain. There really is no end to great places to eat in NYC. Here are some of the things I learned while in NY:

  • New Yorkers are generally very nice
  • Walk signals are just a suggestion
  • Every day is trash day
  • Central Park is really awesome
  • If there is a subway car that is conspicuously empty, there is a reason– don’t go in it
  • I hate tourists :-P

We also saw a Broadway show– “Once“. I highly recommend it. Jenny got a couple of the last tickets on sale and she was a little sad because our seats were in the very back. Well, it turned out that we just read it backwards. We were actually in the very front!!!! Amazing!

And then Monday Came…

Jenny left to go home, and I walked the couple of blocks to Google for orientation— or maybe I should say “disorientation”.

Accurate map of the NYC office

Google’s offices encompass several floors of the old NY port authority building– but only parts of the floors. You can only reach certain parts of Google from certain stairs and elevators. Its easy to get turned around and lose orientation. I got lost… a lot.

Orientation was generally pretty standard. We listened to several presentations a day on various topics: from your standard HR topics, to more interesting technical talks on just how various things at Google work– most of which are confidential. I learned a few things that really stuck out.

First, I was surprised by how transparent Google is. Most companies keep things very secret but Google seems to be very open. All developers have access to all source code– well– 99% of it at least. The search ranking algorithms are secret for obvious reasons. Every week there is a company wide meeting where Larry and Sergey present new happenings and accomplishments.

Another thing I learned that I didn’t expect, was just how important user trust and privacy are to Google . They are extremely important pillars. The “Don’t be evil” mantra is taken very seriously. The driving force is to make the world a better place through information and technology.

Last but not least, the most surprising thing: the word “Googley” is used all the time in casual conversation.

The Best Part of Google

If you ask any Googler what the best part of working at Google is… I think they would all say: “The food”. Its absolutely true. The food is amazing. And free of course. The NY office serves breakfast, lunch, and dinner. There are probably a hundred different choices of things to eat and it changes every day. It not like school lunch fare– its pretty damn good food. For lunch one day I had cornish game hen, mixed roasted carrot salad, polenta, and cookies for dessert. Of course, I could have chosen several dozen other things… from freshly made sushi, hamburgers, burritos, etc etc etc. In addition to the cafeterias there are also many micro-kitchens spread out. Each micro-kitchen contains an espresso machine, coffee machine, various snacks, and just about any kind of drink you can imagine. I hear Boulder has an ice cream refrigerator, and the drink fridges are filled with beer.

….I am going to get soooo fat….

Developing at Google

Forget everything you know about writing software in Java. Forget everything you know about version control. Forget all the libraries you love and use.

Google operates at a scale that no other company does. Most of the time it can’t use standard tools or standard libraries because of the insane scale that has to be considered. It has a library or tool for nearly everything. Google does make extensive use of its own open source libraries: Protocol Buffers, Guice, and Guava. One thing I hear from Googlers quite a bit is that they can’t imagine living without the tools, libraries, and platform Google has. I can definitely see how this is true. Things just work.

Drinking from the Firehose

There is so much information, documentation, source code, and tools to pour through– it can be quite overwhelming. There is no way you can know it all. At some point you just have to rely on the magic that’s inside the black box. Everyone I have met at Google has been very helpful and encouraging. Everyone remembers what it was like when they first joined and how overwhelming it can be.

I have learned more in the past week than I have in the past year. Even if a little overwhelmed, its a great feeling. One manager commented on Nooglers: “Most Nooglers come to Google having been used to being the smartest person in the room” to which I replied: “I like being the dumbest person in the room. It drives me to do better.”

Quadcopter Build Series – Introduction

This series is a brain dump on everything I have learned about building a radio controlled quadcopter. I started with zero RC knowledge, and through a lot of reading, and even more trial and error. I have built… crashed… and rebuilt…and crashed… my quadcopter several times now— so maybe my trials can help you learn a few things, and save some money, and heartache along the way.

Continue reading

Interviewing at Google – Part 2

If you hadn’t read part 1, check it out here: Interviewing at Google – Part 1

It took a couple of weeks for the hiring committee to make its decision, but my recruiter informed me that they were extending an offer. Offer in hand, I had a hard decision in front of me… and my wife. Accepting it would mean leaving Denver and moving to California. My wife and I looked into what it would be like to live there. Housing is insane–we knew it would be expensive. For our money we were expecting “nice but small” not “small and also a shit-hole.”

Looking at photos of houses on Zillow, there was a house with 2 bedrooms, trash strewn about on the floor, dirty bathrooms, stains everywhere on the carpet. I think this house was inhabited by feral children or a lady that owned 600 cats. It was disgusting. It was also— over half a million dollars. Anything that didn’t look like a complete dump was at least an hour away from Google.

I mulled it over for 2 weeks. Each day, I would change my mind on what I wanted to do. On one hand, working at Google represents the symbolic pinnacle of achievement in my industry. On the other hand… working at Qualys is comfortable and relatively easy. Eventually, with the help of my wife, we made the decision. 

I told Google “no”.

Continue reading

Interviewing at Google – Part 1

First Contact

I was contacted by a Google recruiter on my birthday, June 24th, and asked to interview with Google for an opportunity on the SRE team. A few days later I had a phone screen.

The interviewer asked me to rate myself in various languages, linux concepts, and a few other technical aspects between 1-10. A “10” being you wrote a book on the subject… or actually invented the technology. Needless to say, I actually didn’t rate myself higher than a 6 on anything. I honestly didn’t know quite how to rate myself in “Java”. I know a lot about parts of Java, and little about other parts.

The self-rating was to guide the interviewer on what questions to ask next– which I honestly didn’t do that well on. She asked a question— something like how to count the number of 1’s in a binary number— which is a problem straight out of the must-read book I will mention later on. I fumbled my way through it, but it was far from optimal. Also, I should have memorized my powers of 2.

Somehow, I managed to move on to the technical phone interview (wait, this wasn’t technical???). Google has a reputation for having a very difficult interview process. After this slightly shaky phone screen, I was worried about what I was getting into.

Continue reading

XSS Injection Vulnerability– Chrome, Firefox, IE, Safari

A friend of mine, Tristan Burch, encountered this issue today. It is present in all browsers and has been closed as invalid in firefox.

The browser’s HTML parser doesn’t know anything about JavaScript, so it interprets the closing script tag within the string. The above snippet results in an XSS vulnerability.

The lesson here, is that it is dangerous if you place user submitted values directly into a JavaScript string. Developers should take care to always escape “<” and “>” and “&” when generating pages on the server side.

The correct html should be:

After all the advancements there have been in browsers its surprising to still run into these kinds of things.

Hazeltask is born

I’d like to introduce an open source library I wrote by detailing its genesis: Hazeltask. I will post a more concise technically focused Hazeltask article later, but I would like to document why Hazeltask was created— because I like to hear about the behind the scenes story on things like that :-)

Hazeltask is a general purpose work distribution library. It runs on top of the Hazelcast in-memory data grid. Hazeltask has actually been in use at Qualys for over a year now. It handles running several million tasks a day. There are lots of task execution libraries out there. Even Hazelcast itself implements a distributed ExecutorService. So, why another one? Good Question! Continue reading

After a many year hiatus, I’m back

I stopped writing in my blog a few years ago. No one really reads it, but I always found it enjoyable to write in. I have accumulated many many post ideas that I figured I would start writing again. I hope that if you find this blog then perhaps you will find some of the posts helpful or entertaining. At the very least its fun for me to look back on the archive of my thoughts and ideas of yore.

My original plan was to devote the blog entirely to programming related posts, but I would really like to write about other things now as well :-P. Some upcoming topics I am working on:

  • My interviews at Google
  • Building a Quad-copter from scratch. Everything you need to know to build one cheaply. (everything I wish I had known)
  • Hazeltask
  • Jackson HOCON dataformat
  • Dropwizardry – hocon, guice, jersey improvements
  • RabbitMQ
  • Introducing Tribbles – small library sugar built on top of Guava for doing useful things
  • Tachyon
  • Introduction to Scalability
  • and more!

Web Security – Introduction

Web Security… It’s almost an oxymoron. Security for the web has always been a long and difficult battle, often a losing one. With this segment on web security, I am focusing specifically on development techniques that you can apply to your web applications to make them more secure. I really want to concentrate on making security easy, for both the end-user and the developer alike. Who said security has to be hard?

This is a multipart segment that will cover:

  1. XSS (Cross Site Scripting) Attacks
  2. CSRF (Cross Site Request Forgery) Attacks
  3. SQL Injection Attacks
  4. JSON Hijacking
(and perhaps more as I think of topics)

Continue reading

Javascript ‘==’ operator and indexOf failure

The other day my collegue, Steve Skrla, was having an infinite recursion issue caused by my javascript clone function. We discovered that the for some reason it was equating a string value with an array value. After a little more digging Steve found the culprit. Simply put, Javascript’s == operator is broken.

I did a little more digging and discovered exactly what Javascript is doing. It turns out that when comparing anything to a string, Javascript first runs a toString on the other item being compared.

Continue reading