Skip to content

Instantly share code, notes, and snippets.

View brightzheng100's full-sized avatar

Bright Zheng brightzheng100

View GitHub Profile
Started by an SCM change
Building in workspace /var/jenkins_home/workspace/springboot-jersey-swagger
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url http://192.168.56.118:3000/bright/springboot-jersey-swagger.git # timeout=10
Fetching upstream changes from http://192.168.56.118:3000/bright/springboot-jersey-swagger.git
> git --version # timeout=10
using .gitcredentials to set credentials
> git config --local credential.username bright # timeout=10
> git config --local credential.helper store --file=/tmp/git6216967762445272219.credentials # timeout=10
Console Output
Started by user Bright Zheng
[EnvInject] - Loading node environment variables.
Building in workspace /var/jenkins_home/workspace/springboot-jersey-swagger
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url http://192.168.56.118:3000/bright/springboot-jersey-swagger.git # timeout=10
Fetching upstream changes from http://192.168.56.118:3000/bright/springboot-jersey-swagger.git
> git --version # timeout=10
Mon Mar 27 08:34:47 UTC 2017
@brightzheng100
brightzheng100 / cf-serviceinstances.sh
Created April 13, 2018 04:39
List all service instances in PCF foundation
#!/bin/bash
ORIGINAL_TARGET_ORG=`cf target | awk '/org:/{ print $2 }'`
ORIGINAL_TARGET_SPACE=`cf target | awk '/space:/{ print $2 }'`
ALL_ORGS=(`cf orgs | awk 'NR > 3'`)
# flag for printing the header
PRINT_HEADER=0
@brightzheng100
brightzheng100 / cf-serviceinstances.sh
Last active April 13, 2018 15:53
List all granted orgs' service instances
#!/bin/bash
# Dependencies: cf, jq >= 1.5
set -euo pipefail
umask 0077
PROPERTIES_TO_SHOW_H=("#" guid name last_operation last_operation_at service_name organization space)
PROPERTIES_TO_SHOW=(.metadata.guid .entity.name .entity.last_operation.state .entity.last_operation.updated_at .extra.service_name .extra.organization .extra.space)
@brightzheng100
brightzheng100 / ca.md
Created September 1, 2018 17:36 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@brightzheng100
brightzheng100 / generate-internal-ca.md
Created October 11, 2018 08:01
How-to: Generate Internal CA

Create your CA database to keep track of signed certificates

$ mkdir private certs cnf csr crl
$ touch index.txt
$ echo 1000 > serial

Create Your OpenSSL Config File

@brightzheng100
brightzheng100 / sign-certs-with-internal-ca.md
Last active October 11, 2018 08:03
How-to: Sign Certs With Internal CA

Please refer to here for how to generate internal CA.

Generate Key and CSR

$ openssl genrsa -out private/example.key.pem 2048

$ cat > cnf/example.cnf <<EOF
[ req ]
@brightzheng100
brightzheng100 / git.md
Last active November 14, 2023 02:24
Some Useful Git Practices

Git Practices

Add Upstream Remote to Our Forked Git Repos

Assuming we have forked the repo.

Now we clone our forked repo:

$ git clone git@github.com:YOUR-USERNAME/THE-REPO.git
@brightzheng100
brightzheng100 / bosh-scp.md
Created October 27, 2018 13:38
BOSH SCP Tips

Issue / Problem Statement

If we bosh scp directly to folders under /var/vcap/jobs/xxx/config, you will encounter Permission denied like:

$ bosh -e lite -d concourse4 scp concourse.yml web:/var/vcap/jobs/uaa/config/

Using environment '192.168.50.6' as client 'admin'