Skip to content

Instantly share code, notes, and snippets.

View rasismeiro's full-sized avatar

Ricardo Sismeiro rasismeiro

View GitHub Profile
@rasismeiro
rasismeiro / nginx-with-tls13-compile.sh
Created June 19, 2020 21:49 — forked from lesstif/nginx-with-tls13-compile.sh
openssl 1.1 & nginx compile script for TLS 1.3 support on RHEL/CentOS 7
## /lib/systemd/system/nginx.service
## see https://www.nginx.com/resources/wiki/start/topics/examples/systemd/
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/nginx.pid
@rasismeiro
rasismeiro / nginx-tuning.md
Created March 13, 2017 21:53 — forked from denji/nginx-tuning.md
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.

@rasismeiro
rasismeiro / supervisord.service
Created March 12, 2017 21:18 — forked from mozillazg/supervisord.service
install and configure supervisord on centos 7.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown
@rasismeiro
rasismeiro / cscart-exploit.py
Created November 21, 2016 14:30 — forked from nikcub/cscart-exploit.py
CS-Cart Session Brute Force Exploit
#!/usr/bin/env python
# CS-Cart session brute force exploit for v4.2.0
# see https://www.nikcub.com/posts/cs-cart-v4-2-0-session-hijacking-and-other-vulnerabilities/
import sys
import requests
import argparse
import re
import string
import random
@rasismeiro
rasismeiro / GoDaddySSLHAProxy.md
Created June 13, 2016 21:37 — forked from sethwebster/GoDaddySSLHAProxy.md
Creating a PEM for HaProxy from GoDaddy SSL Certificate

GoDaddy SSL Certificates PEM Creation for HaProxy (Ubuntu 14.04)

1 Acquire your SSL Certificate

Generate your CSR This generates a unique private key, skip this if you already have one.

sudo openssl genrsa -out  etc/ssl/yourdomain.com/yourdomain.com.key 1024

Next generate your CSR (Certificate Signing Request), required by GoDaddy:

@rasismeiro
rasismeiro / gist:df6161ecfda3f75f800b
Created December 16, 2015 22:19 — forked from samsamm777/gist:7230159
PHP set private property value using reflection. This allows you to set a private property value from outside the object, great for PHPUnit testing.
<?php
$a = new A();
$reflection = new \ReflectionClass($a);
$property = $reflection->getProperty('privateProperty');
$property->setAccessible(true);
$property->setValue($a, 'new-value');
echo $a->getPrivateProperty();
//outputs:
@rasismeiro
rasismeiro / .bash_profile
Last active September 5, 2015 18:28 — forked from JeffreyWay/.bash_profile
Prettier git logs
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@rasismeiro
rasismeiro / slowloris.php
Last active August 29, 2015 14:26 — forked from Macuyiko/slowloris.php
PHP based slowloris attack with slow headers or post variants. Adapted from script here: <http://seclists.org/fulldisclosure/2009/Jun/207>
#! /usr/bin/env php
<?php
/* PHP Slowloris
* Adapted from the script found here: http://seclists.org/fulldisclosure/2009/Jun/207
* Contains get based attack (slow headers) and post based attack (long content length)
*
* Author: Seppe vanden Broucke
*/
function usage($argv){