Skip to content

Instantly share code, notes, and snippets.

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

Claudianus Mamertus claudianus

🏠
Working from home
  • Modumaru
  • South Korea
  • 04:27 (UTC +09:00)
View GitHub Profile
@kijin
kijin / rsa_encrypt.php
Created January 23, 2014 04:55
PHPμ—μ„œ RSA κ°œμΈν‚€/κ³΅κ°œν‚€ 쑰합을 μ‚¬μš©ν•˜μ—¬ μ„œλ²„μ— λΉ„λ°€λ²ˆν˜Έλ₯Ό μ €μž₯ν•  ν•„μš” 없이 λ¬Έμžμ—΄μ„ μ•”ν˜Έν™”ν•˜λŠ” 법
<?php
// λΉ„λŒ€μΉ­ μ•Œκ³ λ¦¬λ“¬μΈ RSAλ₯Ό μ‚¬μš©ν•˜μ—¬ λ¬Έμžμ—΄μ„ μ•”ν˜Έν™”ν•˜λŠ” 법.
// κ°œμΈν‚€ λΉ„λ°€λ²ˆν˜ΈλŠ” μ•”ν˜Έν™”ν•  λ•ŒλŠ” ν•„μš”μ—†κ³  λ³΅ν˜Έν™”ν•  λ•Œλ§Œ μž…λ ₯ν•˜λ©΄ λ˜λ―€λ‘œ
// μ„œλ²„μ— μ €μž₯ν•  ν•„μš” 없이 κ·Έλ•Œκ·Έλ•Œ κ΄€λ¦¬μžκ°€ μž…λ ₯ν•˜λ„λ‘ 해도 λœλ‹€.
// PHP 5.2 이상, openssl λͺ¨λ“ˆμ΄ ν•„μš”ν•˜λ‹€.
// RSA κ°œμΈν‚€, κ³΅κ°œν‚€ 쑰합을 μƒμ„±ν•œλ‹€.
// ν‚€ μƒμ„±μ—λŠ” μ‹œκ°„μ΄ 많이 κ±Έλ¦¬λ―€λ‘œ, ν•œ 번만 μƒμ„±ν•˜μ—¬ μ €μž₯ν•΄ 두고 μ‚¬μš©ν•˜λ©΄ λœλ‹€.
// 단, λΉ„λ°€λ²ˆν˜ΈλŠ” κ°œμΈν‚€λ₯Ό μ‚¬μš©ν•  λ•Œλ§ˆλ‹€ ν•„μš”ν•˜λ‹€.
@denji
denji / nginx-tuning.md
Last active June 7, 2025 14:57
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@rxaviers
rxaviers / gist:7360908
Last active June 10, 2025 15:38
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@kuleszaj
kuleszaj / gist:1911022
Created February 25, 2012 21:48
Simple nginx reverse proxy with extra headers.
server {
listen 1.2.3.4:80;
server_name railsapp.example.com;
location / {
proxy_set_header Host $host;
# So the original HTTP Host header is preserved
proxy_set_header X-Real-IP $remote_addr;
# The IP address of the client (which might be a proxy itself)
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# The IP address in the HTTP X-Forwarded-For header (which would be the 'origin' client).
@banksean
banksean / mersenne-twister.js
Created February 10, 2010 16:24
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();