$ diff -u /etc/nginx/nginx.conf{.ORIG,}
--- /etc/nginx/nginx.conf.ORIG 2014-04-13 04:15:51.907316500 +0000
+++ /etc/nginx/nginx.conf 2014-04-13 05:02:22.807316500 +0000
@@ -30,7 +30,9 @@
# Logging Settings
##
- access_log /var/log/nginx/access.log;
+ log_format vhosts '$host $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
This file contains 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
version: "3" | |
services: | |
sftpgo: | |
image: "drakkan/sftpgo:v2-alpine" | |
# default user id | |
user: 1026 | |
restart: always | |
expose: | |
# HTTP | |
- "8080" |
This file contains 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
# On the host | |
============= | |
lxc config set openvpn raw.lxc 'lxc.cgroup.devices.allow = c 10:200 rwm' | |
lxc config device add openvpn tun unix-char path=/dev/net/tun | |
# In the container | |
================== | |
1. mknod /dev/net/tun c 10 200 |
This file contains 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
# This is an example from a work in progress, so final versions might | |
# be slightly different. Don't use as a guide after release! | |
# Define rule set macros | |
# Whitelist a TCP destination port on the network. Use this as a template to | |
# make your own rule sets for more advanced criteria like tag matches, etc. | |
# This works for both IPv4 and IPv6. Add an ethertype match to restrict it to | |
# one or the other. | |
macro tcp_whitelist_dest_port($port) |
This file contains 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
class RequiredIf(object): | |
"""Validates field conditionally. | |
Usage:: | |
login_method = StringField('', [AnyOf(['email', 'facebook'])]) | |
email = StringField('', [RequiredIf(login_method='email')]) | |
password = StringField('', [RequiredIf(login_method='email')]) | |
facebook_token = StringField('', [RequiredIf(login_method='facebook')]) | |
""" |
This file contains 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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |