Skip to content

Instantly share code, notes, and snippets.

View Lusitaniae's full-sized avatar
🏺

Pedro Gomes Lusitaniae

🏺
View GitHub Profile
@buffalu
buffalu / README.md
Last active January 23, 2024 17:09
CoreOS ignition file for one-click Solana RPC server deployment

About

This contains a CoreOS Ignition file that automatically configures a Solana RPC server on both private and public IPs.

Setup Instructions

  1. Go to Equinix Metal and choose a good machine. (Can also go through Solana Foundation Server Program).
  2. Create your server.
  3. For OS, choose iPXE.
  4. For URL, type in: https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_packet.ipxe
  5. Click add user data. Run cat rpc-{private|public}.yaml | docker run --rm -i quay.io/coreos/ct:latest-dev --platform=custom. Copy and paste that (removing the last % if present).
  6. Let it deploy.
@shahnhogan
shahnhogan / download-redisinsight.cmd
Last active October 21, 2023 12:01
Download latest RedisInsight for Windows
curl -O https://download.redisinsight.redis.com/latest/RedisInsight-v2-win-installer.exe
@ameenkhan07
ameenkhan07 / FB-PE-InterviewTips.md
Last active May 8, 2024 05:03
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

@skwashd
skwashd / README.md
Last active April 2, 2024 15:59
Copy AWS SSM Parameter Store Path

This Python (3.6+) script is for migrating Amazon AWS System Manager (SSM) Parameter Store keys from one path to another.

Quick Start

To install the script do the following:

  • Configure your AWS credentials
  • Grab the code from this gist
  • Make it executable (chmod +x /path/to/copy-ssm-ps-path.py)
  • pip install boto3 (if you don't have it installed already)
@caseywatts
caseywatts / darken.md
Last active April 25, 2024 14:47
Darkening PDFs

short url to these instructions: caseywatts.com/darken

Other gists & tricks: http://caseywatts.com/gists-and-tricks

Using Monochrome (recommended)

  • obtain your ugly, gray pdf
  • brew install imagemagick
  • brew install ghostscript
  • magic command!

Scaling your API with rate limiters

The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.

In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.

Request rate limiter

This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.

@leonardofed
leonardofed / README.md
Last active May 3, 2024 01:24
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@joepie91
joepie91 / index.js
Last active June 23, 2023 23:42
Breaking CloudFlare's "I'm Under Attack" challenge
'use strict';
const parseExpression = require("./parse-expression");
function findAll(regex, target) {
let results = [], match;
while (match = regex.exec(target)) {
results.push(match);
}
@vasanthk
vasanthk / System Design.md
Last active May 8, 2024 22:55
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?
@bactisme
bactisme / nginx_status_codes.py
Last active April 7, 2022 04:11
Very simple munin plugin to graph nginx HTTP error codes
#!/usr/bin/python
# ALL FAME GOES HERE : https://gist.github.com/mipearson/1146151
#
# 1/ Place where you want (like /usr/share/munin/plugins/nginx_status_codes.py )
# 2/ Link in /etc/munin/plugins/ :
# ln -s /usr/share/munin/plugins/nginx_status_codes.py /etc/munin/plugins/nginx_errors
# chmod +x /etc/munin/plugins/nginx_errors
# 3/ Test with
# munin-run nginx_errors
# 4/ If nescessary : add these lines in your munin conf