Nginx try_files 指令自实现之日启,风靡至今。单纯说功能实现地话,确实能够快速地适配各种需要场景,省掉了大段的 if 和 set。但相应的 URL 拼写格式,就真地不忍直视了。
2016 年 11 月 21 日修订
REQUEST_METHOD被改变地问题。
丢失的 301 跳转
Nginx try_files 指令自实现之日启,风靡至今。单纯说功能实现地话,确实能够快速地适配各种需要场景,省掉了大段的 if 和 set。但相应的 URL 拼写格式,就真地不忍直视了。
2016 年 11 月 21 日修订
REQUEST_METHOD被改变地问题。
丢失的 301 跳转
# Pull the necessary images:
docker pull nathanleclaire/curl:latest
docker pull openjdk:8u111-jre-alpine
# Start the controller container, note that it has RW access to the Docker API socket:
docker run \
-ti \
--rm \| FROM ubuntu | |
| RUN apt-get update | |
| RUN apt-get install -y socat | |
| VOLUME /foo | |
| CMD socat UNIX-LISTEN:/foo/bar.sock - |
| #@ /etc/quagga/bgpd.conf (Centos & Ubuntu) | |
| hostname <Local OS hostname> | |
| password <Any random phrase> | |
| enable password <Any random phrase> | |
| ! | |
| log file /var/log/quagga/bgpd | |
| !debug bgp events | |
| !debug bgp zebra | |
| debug bgp updates |
| #!/bin/bash | |
| #usage: nchttpd port "cmd" | |
| # port - port number to listen on for requests (if port < 1024 use sudo) | |
| # cmd - command to execute when a request comes in, ex> "cat /var/www/index.html" | |
| # | |
| #example: | |
| # $nchttpd 1500 "cat /var/www/index.html" | |
| # | |
| while true; do | |
| echo "HTTP/1.1 200 OK\r\n $($2)" | nc -lp $1 -q 1 & |
| /* | |
| * watch_unix_socket.stp | |
| * | |
| * This is a simply more modern version of the script found here: | |
| * https://sourceware.org/systemtap/wiki/WSunixSockets | |
| * | |
| * The first argument is the location of the file descriptor for a UNIX socket. | |
| * To find this address, for example, for the Docker socket run: | |
| * | |
| * # lsof 2>&1 | awk '/docker.sock/ {print $7}' | grep -v '0t0' | sort -u |
| #!/bin/bash | |
| # References | |
| # http://www.computerhope.com/unix/nc.htm#03 | |
| # https://github.com/daniloegea/netcat | |
| # http://unix.stackexchange.com/questions/26715/how-can-i-communicate-with-a-unix-domain-socket-via-the-shell-on-debian-squeeze | |
| # http://unix.stackexchange.com/questions/33924/write-inside-a-socket-open-by-another-process-in-linux/33982#33982 | |
| # http://www.linuxjournal.com/content/more-using-bashs-built-devtcp-file-tcpip | |
| # http://www.dest-unreach.org/socat/ | |
| # http://stuff.mit.edu/afs/sipb/machine/penguin-lust/src/socat-1.7.1.2/EXAMPLES |
| import logging | |
| import socket | |
| import sys | |
| import threading | |
| import time | |
| CLIENT_CONN_ADDR="127.0.0.1" | |
| CLIENT_NUM_CONNS=10 | |
| SERVER_PORT=8888 | |
| SERVER_SYN_BACKLOG=128 |
| #!/usr/bin/python | |
| import os | |
| import sys | |
| import time | |
| import logging | |
| import socket | |
| def check_unix_socket(): |
Last update: Fri Jul 26 08:23:20 UTC 2019 by @luckylittle