I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.
- Flask is managed by
uWSGI. uWSGItalks tonginx.
| // Parsing arbitrary JSON using interfaces in Go | |
| // Demonstrates how to parse JSON with abritrary key names | |
| // See https://blog.golang.org/json-and-go for more info on generic JSON parsing | |
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| ) |
| # Make sure you have these installed | |
| yum install -y make gcc perl pcre-devel zlib-devel | |
| # Download/Extract source | |
| wget -O /tmp/haproxy.tgz http://www.haproxy.org/download/1.7/src/haproxy-1.7.2.tar.gz | |
| tar -zxvf /tmp/haproxy.tgz -C /tmp | |
| cd /tmp/haproxy-* | |
| # Compile HAProxy | |
| # https://github.com/haproxy/haproxy/blob/master/README | |
| make \ | |
| TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \ |
| #!/bin/bash | |
| # | |
| # /etc/rc.d/init.d/node_exporter | |
| # | |
| # Prometheus node exporter | |
| # | |
| # description: Prometheus node exporter | |
| # processname: node_exporter | |
| # Source function library. |
| 8.2.2. TCP log format | |
| --------------------- | |
| The TCP format is used when "option tcplog" is specified in the frontend, and | |
| is the recommended format for pure TCP proxies. It provides a lot of precious | |
| information for troubleshooting. Since this format includes timers and byte | |
| counts, the log is normally emitted at the end of the session. It can be | |
| emitted earlier if "option logasap" is specified, which makes sense in most | |
| environments with long sessions such as remote terminals. Sessions which match | |
| the "monitor" rules are never logged. It is also possible not to emit logs for |
| 8.2.3. HTTP log format | |
| ---------------------- | |
| The HTTP format is the most complete and the best suited for HTTP proxies. It | |
| is enabled by when "option httplog" is specified in the frontend. It provides | |
| the same level of information as the TCP format with additional features which | |
| are specific to the HTTP protocol. Just like the TCP format, the log is usually | |
| emitted at the end of the session, unless "option logasap" is specified, which | |
| generally only makes sense for download sites. A session which matches the | |
| "monitor" rules will never logged. It is also possible not to log sessions for |
| ##TCP FLAGS## | |
| Unskilled Attackers Pester Real Security Folks | |
| ============================================== | |
| TCPDUMP FLAGS | |
| Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere) | |
| Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere) | |
| Pester = PSH = [P] (Push Data) | |
| Real = RST = [R] (Reset Connection) | |
| Security = SYN = [S] (Start Connection) |
| KEYBINDINGS | |
| byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or within .screenrc if byobu-export was used). The common key bindings | |
| are: | |
| F2 - Create a new window | |
| F3 - Move to previous window | |
| F4 - Move to next window |
| Enable huawei modem | |
| usb_modeswitch -v 12d1 -p14fe -V 12d1 -P 1506 -M "55534243123456780000000000000011063000000100010000000000000000" | |
| WV Dial config | |
| [Dialer Defaults] | |
| Init1 = ATZ | |
| Init2 = ATE1 | |
| Init3 = AT+CGDCONT=1,"IP","connect" | |
| Stupid Mode = 1 | |
| MessageEndPoint = "0x01" |
| You should adjust the way you make and load the table | |
| CREATE TABLE sns_memory SELECT * FROM sns WHERE 1=2; | |
| ALTER TABLE sns_memory ENGINE=MEMORY; | |
| INSERT INTO sns_memory SELECT * FROM sns; | |
| DROP TABLE sns; | |
| ALTER TABLE sns_memory RENAME sns; |