Skip to content

Instantly share code, notes, and snippets.

@peerapach
peerapach / docker-compose.yaml
Created May 21, 2024 12:37
docker compose with nfs mount
version: "3.2"
services:
db:
image: mariadb
user: root
environment:
MARIADB_ROOT_PASSWORD: mypass
ports:
- 3306:3306
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
|||รางวัลที่ 1|2 ตัวบน|3 ตัวบน|2 ตัวล่าง|3 ตัวหน้า 3 ตัวล่าง
1|มีนาคม|2566|417652|52|652|55|577 919 748 984
16|กุมภาพันธ์|2566|590417|17|417|80|664 195 523 377
1|กุมภาพันธ์|2566|297411|11|411|92|181 789 101 664
17|มกราคม|2566|812519|19|519|47|443 389 849 564
30|ธันวาคม|2565|157196|96|196|58|007 522 250 425
16|ธันวาคม|2565|845093|93|093|14|411 912 593 855
1|ธันวาคม|2565|375805|05|805|08|170 786 409 421
16|พฤศจิกายน|2565|121789|89|789|64|532 722 157 973
1|พฤศจิกายน|2565|913106|06|106|70|722 839 343 922
@peerapach
peerapach / nginx-forward-proxy-debian11
Last active October 15, 2022 13:14
build nginx to support the CONNECT method request (forward proxy)
apt-get update
apt-get install -y wget curl libpcre3 libpcre3-dev libssl-dev build-essential dh-make libpcre2-dev zlib1g-dev lsb-release quilt git
cd /tmp
git clone https://github.com/chobits/ngx_http_proxy_connect_module.git
wget http://nginx.org/packages/debian/pool/nginx/n/nginx/nginx_1.22.0.orig.tar.gz
tar xvzf nginx_1.22.0.orig.tar.gz
@peerapach
peerapach / redsock2-centos
Created October 15, 2022 04:58
redsock2 centos7
yum install libevent-devel git gcc git make openssl-devel
cd /tmp
git clone https://github.com/semigodking/redsocks.git
cd redsocks
make
@peerapach
peerapach / default.conf
Created January 8, 2021 07:25
simple nginx conf
server {
listen 8080;
server_name _;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
@peerapach
peerapach / index.html
Last active January 23, 2021 01:47
simple html
<!DOCTYPE html>
<html>
<head>
<title>Hello World!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
def gitURL="[email protected]/Account.git"
def appName="acc-prod-bluegreen"
def svcName="acc-prod"
def project="cloud-prod"
def tag="blue"
def altTag="green"
def verbose="false"
try {
timeout(time: 500, unit: 'MINUTES') {
oc get hpa -l 'app=activemq-health' --no-headers=true 2>&1 | awk -v q="'" '{ if($0 != "No resources found.") { print "oc patch hpa "$1 " --patch " q"{\"spec\":{\"minReplicas\":1}}"q } }' |xargs -0 bash -c -
@peerapach
peerapach / awk-single-qute.txt
Created April 24, 2020 16:59
print single quote in awk
awk -v q="'" '{print "value is" q $1 q}' inputfile
or
awk '{print "value is \x27" $1 "\x27"}' inputfile
apiVersion: v1
kind: Service
metadata:
name: app-user1-service-blue
namespace: user1
spec:
selector:
app: app-user-blue
ports:
- protocol: TCP