Skip to content

Instantly share code, notes, and snippets.

View PaulisMatrix's full-sized avatar
🏠
Working from home

rushikesh PaulisMatrix

🏠
Working from home
View GitHub Profile
@PaulisMatrix
PaulisMatrix / main.go
Created October 13, 2022 10:37 — forked from julz/main.go
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@PaulisMatrix
PaulisMatrix / celery.sh
Last active April 18, 2023 07:42 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@PaulisMatrix
PaulisMatrix / readme.md
Created January 8, 2023 13:39 — forked from pawl/readme.md
test to see if psycogreen is necessary to run sqlalchemy + gevent + psycopg2 concurrently

This is a test to see if psycogreen is necessary to run sqlalchemy + gevent + psycopg2 concurrently.

benchmark command (concurrency of 10)

ab -n 10 -c 10 127.0.0.1:8080/wait

psychopg2 - sync worker (expecting concurrency of 2)

gunicorn -b 127.0.0.1:8080 -w 2 test:app

@PaulisMatrix
PaulisMatrix / System Design.md
Created March 21, 2023 15:16 — 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?
@PaulisMatrix
PaulisMatrix / last_n_lines.py
Last active March 4, 2024 17:16 — forked from AlexWaygood/last_n_lines.py
Script to find the last `n` lines of a file
import os
from collections import deque
from collections.abc import Iterator, Sequence
from typing import Final, Protocol
# Protocol is much like interfaces in go where you have objects implementing the methods
# defined under a class inherting the Protocol class.
class SeekableBytesFile(Protocol):
def seek(self, position: int, whence: int = ..., /) -> int: ...