Skip to content

Instantly share code, notes, and snippets.

View amanharitsh123's full-sized avatar
🐧
SRE

Aman Sharma amanharitsh123

🐧
SRE
View GitHub Profile
@amanharitsh123
amanharitsh123 / gist:a90e684879c7238567640a8b675ee928
Created November 28, 2020 06:12
My notes from GCP Core Infra course
Intro to GCP
- 4 main services:
- compute
- storage
- big data
- ML
- Cloud Computing
- On-demand self service
- Broad Network access
Intro to GCP
- 4 main services:
- compute
- storage
- big data
- ML
- Cloud Computing
- On-demand self service
- Broad Network access
@amanharitsh123
amanharitsh123 / FB-PE-InterviewTips.md
Created June 19, 2020 20:10 — forked from ameenkhan07/FB-PE-InterviewTips.md
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

@amanharitsh123
amanharitsh123 / template.cpp
Created June 15, 2020 05:21
Competitive Programming template
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define all(arr) arr.begin(),arr.end()
#define f first
#define s second
#define debug1(x) cout<<x<<"\n"
#define debug2(x,y) cout<<x<<" "<<y<<"\n"
@amanharitsh123
amanharitsh123 / seg.cpp
Created June 9, 2020 14:12
Max segment tree in c++
class seg_tree {
public:
vector<int> arr;
vector<int> tree;
int n;
seg_tree(vector<int> x) {
n = x.size();
arr = x;
tree.resize(4*n);
build(0, 0, arr.size()-1);
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@amanharitsh123
amanharitsh123 / gist:4ea923d82295bfb28bd5bebd7068ef1b
Created February 25, 2018 13:55 — forked from oysteinjakobsen/gist:e59cdd38a688ee8a418a
How to get docker-compose (fig) up and running on Raspberry Pi 2

Background

I assume you already have Docker up and running on your Raspberry Pi 2. If not, see this article.

The next natural step is to install Docker Compose (formerly Fig), but there's no ARM support out of the box. This recipe will help you install Docker Compose on your Raspberry Pi 2!

The following six steps will do the trick:

  1. Get the docker-compose source code from git
Module Size Used by
nls_utf8 1656 1
ntfs 248252 1
fuse 99603 3
rfcomm 37723 6
cmac 3239 1
bnep 12051 2
hci_uart 20020 1
btbcm 7916 1 hci_uart
bluetooth 365780 29 hci_uart,bnep,btbcm,rfcomm
Module Size Used by
brcmfmac 293441 0
brcmutil 9927 1 brcmfmac
cfg80211 545726 1 brcmfmac
evdev 12359 0
rfkill 21008 3 cfg80211
bcm2835_gpiomem 3900 0
fixed 3285 0
uio_pdrv_genirq 3923 0
uio 10396 1 uio_pdrv_genirq
@amanharitsh123
amanharitsh123 / Performance_logs_RPi_Sugar
Created February 22, 2018 16:04
These are the memory statistics of Rpi running sugar in my half hour session (Approx.). I was going through various different activities and testing them for any bugs when the vmstat is running in background.
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 518156 18764 286752 0 0 24 2 209 125 6 1 92 1 0
0 0 0 518156 18764 286756 0 0 0 0 532 44 0 0 100 0 0
0 0 0 518156 18764 286756 0 0 0 0 530 42 0 0 100 0 0
0 0 0 518172 18764 286752 0 0 0 0 547 55 0 0 100 0 0
0 0 0 518172 18764 286752 0 0 0 0 528 44 0 0 100 0 0
0 0 0 518172 18764 286752 0 0 0 0 630 191 0 0 100 0 0
1 0 0 518172 18764 286752 0 0 0 0 939 718 3 1 97 0 0
0 0 0 518172 18764 286752 0 0 0 0 562 73 0 0 100 0 0