Skip to content

Instantly share code, notes, and snippets.

View mrsinguyen's full-sized avatar
🎯
Focusing

Si Nguyen mrsinguyen

🎯
Focusing
View GitHub Profile

Notes on Martin Kleppmann's excellent Designing Data-Intensive Applications.

Chapter 1: Reliable, Scalable, and Maintainable Applications

  • Data Systems
    • Dimensions to consider when thinking about data systems: access patterns, performance characteristics, implementations.
    • Modern data systems often blur the lines between databases, caches, streams, etc.
  • Reliability
    • Systems should perform the expected function at a given level of performance, and be tolerant to faults and user mistakes
  • Fault: One component of a system deviating from its spec. Prefer tolerating faults over preventing them (except for things like security issues). Faults stem from hardware failures, software failures, and human error (in a study, config errors caused most outages).
@mrsinguyen
mrsinguyen / xss2.txt
Created April 30, 2018 05:01
XSS payload by RedBirdTeam
__ __ _____ _____
\ \ / // ____/ ____|
\ V /| (___| (___
> < \___ \\___ \ [RedBirdTeam]
/ . \ ____) |___) |
_____ __ / / \_\_____/_____/ _____ _____
| __ \ /\\ \ / / | / _ \ /\ | __ \ / ____| <script>alert(/Payloads XSS Filter Bypass List/)</script>
| |__) / \\ \_/ /| | | | | | / \ | | | | (___
| ___/ /\ \\ / | | | | | |/ /\ \ | | | |\___ \

Keybase proof

I hereby claim:

  • I am mrsinguyen on github.
  • I am mrsinguyen (https://keybase.io/mrsinguyen) on keybase.
  • I have a public key ASAqD2M8zZeIDa5vsxclq9Nfc0BoxlUegT6z-mKIgHk0zQo

To claim this, I am signing this object:

@mrsinguyen
mrsinguyen / node-and-npm-in-30-seconds.sh
Created December 3, 2020 06:35 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@mrsinguyen
mrsinguyen / gist:1eaae83abf04eb26b35f
Created June 4, 2014 09:06
Install OpenScholar via drush
[15:55][mrsinguyen@Nguyen:~/Workspaces/Me/dos73121]$ drush si openscholar --site-name=OpenScholar --account-name=admin --account-pass=admin --account-mail=info@nguyentiensi.com --debug
Bootstrap to phase 0. [0.01 sec, 1.87 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 1.99 MB] [bootstrap]
Cache HIT cid: 6.2.0-commandfiles-0-d5fe00a1b38ac806bd0b01f795e6b3cc [0.01 sec, 2 MB] [debug]
Bootstrap to phase 0. [0.11 sec, 5.32 MB] [bootstrap]
Bootstrap to phase 1. [0.18 sec, 5.32 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.18 sec, 5.32 MB]
@mrsinguyen
mrsinguyen / na.md
Last active July 2, 2020 08:32
Từ điển tiếng Nghệ An
Con trâu thì gọi “con tru”
Con dâu thì gọi “con du” trong nhà
“Mấn” là “váy”, “ngái” là “xa”
“Đi mô?” để hỏi ai là “đi đâu? ”
“Nác su” ý nói “nước sâu”
“Trấy bù” để gọi “quả bầu” đấy nha
“Gác bếp” thì gọi là “tra”
“Lông cơn” thực chất đó là “trồng cây”
“Ra sân” thì nói “ra cươi”
@mrsinguyen
mrsinguyen / 00.imgproxy_vs_alternatives.md
Created May 4, 2020 08:06 — forked from DarthSim/00.imgproxy_vs_alternatives.md
imgproxy vs alternatives benchmark

imgproxy vs alternatives benchmark

Setup

  • c5.xlarge AWS instance: 4 CPUs, 8 GB RAM
  • Ubuntu 18.04
  • Go 1.12
  • Python 2.7
  • Vips 8.7.4
@mrsinguyen
mrsinguyen / mysql.sql
Created May 4, 2020 07:34
Show largest mysql tables
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 10;
@mrsinguyen
mrsinguyen / ssh-to-pem
Created May 4, 2020 07:17
Convert SSH key to pem
# Generate the ssh key
ssh-keygen -t rsa -b 4096 -f /tmp/key
# Convert it to a PEM file
ssh-keygen -p -m PEM -f /tmp/key