Skip to content

Instantly share code, notes, and snippets.

View tyagian's full-sized avatar

Anuj Tyagi tyagian

View GitHub Profile

ETags: a pretty sweet feature of HTTP 1.1

HTTP caching review

HTTP provides two ways for servers to control client-side caching of page components:

  • freshness may be based on a date or a token whose meaning is app-specific
  • whether or not the client needs to confirm the cached version is up-to-date with the server

This breaks down as follows:

  • Cache locally and don't check before using.
@tyagian
tyagian / concatenate multiple csv files in panda.py
Created September 13, 2019 18:37 — forked from arsham/concatenate multiple csv files in panda.py
concatenate multiple csv files in panda
import glob
import pandas as pd
fds = []
for f in glob.glob("**/*.csv"):
fds.append(pd.read_csv(f))
frame = pd.concat(fds)
@tyagian
tyagian / FB-PE-InterviewTips.md
Created August 20, 2019 22:30 — 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

@tyagian
tyagian / update-golang.md
Created November 12, 2018 21:43
how to update Go

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@tyagian
tyagian / crontab.cron
Created April 18, 2018 16:19 — forked from zealot128/crontab.cron
Omnibus Gitlab backup cronjob
# Crontab
# once per week backup, move to "/backup" gzip it, delete everything but the latest 5 files
0 4 * * 1 /opt/gitlab/bin/gitlab-ci-rake gitlab:backup:create CRON=1 && mv /var/opt/gitlab/backups/* /backup/ && cd /backup && gzip *.tar && rm `ls -t | awk 'NR>5'`