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
server { | |
listen 80; | |
server_name test.com; | |
location / { | |
# docker 內的 resolv.conf 指到 127.0.0.11 | |
resolver 127.0.0.11; | |
# 只加 resolver directive 不夠,還得用上 set | |
set $url http://example.com; | |
proxy_pass url; |
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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: lua-plugins | |
namespace: ingress-nginx | |
data: | |
main.lua: | | |
local ngx = ngx | |
local _M = {} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
const int children = 4; | |
void factor(int n) { | |
for (int i = 2; i <= n/2; i++) { | |
if (n % i == 0) printf("%d", i); | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
int main(int argc, const char * argv[]) { | |
srandom(getpid()); | |
for (int i = 0; i < 16; i++) { | |
long int r = random(); | |
printf("%ld\n", r); |
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
set -eu | |
REGION_SEPARATOR='--' | |
ec2_instance_id="$1" | |
ssh_user="$2" | |
ssh_port="$3" | |
ssh_public_key_path="$4" | |
ssh_public_key="$(cat "${ssh_public_key_path}")" | |
ssh_public_key_timeout=60 |
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
kubectl get certificaterequest | |
kubectl describe certificaterequest X | |
kubectl get order | |
kubectl describe order X | |
kubectl get challenge | |
kubectl describe challenge X |
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
PUT /_template/fluentbit | |
{ | |
"fluenbit" : { | |
"order" : 0, | |
"index_patterns" : [ | |
"fluentbit-*" | |
], | |
"settings" : { | |
"index" : { | |
"number_of_shards" : "10" |