Skip to content

Instantly share code, notes, and snippets.

View ameenkhan07's full-sized avatar
:shipit:

Ameen Khan ameenkhan07

:shipit:
View GitHub Profile
@ameenkhan07
ameenkhan07 / DZ60.hex
Created July 21, 2020 05:00
DZ60 keyboard
:100000000C9439030C9480030C9480030C948003AB
:100010000C9480030C9480030C9480030C94800354
:100020000C9480030C9480030C942B290C94FD29D0
:100030000C94FE1F0C9480030C9480030C9480039A
:100040000C9480030C9480030C9480030C94800324
:100050000C9480030C944B200C9480030C9480032C
:100060000C9480030C9480030C9480030C94800304
:100070000C9480030C9480030C9480030C948003F4
:100080000C9480030C9480030C9480030C948003E4
:100090000C9480030C9480030C9480030C948003D4
@ameenkhan07
ameenkhan07 / web-servers.md
Created January 24, 2020 19:45 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@ameenkhan07
ameenkhan07 / latency.txt
Created January 23, 2020 21:55 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@ameenkhan07
ameenkhan07 / #DistributedSystemReadingList.md
Last active December 14, 2019 08:51
Distributed System Reading

The papers included in CSE-586 reading.

Consensus and Paxos

  • Paxos Made Moderately Complex. Robbert Van Renesse and Deniz Altinbuken, ACM Computing Surveys, 2015.
  • Paxos made live - An engineering perspective. Tushar D. Chandra, Robert Griesemer, Joshua Redstone. ACM PODC, Pages: 398 - 407, 2007
  • ZooKeeper: Wait-free coordination for internet-scale systems P. Hunt, M. Konar, F. P. Junqueira, and B. Reed USENIX ATC 2010.
  • The Chubby Lock Service for Loosely-Coupled Distributed Systems. Mike Burrows, OSDI 2006.
  • In Search of an Understandable Consensus Algorithm. Diego Ongaro, John Ousterhout, USENIX ATC, 2014.
  • WPaxos: Wide Area Network Flexible Consensus. Ailidani Ailijiang, Aleksey Charapko, Murat Demirbas, Tevfik Kosar, IEEE TPDS, 2019.
  • Dissecting the Performance of Strongly-Consistent Replication Protocols. Ailidani Ailijiang, Aleksey Charapko, Murat Demirbas, Sigmod 2019.

Stevey's Google Platforms Rant

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 real

@ameenkhan07
ameenkhan07 / Cheetsheet.cpp
Created March 4, 2019 03:20
STL cheetsheet
// C++ Structure
/*The constructor initializes id to 42 when it's called. It's called an initliazation list.
In your example, it is equivalent to
*/
struct TestStruct {
int id;
@ameenkhan07
ameenkhan07 / FB-PE-InterviewTips.md
Last active May 8, 2024 05:03
Facebook Production Engineering Interview

What to Expect and Tips

• 45-minute systems interview, focus on responding to real world problems with an unhealthy service, such as a web server or database. The interview will start off at a high level troubleshooting a likely scenario, dig deeper to find the cause and some possible solutions for it. The goal is to probe your knowledge of systems at scale and under load, so keep in mind the challenges of the Facebook environment.
• Focus on things such as tooling, memory management and unix process lifecycle.

Systems

More specifically, linux troubleshooting and debugging. Understanding things like memory, io, cpu, shell, memory etc. would be pretty helpful. Knowing how to actually write a unix shell would also be a good idea. What tools might you use to debug something? On another note, this interview will likely push your boundaries of what you know (and how to implement it).

Design/Architecture 

Interview is all about taking an ambiguous question of how you might build a system and letting

@ameenkhan07
ameenkhan07 / hough.py
Last active January 15, 2019 05:42
Hough Lines
import matplotlib.pyplot as plt
import cv2 as cv
import numpy as np
import os
# import math
from sobel import sobel
OUTPUT_DIR = "outputs/"
img_name = "./hough.jpg"
@ameenkhan07
ameenkhan07 / ErosionDilation.py
Created December 3, 2018 02:39
AISHACK Morph
def _dilate(self, img, str_img=[]):
'''Expands the poindary of img
'''
w, h = img.shape
res = np.asarray([[0 for _ in range(h)] for _ in range(w)])
# Iterating the anchor of the structure image over the original image
for i, im_row in enumerate(img):
for j, im_ele in enumerate(im_row):
if img[i][j]:
for k in range(-1, 2):
@ameenkhan07
ameenkhan07 / tutorial.md
Created August 14, 2018 04:11 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.