This is a Chinese version of https://gist.github.com/1207002/86f48cd3b3b72c85e6293926cf7c730de03b2f08 from lucasfais
| ⌘T | 前往文件 |
| ⌘⌃P | 前往项目 |
| ⌘R | 前往 method |
| ⌘⇧P | 命令提示 |
| $ brew services stop mysql | |
| $ pkill mysqld | |
| $ rm -rf /usr/local/var/mysql/ # NOTE: this will delete your existing database!!! | |
| $ brew postinstall mysql | |
| $ brew services restart mysql | |
| $ mysql -uroot |
| # Export dump particular database. | |
| $ kubectl exec {{podName}} -n {{namespace}} -- mysqldump -u {{dbUser}} -p{{password}} {{DatabaseName}} > <scriptName>.sql | |
| # Export dump all databases. | |
| $ kubectl exec {{podName}} -n {{namespace}} -- mysqldump -u {{dbUser}} -p{{password}} --all-databases > <scriptName>.sql | |
| # Restore a database from a dump. | |
| $ kubectl exec -it {{podName}} -n {{namespace}} -- mysql -u {{dbUser}} -p{{password}} {{DatabaseName}} < <scriptName>.sql |
| node { | |
| // https://support.cloudbees.com/hc/en-us/articles/115001595227-How-To-Specify-A-Specific-JDK-In-Pipeline- | |
| // configure the JDK in Manage Jenkins > Global Tool Configuration > JDK | |
| jdk = tool name: 'JDK17' | |
| env.JAVA_HOME = "${jdk}" | |
| echo "jdk installation path is: ${jdk}" | |
| // next 2 are equivalents | |
| sh "${jdk}/bin/java -version" |
| def gitURL = "[email protected]:xxxxx.git" | |
| def command = "git ls-remote -h $gitURL" | |
| def proc = command.execute() | |
| proc.waitFor() | |
| if ( proc.exitValue() != 0 ) { | |
| return ["develop", "master"] | |
| } |
| #!/bin/bash | |
| # | |
| # PostgreSQL Backup Script Ver 1.0 | |
| # http://autopgsqlbackup.frozenpc.net | |
| # Copyright (c) 2005 Aaron Axelsen <[email protected]> | |
| # | |
| # This script is based of the AutoMySQLBackup Script Ver 2.2 | |
| # It can be found at http://sourceforge.net/projects/automysqlbackup/ | |
| # | |
| # The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9 |
| user nginx; | |
| worker_processes auto; | |
| error_log /var/log/nginx/error.log; | |
| pid /var/run/nginx.pid; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { |
| #!/bin/bash | |
| isExistApp=`ps -ef|grep data-jar-with-dependencies.jar|grep -v grep|awk '{print $2}'` | |
| if [[ -n $isExistApp ]]; then | |
| kill -9 $isExistApp | |
| echo 'app stopped' | |
| fi |
| #!/bin/bash | |
| isExistApp = `pgrep httpd` | |
| if [[ -n $isExistApp ]]; then | |
| service httpd stop | |
| fi |
This is a Chinese version of https://gist.github.com/1207002/86f48cd3b3b72c85e6293926cf7c730de03b2f08 from lucasfais
| ⌘T | 前往文件 |
| ⌘⌃P | 前往项目 |
| ⌘R | 前往 method |
| ⌘⇧P | 命令提示 |