Skip to content

Instantly share code, notes, and snippets.

View vivekraj59's full-sized avatar
🦇

Vivek Raj vivekraj59

🦇
View GitHub Profile
@vivekraj59
vivekraj59 / passing_client_ssl_certificate_options_haproxy.conf
Created November 21, 2023 18:22 — forked from marcelog/passing_client_ssl_certificate_options_haproxy.conf
Sample haproxy configuration snippet that will pass the SSL client certificate information to your application
mode http
http-request set-header X-SSL %[ssl_fc]
http-request set-header X-SSL-Client-Cert %[ssl_fc_has_crt]
http-request set-header X-SSL-Client-Verify %[ssl_c_verify]
http-request set-header X-SSL-Client-SHA1 %{+Q}[ssl_c_sha1,hex]
http-request set-header X-SSL-Client-DN %{+Q}[ssl_c_s_dn]
http-request set-header X-SSL-Client-CN %{+Q}[ssl_c_s_dn(cn)]
http-request set-header X-SSL-Issuer %{+Q}[ssl_c_i_dn]
http-request set-header X-SSL-Client-Not-Before %{+Q}[ssl_c_notbefore]
http-request set-header X-SSL-Client-Not-After %{+Q}[ssl_c_notafter]
@vivekraj59
vivekraj59 / github-regexp.csv
Created February 17, 2020 06:24 — forked from steren/github-regexp.csv
All regular expressions on GitHub, extracted with https://gist.github.com/steren/4e8784ba782c624be48f97a4ea808f28
We can't make this file beautiful and searchable because it's too large.
pattern,cnt
^,1657
-$,376
--,355
root.*/file.*\n,348
(?m)^hello world,338
\s+,296
\s*,278
^[a-z],275
[cg]pu,245
@vivekraj59
vivekraj59 / combine.py
Created April 17, 2019 03:36 — forked from DominicBM/combine.py
combine multiple xml files into one (Python 2.7)
import os, re
file = 'm384-import-11.xml'
filenames = ['M384_0201_output.xml','M384_0202_output.xml','M384_0203_output.xml','M384_0204_output.xml','M384_0205_output.xml','M384_0206_output.xml','M384_0207_output.xml','M384_0208_output.xml','M384_0209_output.xml','M384_0210_output.xml','M384_0211_output.xml','M384_0212_output.xml','M384_0213_output.xml','M384_0214_output.xml','M384_0215_output.xml','M384_0216_output.xml','M384_0217_output.xml','M384_0218_output.xml','M384_0219_output.xml','M384_0220_output.xml']
counter = 2
outputfile = file
for fname in filenames:
in_size = (os.stat(fname).st_size / 1000000)
@vivekraj59
vivekraj59 / docker-for-mac.md
Created August 14, 2018 14:07 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker for Mac Moby VM

2018 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Moby VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1