Skip to content

Instantly share code, notes, and snippets.

View samirmhsnv's full-sized avatar
👋

Samir Mammadhasanov samirmhsnv

👋
View GitHub Profile
@mikelikespie
mikelikespie / nginx.conf
Created December 31, 2011 00:14
using nginx as a websocket reverse proxy
location / {
chunked_transfer_encoding off;
proxy_http_version 1.1;
proxy_pass http://localhost:9001;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host:9001;
proxy_set_header Connection "Upgrade";
proxy_set_header Upgrade websocket;
}
@henriquemoody
henriquemoody / http-status-codes.php
Last active January 26, 2024 10:29
List of HTTP status codes in PHP
<?php
/**
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
*
* You may also want a list of unofficial codes:
*
* 103 => 'Checkpoint',
* 218 => 'This is fine', // Apache Web Server
* 419 => 'Page Expired', // Laravel Framework
@denji
denji / nginx-tuning.md
Last active May 3, 2024 03:57
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

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.

@kimus
kimus / ufw.md
Created March 2, 2014 22:46
NAT and FORWARD with Ubuntu’s ufw firewall

UFW

I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.

Install UFW

if ufw is not installed by default be sure to install it first.

@cirocosta
cirocosta / iframe.html
Last active January 6, 2024 23:02
Sending messages from child iframe to parent webpage
<!DOCTYPE html>
<html>
<head>
<title>My Iframe</title>
</head>
<body>
<button>Botão</button>
<script type="text/javascript">
@mojowen
mojowen / .aliases
Last active June 21, 2020 10:11
My dotfiles
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
# Shortcuts
alias d="cd ~/desktop"
@helanan
helanan / 404-svg-animated-page-concept-for-e-store-zajno-illustrated-by-lina.markdown
Created October 13, 2016 04:50
404 svg animated page concept for e-store @ Zajno (Illustrated by Lina)
# Distributions: RHEL_6+7 CentOS_6+7
##########################################################################
# Standard rsync command
##########################################################################
- Useful when live cloning servers.
rsync -avX --one-file-system --hard-links --numeric-ids -e 'ssh -c arcfour' /source dest:/nation
(remember to run --delete for the last sync)
@mort3za
mort3za / git-auto-sign-commits.sh
Last active January 30, 2024 10:31
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@sabahtalateh
sabahtalateh / useful_bash_commands.sh
Last active June 21, 2020 10:04
Useful bash commands
## Super Hot
cd - # go to previous directory.
## Copy public key to servers that I want to be accessible to connects to me
# server1 should be configured via ~/.ssh/config like
# Host server1
# HostName 10.0.2.4
# User sabahtalateh
# Port 22
ssh-copy-id -i id_rsa.pub server1