Skip to content

Instantly share code, notes, and snippets.

hostname: centos-2gb-nbg1-1
instance-id: 3449213
local-ipv4: ''
network-config:
config:
- mac_address: 96:00:00:33:00:b1
name: eth0
subnets:
- dns_nameservers:
- 213.133.100.100
@sakisv
sakisv / decorators.py
Created September 29, 2024 21:48 — forked from nitely/decorators.py
Django, django-ratelimit on login admin view
#-*- coding: utf-8 -*-
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
# https://github.com/jsocol/django-ratelimit
from ratelimit.decorators import ratelimit
@sakisv
sakisv / System Design.md
Created November 12, 2019 18:22 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?

Keybase proof

I hereby claim:

  • I am sakisv on github.
  • I am sakisv (https://keybase.io/sakisv) on keybase.
  • I have a public key ASBQGr4xmydLhW9PEyuKu0yQqwIlJIkbsyf6lCZrm0jhqQo

To claim this, I am signing this object:

@sakisv
sakisv / clean-conduit.sh
Created February 14, 2018 11:03
Clean up lingering conduit instances
#!/usr/bin/env bash
if [[ $# -eq 0 ]]; then
cat <<EOF
This will clean any __conduit_XXXXX apps for the given space.
Check with the team members before cleaning them to ensure that
no one is running any important db tasks.
Usage: clean-conduit TARGET-SPACE
#!/bin/bash
S3_BUCKET="BUCKET_NAME_AND_PATH"
for i in {01..29}; do
mkdir ${i}
echo "$(date) Downloading day 2018-01-${i}..."
aws-auth s3cmd sync s3://${S3_BUCKET} ./${i}/ -q
echo "$(date) Counting lines 2018-01-${i}..."
@sakisv
sakisv / cf-db.sh
Last active October 3, 2017 13:41
Make connecting to the db easier
#!/usr/bin/env bash
APP="notify-api"
LOCAL_PORT=6666
TEMP_COMMAND_FILE="${HOME}/.cf-db-command"
function delete_tmp_file {
if [[ -f "${TEMP_COMMAND_FILE}" ]]; then
rm "${TEMP_COMMAND_FILE}"
fi