Skip to content

Instantly share code, notes, and snippets.

View Rachitlohani's full-sized avatar
🔵
at work

Rachit Lohani Rachitlohani

🔵
at work
View GitHub Profile
@Rachitlohani
Rachitlohani / Steve-Yegge.txt
Created May 14, 2022 15:18
Steve's Google Platform rant (plus.google.com)
I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.
I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't really have SREs and they make engineers pretty much do everything,
Name Location
Barbra Walton US
Ben Heil US
Bob Sakson US
Bogie Szeszko US
Dan Schiff US
Darek Easterly US
Gargi Chipalkatti US
Gregory Delpe US
John Wiegert US
@Rachitlohani
Rachitlohani / ls.rst
Created March 18, 2019 04:27 — forked from amitsaha/ls.rst
How does `ls` work?

How does ls work?

I wanted to be really able to explain to a fair amount of detail how does the program ls actually work right from the moment you type the command name and hit ENTER. What goes on in user space and and in kernel space? This is my attempt and what I have learned so far on Linux (Fedora 19, 3.x kernel).

How does the shell find the location of 'ls' ?

@Rachitlohani
Rachitlohani / curl
Created February 24, 2015 00:15
curl - detail
curl -w "@format.txt" -o /dev/null -s http://mint.com/
Save the following as format.txt
n
time_namelookup: %{time_namelookup}n
time_connect: %{time_connect}n
@Rachitlohani
Rachitlohani / ice setup
Created January 23, 2015 15:07
netflix ice setup
For those who think Netflix Ice is a tough nut to crack. I would like to introduce https://www.xdocker.io/.
Login using github/linkedin account or sign up
Provide your AWS credentials through accounts interface note: Make sure you provide the apikey, secret key, account id, and billing bucket while creating the AWS account. Make sure IAM account is created with proper security policy is applied as per the documentation http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/detailed-billing-reports.html
Select Netflix Ice Docker Image
Chose an instance type and image
Deploy.
have a break for ~10-12 minutes and Netflix Ice is deployed onto your AWS account.
We have even gone ahead and open sourced the docker image and you are welcome to even pull it from https://registry.hub.docker.com/u/xdocker/netflix_ice/ as well.
print("Total score for %s is %s " % (name, score))
Or use the new-style string formatting:
print("Total score for {} is {}".format(name, score))
Or pass the values as parameters and print will do it:
print("Total score for", name, "is", score)
If you don't want spaces to be inserted automatically by print, change the sep parameter:
print("Total score for ", name, " is ", score, sep='')
#!/usr/bin/env python
'''
Send memory usage metrics to Amazon CloudWatch
This is intended to run on an Amazon EC2 instance and requires an IAM
role allowing to write CloudWatch metrics. Alternatively, you can create
a boto credentials file and rely on it instead.
Original idea based on https://github.com/colinbjohnson/aws-missing-tools
'''
You have an empty repository. To get started you will need to run these commands in your terminal.
Configure Git for the first time
git config --global user.name "Rachit Lohani"
git config --global user.email "RLohani@Videologygroup.com"
Working with your repository. I just want to clone this repository. If you want to simply clone this empty repository then run this command in your terminal.
for attr in dir(obj):
print "obj.%s = %s" % (attr, getattr(obj, attr))
The order is (from first to last):
Brace expansion
Tilde expansion
The following expansions happen at the same time, in a left-to-right fashion on the commandline (see below)
Parameter expansion
Arithmetic expansion
Command substitution
Word splitting
Pathname expansion