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
#!/bin/bash | |
# 用法1: proxy docker.io/library/caddy:2-alpine | |
# 用法2: proxy -c docker.io/library/caddy:2-alpine | |
# 用法3: proxy docker.io/library/caddy:2-alpine library/caddy:2-alpine | |
remove_domain=false | |
if [ "$1" = "-c" ]; then | |
remove_domain=true | |
shift |
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
const fs = require("fs"); | |
const path = require("path"); | |
const asar = require("asar"); | |
const src = "../resources/app.asar"; | |
const dest = "../resources/app_copy"; | |
// if dest exists, remove it | |
if (fs.existsSync(dest)) { | |
fs.rmSync(dest, { recursive: true }); |
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
function FindProxyForURL(url, host) { | |
if (dnsDomainIs(host, ".jetbrains.com") | |
|| dnsDomainIs(host, ".gradle.org") | |
|| dnsDomainIs(host, ".githubusercontent.com")) { | |
return "PROXY 172.16.201.206:7890; DIRECT"; | |
} else { | |
return "DIRECT"; | |
} | |
} |
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
#parse("equalsHelper.vm") | |
public boolean sameWith(## | |
#if ($settings.generateFinalParameters) | |
final ## | |
#end | |
$class.name $instanceBaseName){ | |
return this == $instanceBaseName && | |
#set($i = 0) | |
#foreach($field in $fields) | |
#if ($i > 0) |
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
RedisSessionHandlerValve valve = new RedisSessionHandlerValve(); | |
Pipeline pipeline = Mockito.mock(Pipeline.class); | |
Container container = Mockito.mock(Container.class); | |
Context context = Mockito.mock(Context.class); | |
Mockito.when(context.getParent()).thenReturn(container); | |
Mockito.when(context.getName()).thenReturn("/"); | |
Mockito.when(context.getPipeline()).thenReturn(pipeline); | |
Mockito.when(container.getName()).thenReturn("Nice"); |
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
#!/bin/bash | |
set -e | |
DOMAIN_KEY="example.cn" | |
# 1. Request cert by acme.sh | |
# Copy cert and key files to acme_target directory after issued. | |
TARGET_PREFIX=$(date +%Y%m%d) |
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
#!/bin/bash | |
# Directory structure | |
# ─ /etc/pki/nginx | |
# ├─ 20231204_3m | |
# │ └─ example.com | |
# │ ├─ chain | |
# │ └─ key | |
# ├─ example.com.cer --> 20231204_3m/example.com/chain | |
# └─ private |
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
version: '3.1' | |
services: | |
zookeeper: | |
image: zookeeper:3.8.4-jre-17 | |
restart: always | |
hostname: zoo1 | |
ports: | |
- 2181:2181 | |
deploy: | |
resources: |
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
#!/bin/bash | |
rsync -avzh --progress --stats some_file_dir/ [email protected]:/data/some_file_dir/ |
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
#!/bin/bash | |
ACTION=$1 | |
TOMCAT_HOME=$2 | |
STARTUP_SH="startup.sh" | |
STOP_SH="shutdown.sh" | |
PORTER=$(which tomcat-porter 2>/dev/null) | |
HEALTH_HTTP_CODE=(200 404 403 405) | |
APP_START_TIMEOUT=30 | |
[ -z "$ACTION" ] && echo "ERROR: Not found argument 1" && exit 1 |
NewerOlder