This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Haproxy configuration for SSL request passthrough to different backend based on SNI read from Handshaking stage | |
# The Loadbalance will not decode the encrpted data but transparently transfer to the backend server in Private subnet. | |
# With such configuration, you can install multiply services with its own SSL certificate in backend in different EC2 instance, but only explosure to public internet with one Loadbalance IP. There is no need to install SSL certificate in Loadbalancer level. | |
# Ref: | |
# How to support wildcard sni: https://stackoverflow.com/questions/24839318/haproxy-reverse-proxy-sni-wildcard | |
# https://www.haproxy.com/blog/enhanced-ssl-load-balancing-with-server-name-indication-sni-tls-extension/ | |
# https://stuff-things.net/2016/11/30/haproxy-sni/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/system/bin/sh | |
# | |
echo 0 > /proc/sys/net/ipv6/conf/default/accept_ra | |
echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6 | |
echo 0 > /proc/sys/net/ipv6/conf/all/accept_ra | |
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6 | |
echo 0 > /proc/sys/net/ipv6/conf/wlan0/accept_ra | |
echo 1 > /proc/sys/net/ipv6/conf/wlan0/disable_ipv6 | |
sleep 3 | |
echo 0 > /proc/sys/net/ipv6/conf/default/accept_ra |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -xe | |
SSH_USER_PWD="${SSH_USER_PWD}" | |
SSH_USER="${SSH_USER}" | |
VPN_GATEWAY="${VPN_GATEWAY}" | |
sshpass -p "${SSH_USER_PWD}" ssh -o StrictHostKeyChecking=no -v "${SSH_USER}@${VPN_GATEWAY}" -22 -D 9999 -nf "sleep 90000" & | |
echo 'base{log_debug = on; log_info = on; log = "file:/tmp/reddi.log";daemon = on; redirector = iptables;}redsocks { local_ip = 127.0.0.1; local_port = 12345; ip = 127.0.0.1;port = 9999; type = socks5; }' > ~/redsocks.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Output screenshot: | |
// http://cl.ly/NsqF | |
// ------------------------------------------------------- | |
include_once 'console.php'; | |
// ::log method usage | |
// ------------------------------------------------------- | |
Console::log('Im Red!', 'red'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# shortform git commands | |
alias g='git' | |
# get a list of all commit messages for a repo | |
git log --pretty=format:'%s' | |
# push changes to an empty git repository for the first time | |
git push --set-upstream origin master | |
# Remove + and - from start of diff lines |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************************************************************************************** | |
* Stripped and minified sigle-file drop-in 100% managed LZMA-Alone stream decoder. | |
* Compiled IL takes approx 10Kb only. | |
* | |
* Original code taken from LZMA SDK http://www.7-zip.org/sdk.html | |
* | |
* Decoder is placed in the public domain. | |
* Anyone is free to copy, modify, publish, use, compile, sell, or distribute the | |
* original code, either in source code form or as a compiled binary, | |
* for any purpose, commercial or non-commercial, and by any means. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Diagnostics.CodeAnalysis; | |
using System.IO; | |
using System.Runtime.InteropServices; | |
namespace ZstdCompression | |
{ | |
public static class Zstd | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create function dbo.fnSqlPivot(@sqlCheck nvarchar(4000), @sqlVal nvarchar(4000), @type nvarchar(128)) returns nvarchar(4000) as begin | |
declare @s nvarchar(4000) | |
declare @a nvarchar(4000) | |
declare @b nvarchar(4000) | |
declare @c nvarchar(4000) | |
select | |
@c='))end', | |
@b='case when '+@sqlCheck+' then '+@sqlVal+' end', | |
@a='case when max(case when('+@sqlCheck+')and(('+@sqlVal+') is not null)then 1 else 0 end)=1 then max(isnull(', | |
@s = case lower(@type) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modified from: https://gist.github.com/aksakalli/9191056 | |
using System; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.IO; | |
using System.Threading; | |
namespace MyNamespace | |
{ |
NewerOlder