Skip to content

Instantly share code, notes, and snippets.

Coffee first.

Daniel Negri danielnegri

Coffee first.
View GitHub Profile
danielnegri /
Created Jul 1, 2020 — forked from ameenkhan07/
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.


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).


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

Irio / 2017-09-28-cities.csv
Created Oct 8, 2017
[Serenata] 2017-10-07-irio-destino-das-emendas
View 2017-09-28-cities.csv
id city state_id state_name state
1100015 Alta Floresta D'Oeste 11 Rondônia RO
1100023 Ariquemes 11 Rondônia RO
1100031 Cabixi 11 Rondônia RO
1100049 Cacoal 11 Rondônia RO
1100056 Cerejeiras 11 Rondônia RO
1100064 Colorado do Oeste 11 Rondônia RO
1100072 Corumbiara 11 Rondônia RO
1100080 Costa Marques 11 Rondônia RO
1100098 Espigão D'Oeste 11 Rondônia RO
devisnotnull /
Last active Nov 17, 2020
Installing Kubernetes on Proxox, Herzner

Installing Kubernetes on Proxox

For this example i shall be using a dedicated server from Hertzner. A shout out to hetzner if your looking for cheap and beefy dedicated hosting then these guys are your best bet.

Setting up the Hertzer server

This guide assumes your server has Debian 8 (Jessie installed)

Config when tested

sander / Dockerfile
Created Jan 9, 2015
WordPress image with imagick, ssmtp, gd, freetype
View Dockerfile
FROM wordpress
RUN apt-get update && apt-get install -y libmagickwand-6.q16-dev --no-install-recommends \
&& ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/MagickWand-config /usr/bin \
&& pecl install imagick \
&& echo "" > /usr/local/etc/php/conf.d/ext-imagick.ini
RUN apt-get update && apt-get install -y ssmtp --no-install-recommends \
&& echo 'sendmail_path=/usr/sbin/sendmail -t -i\nsendmail_from=FROM_MAIL_ADDRESS' > /usr/local/etc/php/conf.d/set-sendmail.ini
anupamshakya7 / Transformation_From_XSLT
Created Apr 25, 2014
How to transform an XML file using XSLT in Python
View Transformation_From_XSLT
from lxml import etree
data = open('D:\Conversion\MACSXML_Parts.xslt')
xslt_content =
xslt_root = etree.XML(xslt_content)
dom = etree.parse('D:\Conversion\Cat2015UF.xml')
transform = etree.XSLT(xslt_root)
result = transform(dom)
f = open('D:\Conversion\MACSXML_Parts.csv', 'w')
thor27 /
Last active Aug 29, 2015
Hanoi Tower
import os
class Game(dict):
def __init__(self, number_of_piecies, frontend=lambda x:None, start_column=0b001, end_column=0b100):
super(Game, self).__init__()
for column in [0b001, 0b010, 0b100]:
self[column] = Column(self)
self.frontend = frontend(self)
for num in range(number_of_piecies,0,-1):
if [ -f /usr/bin/ec2metadata ]
IPADDR=`timeout 1 ec2metadata --public-hostname`
if [ "$IPADDR" = "" ]
dcsobral / modifyZIP.scala
Created Sep 28, 2012
Adds a fake header to ZIP files to produce valid ZIP files that ZipInputStream cannot decode
View modifyZIP.scala
exec scala "$0" "$@"
if (args.length != 2)
sys.error("Please pass input and output files as parameters")
val inputFile = new File(args(0))
val outputFile = new File(args(1))
aereal / gist:2802359
Created May 27, 2012
Guardfile for Rails with Factory Girl
View gist:2802359
guard 'rspec', version: 2, cli:'.rspec')' '), all_after_pass: false, all_on_start: false do
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
# Rails example
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
View default
# as we’re going to use Unicorn as the application server
# we’re not going to use common sockets
# but Unix sockets for faster communication
upstream shop {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
# for UNIX domain socket setups:
server unix:/tmp/shop.socket fail_timeout=0;
You can’t perform that action at this time.