Wednesday, June 15, 2011

Working Remotely

At Adku, every engineer we hire gets a quad-core iMac with a 12GB memory upgrade and a 15-inch quad-core MacBook Pro with maximum memory upgrades (8GB).  When we're working remotely on our laptops, sometimes we'll realize that we forgot to check-in a piece of code that is sitting on our iMac at work.  If we could ssh into the iMac, we'd be able to check it in and continue where we left off.  The problem is our office is behind multiple NATs which make it hard to set up port forwarding and as a fast moving startup, it's not worth the time to set up our own name server.  We needed something quick and easy.  What we ended up doing was setting up SSH tunnels from our machines at work to an Amazon EC2 instance we call gateway.adku.com.  With the tunnel set up, accessing our machines at work is as simple as SSH'ing to the right port on gateway.adku.com.  Here is how to set one up for yourself.

    On Work Machine:
    # create security group and authorized ports
    # this assumes that you have an amazon ec2 account and 
    # ami-tools and api-tools setup.  
    # setting all that up is straightforward, but outside the scope of this post
    ec2-add-group --region us-east-1 gateway -d gateway
    ec2-authorize --region us-east-1 -p 22 gateway

    # create your gateway machine.
    # your ami may differ.  ubuntu likes to update its amis very often.  
    # also your keypair may have a different name, adjust accordingly
    ec2-run-instances ami-ee857587 --instance-type m1.small --region us-east-1 -k gsg-keypair-east -g gateway

    # note the public url of the newly created machine
    # also optionally setup an easier DNS name such as gateway.adku.com

    On Gateway Machine:
    sudo echo "GatewayPorts yes" >> /etc/ssh/sshd_config
    sudo /etc/init.d/ssh reload

    On Work Machine:
    # 20000 is an arbitrary port, you can choose any open port.  
    # you just have to remember it for later.
    # gateway.adku.com should also be replaced with your public dns name
    ec2-authorize --region us-east-1 -p 20000 gateway
    ssh -nNT -R gateway.adku.com:20000:localhost:22 gateway.adku.com

    And you're done!  

    Now you can get to your work machine from anywhere like this:

    On Any Machine:
    # 20000 is the port from earlier, make sure it matches

    43 comments:

    1. Jesse,

      Here's a quick tip. When Carlos says he's "working remotely", he's either
      A) Gambling remotely
      B) Drinking remotely
      C) Carousing remotely
      D) All of the above

      ReplyDelete
    2. I've seen Carlos code while drinking actually. It's very impressive.

      ReplyDelete
    3. I've seen Carlos do all of the above, simultaneously. Also impressive.

      ReplyDelete
    4. I've seen Carlos do all this and blast mp3s remotely for the benefit of whoever happens to be sitting in the vicinity of his workstation.

      ReplyDelete
    5. I think when Carlos says he's working remotely, he's not doing anything remotely related to work ;)

      ReplyDelete
    6. on a more serious note i am purchasing laptops for my 3 developers and am wondering what the spec machines i should be looking at. Are 3 $2500 macbook pro's with 8gb ram too much? The laptops will remain company assets, but for the duration of their work they'll be theirs. I foresee having an iphone/android app in the not so distant future hopefully they can start making it after the product is delivered. Otherwise i could just get 3 sub $1000 laptops with about the same specs as the apple. Seed funding could last a year or six months depending on speed of product delivery and user acceptance. So my main concern is saving the cash for the real expenses i foresee being hosting and product delivery. Minor expenses being different technologies and SAAS we employ, which all seem to be subscription based. So I'm not ready to get imacs for everyone we don't have an office yet we're still the garage team, but we have 500k of seed funding. So i'm not strapped...or am I?

      ReplyDelete
    7. Running your AMIs in us-west-1 will make round trip times a lot more tolerable, assuming "remotely" means Vegas.

      ReplyDelete
    8. This comment has been removed by the author.

      ReplyDelete
    9. Please continue this great work and I look forward to more of your awesome blog posts. Discover the most popular people ranked on Celebrity birthdays .

      ReplyDelete
    10. Really Nice Post Admin, Very helpful looking for more posts, Now I have to share some information about How To Fix “Google Troubleshooting Guide” problem. If you are going through this problem you can simply Contact google bellen Nederland

      ReplyDelete
    11. Thanks for sharing this usefull topic. i hope it is improtant post for everybody. thanks and have a good day
      QuickBooks is effective, affordable and usable, particularly considering the requirements of small businesses today. TheQuickbooks Online Error Code 101 is one of the commom Quickbooks banking error. Generally, this message occurs during the import of bank account transactions into Quickbooks online. In this blog, you can know the reasons, signs, and ways to fix this Quickbooks online error code 101.

      ReplyDelete
    12. Your work is very good and I appreciate you and hopping for some more informative posts
      business analytics course

      ReplyDelete
    13. Thanks for this blog. Working remotely is one of the best and convinient thing for all the employee. If you looking for Accounting job and want to know difference between Acca and Ca. Visit this Blog.

      ReplyDelete
    14. This comment has been removed by the author.

      ReplyDelete
    15. Very nice post thanks for sharingThis post. Have you been searching for the Cash App Customer Service number if yes then it is the right place for you. Here you will get the 24/7 helpline number of the cash app and if you have any kind of issue in using the cash app, then they can also be resolved by a single click on this link.

      ReplyDelete
    16. Amazing information. It's really an amazing information. Thanks for sharing with us.
      Are you looking reliable and flexible Twin Channel for the Rolling Mill & TMT Bar? Akshi Engineers offer you one of the best options of Twin Channel for you at a cheap price. To know the best deal of Twin Channel for Rolling Mill, just dial our toll-free number, and you may also visit the website.

      ReplyDelete


    17. Your information is very useful for me.Thanks for sharing with us, keep sharing again such type of information.Students who have qualified for their 12th class or are waiting for the results of the 12th class can apply for the UPSEE. Apart from this, no other students are eligible to apply for this examination. There are around 250 colleges in UP that provide admission to various technical courses after qualifying for the UPSEE exam.

      ReplyDelete
    18. Your information is very useful for me.Thanks for sharing with us, keep sharing again such type of information.Are you struggling with the problems of ATT Email Login? If yes then you must choose AT&T Customer Service for reliable and immediate solutions. The professionals will guide you with all sorts of solutions for your complicated technical glitches. So, connect with experts for solutions.

      ReplyDelete
    19. Become a data science expert by joining AI Patasala’s data science training in Hyderabad program, where you can learn data science concepts with practical knowledge.
      Data Science Training in Hyderabad

      ReplyDelete
    20. Casino, Hotel & Gambling Map | Mapyro
      Find your way 나주 출장안마 around the casino, find where everything is located with your casino and find the perfect 군포 출장샵 spot for you. 진주 출장안마 Casino Casino Address: 667 군포 출장샵 Casino Ave, Santa Anita, CA 95113 1xbet app

      ReplyDelete
    21. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Great work
      data science training

      ReplyDelete
    22. A very details explanation was provided on this blog. It's a really helpful and useful article. Thank you for taking the time to share your thoughts and knowledge on this topic. Now it's time to get Appointment Setting for more information.

      ReplyDelete
    23. Trusted Personal Injury Lawyer Fairfax will give you a legal advice, and representin court.

      ReplyDelete

    24. Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!.
      Abogado de DUI Fairfax VA

      ReplyDelete
    25. Exceptional legal representation! This Criminal Defense Lawyer in Fairfax VA truly knows the ins and outs of the law. Their dedication to clients is unmatched, providing strategic defense with a personalized touch. Highly recommended for anyone in need of a reliable and skilled advocate in the Fairfax area.

      ReplyDelete

    26. Our Card processing for chiropractors service is designed to cater to the unique requirements of their practice. By utilizing our advanced technology, chiropractors can securely process credit and debit card payments, ensuring a seamless and hassle-free experience for both the practitioner and the patient.
      Additionally, our system is equipped to handle insurance claims, making it easier for chiropractors to receive timely reimbursements and streamline their billing process.

      Adopting card processing for chiropractors not only facilitates efficient financial transactions but also contributes to a modern, client-focused practice, ultimately improving overall patient satisfaction and practice management.

      ReplyDelete
    27. Working remotely offers a unique blend of flexibility, independence, and opportunity for professionals to redefine their work-life balance. Embracing this mode of work allows individuals to transcend geographical boundaries, connecting with colleagues and clients from around the world without the constraints of a traditional office setting. bankruptcy lawyers close to me

      ReplyDelete