Skip to content

Instantly share code, notes, and snippets.

View artyomliou's full-sized avatar
🇺🇦

Artyom Liou artyomliou

🇺🇦
View GitHub Profile
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@jmyrland
jmyrland / test.js
Last active March 25, 2025 10:15
Socket-io load test?
/**
* Modify the parts you need to get it working.
*/
var should = require('should');
var request = require('../node_modules/request');
var io = require('socket.io-client');
var serverUrl = 'http://localhost';
@denji
denji / nginx-tuning.md
Last active April 5, 2025 06:03
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.

@fsodogandji
fsodogandji / socat-tips.sh
Last active April 5, 2025 14:56
socat tips & tricks
#To create a classic TCP listening daemon, similar to netcat -l, use a variation of the following command.
socat TCP-LISTEN:8080 stdout
#use remotly a command shell
socat TCP4-LISTEN:1234,reuseaddr,fork 'SYSTEM:/bin/cat /home/infos.txt'
#sslify a server
socat OPENSSL-LISTEN:443,reuse‐addr,pf=ip4,fork,cert=server.pem,cafile=client.crt TCP4-CONNECT:localhost:80
@michaljemala
michaljemala / tls-client.go
Last active March 29, 2025 06:58
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@dahjelle
dahjelle / pre-commit.sh
Created July 13, 2016 16:48
Pre-commit hook for eslint, linting *only* staged changes.
#!/bin/bash
for file in $(git diff --cached --name-only | grep -E '\.(js|jsx)$')
do
git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes
if [ $? -ne 0 ]; then
echo "ESLint failed on staged file '$file'. Please check your code and try again. You can run ESLint manually via npm run eslint."
exit 1 # exit with failure status
fi
done
@JasonReading
JasonReading / firehose-example.php
Last active February 8, 2022 03:11
Firehose example
<?php
use Aws\Firehose\FirehoseClient;
// Install deps with `composer install`
require 'vendor/autoload.php';
$firehose = new FirehoseClient([
'version' => 'latest',
'region' => 'eu-west-1',
@wankormaru
wankormaru / sample_athena.php
Last active November 19, 2020 09:15
Athena SELECT Query Sample Program
<?php
/*-----------------------------
* Athena SELECT Query Sample Program
*
* - IAM でユーザ作成必要
* 必要な管理ポリシー : AmazonAthenaFullAccess
* - 作ったIAMユーザのクレデンシャル情報を aws configure で設定必要
* - AWS SDK for PHP version 3 のインストールが必要
*
* @date 2017/08/06
@mayorova
mayorova / README.md
Created August 10, 2017 14:44
Mutual SSL in NGINX

Securing traffic to upstream servers with client certificates

Info: https://www.nginx.com/resources/admin-guide/nginx-https-upstreams/

Creating and Signing Your Certs

Source: http://nategood.com/client-side-certificate-authentication-in-ngi

This is SSL, so you'll need an cert-key pair for you/the server, the api users/the client and a CA pair. You will be the CA in this case (usually a role played by VeriSign, thawte, GoDaddy, etc.), signing your client's certs. There are plenty of tutorials out there on creating and signing certificates, so I'll leave the details on this to someone else and just quickly show a sample here to give a complete tutorial. NOTE: This is just a quick sample of creating certs and not intended for production.