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/ | |
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
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
| update global_variables set | |
| -- UserDataMonitor | |
| variable_value="DBMONUSER" | |
| where variable_name='mysql-monitor_username'; | |
| update global_variables set | |
| -- PasswordDataMonitor | |
| variable_value="DBMONPASS" | |
| where variable_name='mysql-monitor_password'; |
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
| ffmpeg -i input.mp4 -c copy -metadata:s:v:0 rotate=90 output.mp4 |
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/local/etc/elasticsearch/jvm.options | |
| -Xms128m | |
| -Xmx128m |
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
| $ openssl ecparam -name prime256v1 -genkey -noout -out private.ec.key | |
| $ openssl ec -in private.pem -pubout -out public.pem |
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
| awk -F ',' 'BEGIN{OFS=","} FNR != 1 {for(i=1; i<=NF; i++){ $i = "\"=\"\""$i"\"\"\"" }} {print}' input.csv > forced_string_field.csv |
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
| # ~/.bundle/config | |
| --- | |
| BUNDLE_BUILD__MYSQL2: "--with-opt-dir=/usr/local/opt/openssl@1.1" | |
| BUNDLE_BUILD__PUMA: "--with-opt-dir=/usr/local/opt/openssl@1.1" | |
| BUNDLE_BUILD__THIN: "--with-cflags=-Wno-error=implicit-function-declaration" | |
| BUNDLE_BUILD__FFI: "--with-cflags=-Wno-error=implicit-function-declaration" | |
| BUNDLE_BUILD__PG: "--with-cflags=-Wno-error=implicit-function-declaration" | |
| BUNDLE_JOBS: "8" |
NewerOlder