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 python | |
""" | |
Very simple HTTP server in python. | |
Usage:: | |
./dummy-web-server.py [<port>] | |
Send a GET request:: | |
curl http://localhost |
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
[Unit] | |
Description=Job that runs the python SimpleHTTPServer daemon | |
Documentation=man:SimpleHTTPServer(1) | |
[Service] | |
Type=simple | |
WorkingDirectory=/tmp/letsencrypt | |
ExecStart=/usr/bin/python -m SimpleHTTPServer 80 & | |
ExecStop=/bin/kill `/bin/ps aux | /bin/grep SimpleHTTPServer | /bin/grep -v grep | /usr/bin/awk '{ print $2 }'` |
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
#!/bin/bash | |
function fzf_container() { | |
docker container ls -a | fzf -m | awk '{print $1}' | |
} | |
function fzf_running_container() { | |
docker ps | fzf -m | awk '{print $1}' | |
} | |
function container() { |
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
I have Lua script that manipulates cookies and headers based at GET parameters. | |
This script didnt work well at one location, strangely the ngx.var.args was empty with ordinary request. | |
The trick was that in location we have: | |
location /x/ { | |
header_filter_by_lua_file /etc/nginx/lua/referrer_cookie.lua; | |
rewrite ^/x/(.*) /$1 break; | |
try_files $uri /x/index.htm; |
OlderNewer