Linux for the Young Computer Scientist

Posted by mitch on April 07, 2015
career, education, software

So you’re about to graduate from college and while looking for a job, and someone expresses surprise when you confess that you’re not well-versed at Linux. Uh oh.

Everyone who expects to work in computing should know some basics about Linux. So much of the world runs Linux these days–phones, thermostats, TVs, cars.

Here’s a list of tasks that the young computer scientist should be able to do with Linux. The goal isn’t for you to be able to get a job as a “sysadmin” but to have a general familiarity with enough different things that you can solve real world problems with a Linux system. Of course, much of this applies to Mac OS X, too.

  1. Install CentOS or Ubuntu into a virtual machine on your Windows or Mac desktop/laptop. Open a Terminal window.
  2. You’ll probably get most of your help through Google searching, but on the command line, you can get help with specific commands by using the man command. E.g., man ls
  3. Basic file navigation: ls, cd, pwd, pushd, popd, dirs, df, du, mv. Be careful with rm.
  4. Basic editing with vim (open a file, save it, close it without saving, edit it, copy/paste with yank, jump to a specific line number, delete a word, delete a line, replace a letter.) (You can use nano while you’re coming up to speed on vim.)
  5. Use grep, less, cat, tail, head, diff commands. Use with pipes. Use of tail -f, less +F, tail -10, head -5 (or other numbers) is handy.
  6. tar and gzip to create and expand archives of files.
  7. Use sed, awk — replace the contents of a file, print the column of a file.
  8. Command-line git commands to checkout, edit files, commit, and push back to a remote repository (e.g., Github).
  9. Basic process navigation: ps, top, kill, fg, bg, jobs, pstree, Ctrl-Z, Ctrl-C.
  10. Unix permissions: chmod, chgrp, useradd, sudo, su; what do 777, a+rw, u+r mean, how to read the left column of ls -l / output.
  11. Simple bash scripts: Write a loop to grep a file for certain output, set command aliases
  12. Compile a simple C program with gcc. Use gdb to set breakpoints, view variables in a C program being debugged (where, bt, frame, p).
  13. Use tcpdump to watch HTTP traffic to a certain host.
  14. Understand /etc/rc.d and /etc/init.d scripts
  15. A basic understanding of /etc/rc.sysinit
  16. Attach a new disk and format it with fdisk or parted and mkfs.ext4. Run fsck. mount it. Check it with df.
  17. Know how to disable selinux and iptables for debugging. (service, chkconfig)
  18. How to use the route, ifconfig, arp, ping, traceroute, dig, nslookup commands.
  19. Write an iptables rule to forward a low number port (e.g, 80) to a high number port (e.g, 5000). Why would someone want to do this?
  20. A cursory understanding of the filesystem layout — what’s in /etc, /bin, /usr, /var, etc.
  21. A cursory understanding of what’s in /proc.
  22. Configure and use SSH keys for automatic login to another host.
  23. Forward a GUI window over SSH with X11
  24. Reboot and halt the machine safely (shutdown -h now, reboot, halt -p, init, etc commands)
  25. yum and apt-* commands (CentOS and Ubuntu, respectively)
  26. Modify boot options in grub to boot single user, to boot to a bash shell

For extra credit:

  1. The find command is a complicated beast, but simple to get started with.
  2. Copy files over SSH with scp.
  3. The dd command is useful for dealing with a variety of tasks, such as grabbing an image of a disk, getting random data from /dev/urandom, or wiping out a disk, and so on. Also be aware of the special files /dev/zero and /dev/null.
  4. Figure out how to recover a forgotten root password.
  5. Disable X11 and be able to do these tasks without the GUI.
  6. Do the same tasks above on a FreeBSD machine.
  7. Without the GUI, configure the machine to use a static IP address instead of DHCP.
  8. Use screen to create multiple sessions. Logout and re-attach to an existing screen session.
  9. Write a simple Makefile for a group of C or C++ files.
  10. What does chmod +s do? Other special bits.
  11. netstat, ncat, ntop.
  12. ldd, strings, nm, addr2line, objdump
  13. Grep with regular expressions
  14. What’s in /etc/fstab?
  15. history, !<number>, !!, !$, Ctrl-R

Books to peruse:

  1. Unix Power Tools
  2. sed & awk
  3. bash Cookbook
  4. Learning Python Every computing professional should know a simple scripting language that ties to the OS for more complex scripts than are rational than bash; python is an excellent place to start.
  5. Advanced Programming in the UNIX Environment, 3rd Edition (be sure to get the latest edition)
  6. If you’re interested in networking, be sure to read TCP/IP Illustrated, Volume 1: The Protocols (2nd Edition)
  7. You probably took an OS class. While Tanenbaum and Silberschatz write great books, if you want to know Linux internals better, Rubini’s device driver book is an excellent read. There is a 4th edition coming later this year. Linux Device Drivers, 3rd Edition

Tags: ,

On Consulting — From the Client’s Perspective

Posted by mitch on September 04, 2010

A few months ago, someone asked me, “How about a blog post on your advice/experiences on consulting?”

My experience as a consultant is somewhat limited; I’ve only had a handful of clients in the past. From my perspective, things went well as the contracts were often renewed and I got more referrals for new business than I could handle. At the end of the day, a consulting business is a nice, safe business to run. You either find clients or you do not. You don’t have to spend months creating a product and incurring a lot of financial risk. You can get set-up in a week or two and you thrive (or die) based on your ability to network with people and deliver results.

The main equipment you need is a phone line, business cards, a web site, a bank account, an accountant, a simple legal entity, some references, and a few clients. You’ll want a multi-function printer/copier/fax as well, and perhaps a fax service and an answering service. None of this is hard to acquire. With some industry experience, some networking, you can start a functioning consulting business for $2,000 or less, depending on what type of corporation you set up and what your state fees (and accountant / legal fees) entail. For basic engagements, you won’t need a lawyer, or at least, more than an hour or two of legal time. This is pretty straight forward. If you’re going to be “self-employed” (an IRS classification), it’s even easier. (This is not legal advice. Talk to your accountant or attorney about your options.)

I suspect there’s already a lot of “how to be a consultant” or “how to grow a consulting firm” posts out there. But what about advice from the client’s perspective? I thought that might be more useful.

In the past year alone, I’ve hired over a dozen consultants to help my company with incremental headcount. These include technical writers, marketing, graphics artists, programmers, video editors, legal and financial consultants. Some of these consultants have been awesome. Others haven’t worked out. This post is a look at my observations from dealing with these people, projects, and relationships.

Who You Know is More Important Than What You Know
Every consultant I’ve ever hired came from a referral. Referrals generate referrals. I needed someone to help me with some financial modeling. I emailed an accountant who worked for me years ago asking if she knew anyone. She referred me to someone else. That person referred me to someone else, who is now my corporate tax accountant. However, he didn’t do financial modeling at his firm, so he referred me to someone else who then referred me to the guy I hired. The guy I hired was the bomb. His $5,000 engagement turned out to be worth several million dollars to me.

That’s a long chain of referrals, and thanks to email and the phone, it took less than a few hours to find the right guy.

You absolutely must be on LinkedIn. You must have a web site with an email address and a phone number. If you do a lot of in-person meetings, get your photo online so people recognize you at Starbucks.

Your Job as a Consultant is to Deliver Quality Results on Time and with Minimal Hassle
In general, whether you are an employee or a consultant, you need to deliver the expected results with less “touch” time from the hiring manager than if that person had done the project himself. Your ability to listen, communicate what you heard, confirm that your priorities are in line with expectations are all critical. Consultants are generally hired for either expediency or for specialized skills that do not require on-going full-time work. This means you need to deliver results rapidly, and be flexible when projects come up.

Clients can be vague, arbitrary, and a pain in the butt. I know I am. Part of your talent as a consultant is sifting through that to figure out what’s really going on.

Communication is Key
Clients will have different ways that they want to communicate. Some will lean heavily on a project tool such as Basecamp. Some will use email. Others will prefer to talk on the phone or meet in person. You need to be able to deal with all these forms of communication and respond when spoken to. I once had an artist consultant who wouldn’t reply to email if he felt there was no action for him to take. He also wouldn’t answer the phone or call back. His contract was not renewed.

Flexible Hours May Be Required
If your client is in another time zone or often asks about tasks in off hours, you might need to work outside of the 9-5 hours. If you’re going out of the office or on vacation, you need auto-responders set-up and it’s good to communicate any surprise time off with active clients up front. Some people become consultants to be their own boss, but the reality is, you are still working for someone. If your client has an emergency with your project, you might have an emergency as well.

The flip side of this is that some of your clients will be a bad fit with you and you may find yourself terminating the relationship, either due to too many emergencies or other behaviors. Just be sure you handle all aspects of the client relationship professionally; referrals and reputation are key!

Be Careful What You Say
After working with some clients, you may grow to feel comfortable with them. Perhaps you go out for lunch or get a beer after a meeting. That’s great, but try to keep the rants about your other clients or your partners to a minimum. There is nothing more awkward than a partner at a firm ranting about his firm’s internal politics. It sends mixed messages about stability and confidentiality to the client.

The Client’s Goal is to Minimize His Own Stress
I once had an accountant call me and tell me he thought he did my taxes wrong. I couldn’t fire him fast enough. Talk about stress! Another time, I had an attorney call me asking what I wanted to do about a legal situation, but he couldn’t explain my options in clear, jargon-free language, other than I had 72 hours to make a decision. I had to hire another attorney rapidly to figure out what was going on. The new attorney cost me twice as much, but was a far better value.  As  the client, I want the consultant to take care of things, make recommendations, and translate jargon into language that I, as a non-expert, can understand so that I can make the right business decision.

Appearance Matters
Every part of how you appear matters. If you show up to my office wearing a non-professional attire, I will wonder what the quality of your work is. If your business cards are cheaply made or clearly from a home printer, I probably won’t hire you. You don’t have to have an incredible web site, but it should be professional. If clients come your office, it should be clean and look like a real business.

When I needed to hire a video editor, I thought of a fellow I know. He has a large office, but it’s covered in papers and food crumbs. He has two 10 yr old computers and he gets into rants about how he hates HDTV and his customers. Then I thought of another fellow, who I knew socially and had told me about his new Mac Pro and his work for public television. I chatted with him and got some high quality samples of his work. He has been wonderful to work with.

You don’t have to buy a $1,000 suit; a $50 dress shirt will do. You don’t have to have a $5,000 desk, a clean $200 desk that is clean and organized is fine. You don’t have to spend $0.25 per business card, a $0.02 card that feels robust is fine. How you answer the phone, your writing in email, the type of shoes you wear all play into your appearance. Keep it professional.

And of course, be on time. There is rarely an excuse to be late. “Traffic” is not an excuse; there is always traffic.

Detailed Invoicing Inspires Confidence
No one likes paying bills. The worst type of bill to get is “Project X….. $100 per hour x 100 hrs …. $10,000”. What did I buy? If you’ve ever gotten a bill from a lawyer, you know that lawyers tend to provide a lot of detail. I have no problem with “Email with client re: important matter … 0.50 … $300” because then I can make a value assessment–was Important Matter worth $300? Probably! All consultants should err on the side of more detailed billing. A long invoice including lots of “date / project / hours / amount” on a 10 minute granularity makes me more confident than “50 hours on project”. Fortunately, there are a number of tools out there to help track time and build out invoices with great detail. Even if you’re best buddies and the client trusts you, more details are good if the client has a boss or investors or auditors that might be looking at the invoices later.

Learn Your Client’s Business
If you never figure out the jargon of your client’s business and the client has to keep re-explaining things to you, don’t expect a long term relationship. You don’t have to become an expert, but if you take some time to learn a little about the areas that you’re exposed to, that’s going to make you much more efficient. And your efficiency is an edge.

There’s probably more to say here, but those are some key points off the top of my head. I hope this is useful.

Tags: ,

“I’m Starting a Company, Any Advice?”

Posted by mitch on August 02, 2010
business, career

I get this question a lot. I wrote this down as my standard answer.

First, you need to be sure you are building a product people want. This means doing market research and talking to potential customers before you do anything else. It sounds obvious, but building something people want is the hardest part. When you’re evaluating whether or not people want what you’re building, you need to hear people say, “OK, when can I buy this? I need this right now.” Potential customers who say, “Yeah, that sounds like a great idea” are misleading–that kind of response means you haven’t gotten them to the mental finish line such that they want to buy. It is crucial to understand the difference between these two reactions.

If you are serious about starting a company to the point that you or your partners are quitting your jobs, you need to go ahead and legally form the company. You can “do it yourself” but I recommend finding a respected attorney familiar with the law of where you are starting your company. In particular, you should have employment contracts between all partners and the company, and you should have intellectual property assignment agreements between all contributors and the company.

Without these basic agreements in place, your company can suddenly be in a position of being (1) un-fundable by VCs or other capital sources, (2) un-acquirable, (3) sued by a partner who has dropped out or feels he has been wronged. And of course, without some non-compete agreements, a partner can leave and potentially take know-how of your business to start a competing company.

Do not depend on a ‘gentleman’s agreement’ of what will happen when someone leaves–even if everyone trusts everyone and everyone has known everyone else for many years. In every company I have ever started, someone has left before the first product was ready to go to market. In one case, that tanked the company and the remaining partners, including yours truly, lost many thousands of dollars.

Setting up a company and getting these agreements in place is relatively cheap, even with a high-end law firm in an expensive city. The cost is essentially zero compared to other start-up costs and it will save you serious stress and money down the road.

Hire an attorney who specifically deals with business. I would not hire a “front door attorney” who “practices whatever comes in the front door.” Ask for references from businesses that were once starting out like yours. Also, you will need a CPA to keep you in-line with the IRS and other government agencies. The CPA will cost you much less and, in some ways, be a far greater value. I wouldn’t start a business without either of these people on my “team”. I’ve done it the wrong way and the right way–and the right way is MUCH better and less stressful.

When you’re just starting out, it can be very easy to fall into the trap of thinking that what you’re doing isn’t going to be “big” or “maybe it’s not important enough” to be worth protecting. But if you have quit your job to do something, it must be big and important enough to justify taking some basic precautions such as these. Chances are living expenses while you build your product will dwarf the costs of protecting yourself–there’s just no reason not to.

Of course, if you’re building a company alone, you might not need much of the above–I am really referring to scenarios involving 2 or more people. If you’re going at it alone, you might still need protection from contractors you hire, though.

See also: Top Ten Legal Mistakes Made by Entrepreneurs. I also recommend this book which covers the above scenarios and many other issues.

Finally, this is not legal advice.

(This is from my office FAQ; it felt more appropriate here.)

Tags: , , ,

What Helps Me Appear Organized

Posted by mitch on June 22, 2010
career, productivity, travel

I recently received an email asking what helps me stay organized. This is actually interesting phrasing, as it doesn’t presume that I am organized, nor does it presume that at one point I needed to “get organized.”

I mulled it over from this perspective and here are a few things I do to stay on top of things while minimizing stress. Most of these tips are about preventing the consequences of forgetting or losing something (stressing out), rather than remembering everything (being organized).

  • TripIt Pro — The last ~150,000 miles of travel I’ve done, I did with the help of TripIt Pro. If you are doing any amount of travel, you owe it to yourself to at least get the free account. I felt having the iPhone app was hugely worthy of the subscription price. TripIt lets me reserve hotel, car, and flights using my normal tools (Virgin, US Airways, Enterprise, Orbitz, Hertz web sites) and then forward the confirmation emails to TripIt. The itineraries are generated and appear in my calendar Outlook/Google/iPhone, in the TripIt app (with phone numbers, maps, directions, confirmation numbers). This is a huge time saver. TripIt does not handle complex itineraries involving numerous one-way tickets very well, but it does get all the data in there. It also integrates with LinkedIn, so you can advertise to your connections when you might be around to meet up for coffeee or dinner. Totally worth it. If that wasn’t enough, TripIt also integrates with all the frequent traveler programs. How many Starwood points do I have? Choice Hotel points? United miles? TripIt has the answer in one place.

  • Detailed calendar items — when scheduling a meeting, I dump in everything I need to know — the address, phone, email, name, etc. of who I am going to be meeting. This lets me rapidly punch in coordinates into a GPS or phone someone if I’m going to be late without having to dig back into my address book or emails.

  • Aggressive calendaring — I set all kinds of reminders for myself in advance on my calendar. I have a reminder that someone needs to trim the roses in the yard in September. I have a reminder about my parent’s cat on days I expect I might go visit (holidays). Oil changes, gutter cleanings — use the calendar system to track everything you need to do, not just the primary objectives in your life.

  • David Allen’s Getting Things Done — I don’t use every dimension of David’s system, but I use a lot of it. I bought a really nice label printer and label my files. I file everything I want to keep, even manuals for appliances. I keep proper inboxes and carve out time to dig through them. I use a mixture of Things, Evernote, and Basecamp to organize task items, notes, and collaboration with others. I manage development heavily with Bugzilla.

  • Redundancy — I have built a lot of redundancy into my life. I have 4 chargers for my MacBook Air, about 6 chargers for my iPhone, and two GPS units, one on each side of the country. Two sets of clothes — I do all of this to minimize my travel load when commuting between Silicon Valley and Boston. I can go to the airport with my driver’s license, credit card, and MacBook Air and nothing else, go to the other side of the country, and have everything I need. This means I don’t have to remember very much before a trip between these locations.

    As a less extreme example, I keep stacks of business cards in rubber bands in my car, office, home, jackets, laptop bags, so I generally don’t have to remember to bring cards. The point here is to put things in places where you will need them later so you don’t have to remember to bring them with you.

  • Connectivity — Even if I forget a file somewhere, it’s often in Basecamp or Evernote. And if not, I have remote access configured for my non-laptop machines in case I need to grab something remotely. I carry an iPhone and also have a Verizon MiFi for when AT&T isn’t working or I need to use my laptop in a customer’s parking lot. I buy Boingo for airport/Starbucks/etc. access to WiFi. Boingo at $10/mo is a no-brainer. The MiFi runs a little more, but it only has to save my butt once a year to pay for itself.

  • Capture notes with cameras — I use either a regular camera or my iPhone to capture whiteboards. I’ll use my iPhone to document where I parked my car if I’m in a strange area. I dump notes and pictures of whiteboards into Evernote or PowerPoint depending on what I need (or both).

  • Organized phone system — I hand out a Google Voice number for those folks who I never want to hear from. Google Voice cheerfully takes the message, transcribes it, and emails it to me. For everyone else, they get an office number. The office number rings my desk in Silicon Valley and Boston. After 30 seconds, it rolls over to ring concurrently my 2 other lines and my cell phone. This means all my voicemails go into a single inbox, rather than having 3 or 4 boxes to check. This also means I don’t miss a voicemail because I was away from my desk, nor do I need to provide folks a variety of phone numbers to reach me. One number does it all (and can be ignored easily too).

  • Outsource personal tasks — There’s probably a lot of things you have to do that you don’t want to do. Cleaning house, grocery shopping, cooking, taxes, organizing, yard work, washing the car. Outsource those things that are not relaxing or that you are not getting done.

Stress can get in the way of making concrete progress on projects, so I use the above to minimize “oh shit” moments. When it comes to gettings things done:

  • Decide what today’s 1-2 goals are — I do this first thing. This is part of the Getting Things Done approach (Today / Next buckets).

  • Sleep well — Cutting short on sleep is a disaster for productivity. Don’t do it. I have a pair of Zeo units that I use to measure my sleep. It has been tremendously helpful in making me be sure I get enough sleep. Eating well and exercising well go hand in hand here. Don’t ignore the hardware of your body.

  • Delegate — No one can do everything. I delegate to other team members as it makes sense, or hire contractors to add bandwidth.

  • Watch for distractions — Facebook, watching TV, chatting, blogging, tweeting — These can all be huge time sinks, especially if you’re procrastinating. Limit these activities. Remind yourself of your end goal (I want to get an ‘A’, I want to get paid, I want to finish this project, whatever) and get back to work.

  • Recognize that some tasks require big blocks of time — This isn’t true for everyone’s work, but if you need big blocks of time to focus in on a creative or complex project, recognize that need and plan for it.

  • Be early — There’s rarely a good excuse for being late. Plan for traffic and logistics — sometimes it can tough to find the right building, the right street, or a place to park. Arrive early and you will have some time to review who you are meeting and what the agenda is. This is 70% of the battle. Internally, I am bad at over-booking my calendar at times, but I’m never late to meet a customer or other business meeting.

My system isn’t perfect, but it’s working well for me. I’m always interested in trying things to improve it. I don’t claim to have the best system, this is just what I’ve gravitated towards. Because my job is really fun and largely what I’d do even if I wasn’t getting paid, burnout is a real problem for which I must be on watch. The above tools have let me get more done than I would have thought possible before I stumbled into these solutions and while keeping stress down.

You may note the above lists are about tools more than skills. Fundamentally, I have a lot of drive and desire to make progress every day — this is why I do start-ups. The above tools just enable me to increase my effectiveness.

On Cover Letters

Posted by mitch on February 28, 2010

I’ve looked at perhaps 1,000 résumés and cover letters in the last few years and around 200-300 cover letters in the last few months.  We are hiring and looking for super talent.  We have real jobs open and we are looking for great people to fill them.  I am completely open to bringing people in who are not in our network to interview, but you have to convince me it’s worthwhile.

Here’s a things that I see over and over that are not effective:

  • Writing the same cover letter as everyone else
    Pretty much every cover letter reads the same. “Dear HR, I would like a job, please hire me.” Sure, some of them are more verbose than others. But I almost never see one that shows the candidate has looked at our company in any level of detail. Tell me why you want to work for us. Just one or two sentences that shows you looked at what we do and can spin something targeted to us is enough to make me look further.
  • Attaching the cover letter to an email
    As a candidate, your goal is to get me to read the cover letter and get interested in you with as few steps as possible. If I have to open an attachment, that’s extra steps that I might not get done. I’m looking at dozens or more applications a day and I spend literally 1-2 minutes looking at those applications. That’s about 10 seconds per application. I am skimming for a few key elements–For example, in a junior programmer right out of school, I am looking for hobby projects and internships. That’s it. I don’t care where you went to school (within reason), your GPA, or that you were a member of the Computer Science club.
  • Applying to every job we have open
    Nothing will put your application in the trash faster than this. If you are applying to QA and sales and developer jobs, there’s a deeper issue here.
  • Writing several paragraphs on the fact that you are applying for a job
    Yes, I know that. You pretty much communicated that merely by sending an email to You don’t need to spend even 3 words on this (in one case, a candidate wrote about 375 words on the fact that he was applying for a job).
  • Applying for a job long before you are ready to start
    There is no reason to apply for a job today if you are not able to start work for 10 months.
  • Sending email rather than getting an introduction on LinkedIn
    If you have hundreds of people in your network who know people at the company, and you choose to send email to, I will really wonder why. An introduction from someone we both know is far better than an email into the void. This is especially true if you’re in sales!

At the end of the day, you need to find a way to be different in a sea of cover letters. Following a few of these tips can help you stand out. I have no doubt many high quality candidates are lost in the sea of noise. But those candidates who can say something different are the ones who will progress to the next step.

I suspect that this will be the topic of several posts in the future, as there’s plenty more to say on this.

Tags: , ,