Skip to content

Instantly share code, notes, and snippets.

View czp3009's full-sized avatar
πŸ’­
ζˆ‘δ»Šε€©ε°±θ¦ε‘Šθ―‰δ½ δ»€δΉˆε«εš ε’•ε’•ε’•

czp czp3009

πŸ’­
ζˆ‘δ»Šε€©ε°±θ¦ε‘Šθ―‰δ½ δ»€δΉˆε«εš ε’•ε’•ε’•
View GitHub Profile
@czp3009
czp3009 / cloudsql-proxy-with-proxy.sh
Last active August 24, 2020 05:10
proxy for cloudsql-proxy
export HTTP_PROXY=localhost:10809
./cloud_sql_proxy $*
@czp3009
czp3009 / SecurityConfig.kt
Created August 12, 2020 15:17
configure reactive spring-security for google cloud IAP
package com.hiczp.example.spring.security.webflux.google.iap
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.cloud.gcp.autoconfigure.security.IapAuthenticationProperties
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.security.config.Customizer
import org.springframework.security.config.annotation.method.configuration.EnableReactiveMethodSecurity
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity
import org.springframework.security.config.web.server.ServerHttpSecurity
@czp3009
czp3009 / build.gradle
Created May 15, 2020 06:15
Skip signMavenJavaPublication when publish to maven local
gradle.taskGraph.whenReady { taskGraph ->
tasks.signMavenJavaPublication.onlyIf { taskGraph.hasTask tasks.publish }
}
@czp3009
czp3009 / dispatch.yaml
Created May 14, 2020 06:54
Deploy SPA and API service in same GAE
dispatch:
- url: "*/api/*"
service: api
- url: "*/api"
service: api
- url: "*/*"
service: front-end
@czp3009
czp3009 / app.yaml
Last active August 12, 2020 15:08
Deploy Spring-Boot APP in GAE
service: default
runtime: java11
#https://cloud.google.com/appengine/docs/standard
instance_class: F4
env_variables:
JAVA_TOOL_OPTIONS: "-Xmx1024m -XX:TieredStopAtLevel=1 -Xverify:none"
automatic_scaling:
max_concurrent_requests: 80
@czp3009
czp3009 / app.yaml
Created May 14, 2020 06:49
Deploy static SPA front-end in GAE
service: front-end
runtime: nodejs12
instance_class: F1
handlers:
- url: /(.*\.(.*))$
static_files: dist/\1
upload: dist/.*\.(js|js\.map|css)$
secure: always
redirect_http_response_code: 301
@czp3009
czp3009 / change_password.sql
Created April 28, 2020 08:24
mysql 5.7 change root password
update mysql.user set authentication_string=PASSWORD("yourpassword") where User='root';
update mysql.user set plugin='mysql_native_password' where User = 'root';
@czp3009
czp3009 / AllowAllPowershellScripts.ps
Created January 18, 2020 15:04
Allow all powershell to run on this machine
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine
@czp3009
czp3009 / 100.conf
Last active January 16, 2020 13:51
Proxmox share local directory to container (/etc/pve/lxc/100.conf)
mp0: /mnt/bindmounts/shared,mp=/shared
@czp3009
czp3009 / interface
Created January 5, 2020 07:36
private nat configuration for Proxmox
auto lo
iface lo inet loopback
# lan1(left)
auto eno1
iface eno1 inet manual
# bridge to lan1
auto vmbr0
iface vmbr0 inet static