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
.:53 { | |
hosts /config/host { | |
fallthrough | |
} | |
forward . 1.1.1.1 8.8.8.8 | |
# Cache 300 second | |
cache 300 { | |
success 10000 | |
denial 2500 |
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
version: '3.9' | |
services: | |
crdb-1: | |
image: cockroachdb/cockroach:v23.1.13 | |
ports: | |
- "26257:26257" | |
- "8080:8080" | |
environment: | |
- COCKROACH_USER=admin | |
- COCKROACH_PASSWORD=password |
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
version: '3.9' | |
services: | |
scylladb: | |
image: "scylladb/scylla:5.1.8" | |
ports: | |
- "9042:9042" | |
volumes: | |
- "./docker-data/scylla/:/var/lib/scylla/" |
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
namespaces=("namespace_a" "namespace_b") | |
for n in "${namespaces[@]}" | |
do | |
echo "Process for namespace=${n}" | |
# Backup kubernetes namespace | |
echo "Backup namespace" | |
kubectl get namespaces "${n}" -o yaml > "ns-${n}.yaml" |
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
--Find data range between '20200901' AND '20200930' | |
-- Full sql | |
SELECT DATA.* FROM ( | |
SELECT 1 AS ID, '20200801' AS START_D, '20200915' AS END_D FROM DUAL | |
UNION | |
SELECT 2 AS ID, '20200913' AS START_D, '20200923' AS END_D FROM DUAL | |
UNION | |
SELECT 3 AS ID, '20200924' AS START_D, '20201225' AS END_D FROM DUAL | |
UNION |
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
import Script from "next/script"; | |
const GoogleDFP: React.FC<{ | |
path: string; | |
size: number[][]; | |
id: string; | |
}> = ({ id = "", path, size }) => { | |
const [mounted, setMounted] = useState(false); | |
useEffect(() => { | |
setMounted(true); | |
return () => { |
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
MYSQL_USER=xxxx | |
MYSQL_PASS=yyyyy | |
MYSQL_CONN="-u${MYSQL_USER} -p${MYSQL_PASS}" | |
/usr/local/mysql/bin/mysql ${MYSQL_CONN} -N -e 'show databases' \ | |
| while read dbname; \ | |
do /usr/local/mysql/bin/mysqldump ${MYSQL_CONN} --complete-insert --routines --triggers --single-transaction --databases "$dbname" \ | |
| sed -r "s/ENGINE=MyISAM/ENGINE=InnoDB/g" \ | |
| sed -r "s/COLLATE=(latin1|utf8_bin|utf8|utf8_unicode_ci|utf8_unicode_ci|)/COLLATE=utf8mb4_0900_ai_ci/g" \ | |
| sed -r "s/COLLATE (latin1|utf8_bin|utf8|utf8_general_ci|utf8_unicode_ci)/COLLATE utf8mb4_0900_ai_ci/g" \ |
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
iptables -I DOCKER-USER -i "*" -o "*" -j ACCEPT |
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
var tagToExcludes = {'br': true, 'meta': true, 'style': true, 'title': true, 'script': true}; | |
var contentDomProcessor = function(dom) { | |
if(dom.children.length === 0) { | |
//Remove tag | |
var tagName = dom.tagName.toLowerCase(); | |
if(tagName in tagToExcludes) { | |
dom.remove(); | |
} | |
//If empty tag remove |
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
#Create file in /etc/logrotate.d/nginx | |
/usr/local/nginx/logs/*.log { | |
daily | |
missingok | |
rotate 52 | |
compress | |
delaycompress | |
notifempty | |
create 640 root adm |
NewerOlder