Skip to content

Instantly share code, notes, and snippets.

View nttuyen's full-sized avatar

Nguyen The Tuyen nttuyen

View GitHub Profile
@nttuyen
nttuyen / System Design.md
Created May 4, 2024 08:51 — 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?

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@nttuyen
nttuyen / bash-pid.md
Created April 30, 2019 04:49 — forked from darth-veitcher/bash-pid.md
Bash Script PID file locking

Pattern below allows for a bash script to be called via, say, cron and check to see if it is already running.

Useful for things like rsync tasks.

PIDFILE=/var/run/myscriptname.pid

if [ -f $PIDFILE ]
then
 PID=$(cat $PIDFILE)
@nttuyen
nttuyen / mysql-docker.sh
Created April 8, 2017 08:14 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@nttuyen
nttuyen / PDOSession.php
Created June 17, 2016 02:16
session handler
<?php
/**
* PDO Session Handler
* @author Daniel15 <dan.cx>
*
* modificata da carlo@chierotti.net
* per gestire la scadenza della sessione
*
* testata in PHP53, se si passa a PHP54 si potrebbe utilizzare