nginx_conf_cloudflare_real_ip.sh
CF_CFG=/tmp/nginx-realip.conf.$RANDOM
CF_V4=$(curl -s https://www.cloudflare.com/ips-v4)
CF_V6=$(curl -s https://www.cloudflare.com/ips-v6)
cat << 'EoF' > ${CF_CFG}
real_ip_recursive on;
_print(){ | |
if [[ -z "$1" ]]; then | |
local funcname=${FUNCNAME[0]} | |
echo -e "Usage:" | |
echo -e "$funcname texts (bold|faint|italic|underline) (red|green|yellow|white)" | |
echo -e "Try:" | |
echo -e "$funcname hello" | |
echo -e "$funcname hello bold" | |
echo -e "$funcname hello bold red" | |
fi |
#!\bin\bash | |
RED="\033[31m" | |
YELLOW="\033[33m" | |
GREEN="\033[32m" | |
RESET="\033[0m" | |
print_yellow() { | |
echo -e "${YELLOW}${1}${RESET}" | |
} |
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return "Hello world!" | |
if __name__ == '__main__': | |
app.debug = True |
import java.util.*; | |
class Shape { | |
private String name; | |
public Shape(String name) { | |
this.name = name; | |
} | |
public String getName() { |
class A { | |
private int x; | |
public A(int x) { | |
this.x = x; | |
System.out.println("A"); | |
} | |
public void foo() { | |
System.out.println(x); |
{% extends '/base-map.html' %} | |
{% block body %} | |
<div> | |
<p id="coords"></p> | |
<div> | |
<button id="chiangmai">ไปเชียงใหม่</button> | |
<button id="hatyai">ไปหาดใหญ่</button> | |
<button id="bankkok">ไปกรุงเทพ</button> | |
</div> | |
<div id="mapid" style="margin: 1em;"></div> |
{% extends '/base-map.html' %} | |
{% block body %} | |
<div> | |
<p id="coords"></p> | |
<div id="mapid" style="margin: 1em;"></div> | |
</div> | |
<script type="text/python"> | |
from browser import alert, document, window, html |