Skip to content

Instantly share code, notes, and snippets.

View dastergon's full-sized avatar

Pavlos Ratis dastergon

View GitHub Profile
@dastergon
dastergon / hello.b
Created May 10, 2015 12:48
The first ever known "hello world" version
// Kernighan's 1972 A Tutorial Introduction to the Language B
// https://en.wikipedia.org/wiki/%22Hello,_World!%22_program
main(){
extrn a,b,c;
putchar(a); putchar(b); putchar(c); putchar('!*n');
}
a 'hell';
b 'o, w';
@dastergon
dastergon / ec2_info_retriever.py
Last active April 23, 2024 09:19
A basic boto3 based tool for retrieving information from running EC2 instances.
from collections import defaultdict
import boto3
"""
A tool for retrieving basic information from the running EC2 instances.
"""
# Connect to EC2
ec2 = boto3.resource('ec2')
@dastergon
dastergon / HttpURLCon.java
Created November 9, 2015 16:36
HTTP GET request in Java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class HttpURLCon {
private final String USER_AGENT = "Mozilla/5.0";
public static void main(String[] args) throws Exception {
@dastergon
dastergon / dbsnap.py
Last active March 2, 2021 05:30
dbsnap is a DB snapshot management tool for Amazon RDS.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""dbsnap is a DB snapshot management tool for Amazon RDS.
Demo tool used for educational purposes in http://blog.codebender.cc/2015/12/08/automating-db-snapshots-at-amazon-rds/
"""
from __future__ import print_function
import boto3

Keybase proof

I hereby claim:

  • I am dastergon on github.
  • I am dastergon (https://keybase.io/dastergon) on keybase.
  • I have a public key ASCWcL_1JH05ltGCQ6HWe-ZJvFnUN0PwfIz1W-Hm857bEQo

To claim this, I am signing this object:

@dastergon
dastergon / service-checklist.md
Created September 29, 2016 15:44 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?

Availability Table - Cheat sheet

Availability level Downtime per year Downtime per quarter Downtime per month Downtime per week Downtime per day Downtime per hour
90% ("one nine") 36.5 days 9 days 3 days 16.8 hours 2.4 hours 6 minutes
95% 18.25 days 4.5 days 1.5 days 8.4 hours 1.2 hours 3 minutes
99% ("two-nines") 3.65 days 21.6 hours 7.2 hours 1.68 hours 14.4 minutes 36 seconds
99.50% 1.83 days 10.8 hours 3.6 hours 50.4 minutes 7.20 minutes 18 seconds
99.9%("three nines") 8.76 hours 2.16 hours 43.2 minutes 10.1

SREcon16 Europe - Microsoft Azure SRE - Service Roast Sample

Topics
Service Overview What is it, who uses it, where does it fit in overall
Technical Architecture Overview, upstream dependencies, sub-components
Development Process Source control, external dependencies, build, test, tools
Change Management / Deployment Process, technology, cadence, gates, rollback
Configuration Management Process, technology, source control
Demand Forecasting, Capacity Management How do you shift load, or scale? How do you load test? Can you shed load?
@dastergon
dastergon / The Technical Interview Cheat Sheet.md
Last active April 21, 2019 16:15 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

Array

Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
  • They are one of the oldest, most commonly used data structures.
In [1]: class One:
...: def __init__(self):
...: self.bw_rate = 1
...:
In [2]: class Two:
...: def __init__(self):
...: self.bw_rate = 0
...: