Skip to content

Instantly share code, notes, and snippets.

View brightzheng100's full-sized avatar

Bright Zheng brightzheng100

View GitHub Profile
@brightzheng100
brightzheng100 / debug-gradle-project-in-eclipse.md
Created November 2, 2018 03:55
How to Debug Gradle Projects in Eclipse

Setting up gradle debug configuration for all projects

$ touch ~/.gradle/init.gradle
$ cat > ~/.gradle/init.gradle <<EOF
allprojects {
    tasks.withType(Test) {
        if (System.getProperty('DEBUG', 'false') == 'true') {
            jvmArgs '-Xdebug',
 '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9009'
@brightzheng100
brightzheng100 / bash-tips.md
Last active November 16, 2018 03:36
some bash tips

To cat all files within specified files and folders

$ tail -n +1 file1 folder1/* folder2/*
==> file <==
<content of file>

==> folder1/file1 <==
<content of folder/file1>
@brightzheng100
brightzheng100 / credhub-interpolate.yml
Created January 3, 2019 02:38
credhub-interpolate.yml
# The inputs, outputs, params, filename, and filepath
# of this task file are part of its semantically versioned API.
# See our documentation for a detailed discussion of our semver API.
# See www.semver.org for an explanation of semantic versioning.
# code_snippet credhub-interpolate start yaml
---
platform: linux
inputs:
@brightzheng100
brightzheng100 / .vimrc
Last active November 5, 2019 08:04
k8s-get-started
set autoindent
set tabstop=2 shiftwidth=2 expandtab
set history=50
set hlsearch
set ignorecase
set incsearch
set linebreak
set listchars=eol:¶
set list
set nobackup
@brightzheng100
brightzheng100 / dnsmasq_in_mac.md
Last active July 21, 2020 08:21
Mac Book Pro

Install Local DNS by dnsmasq in Mac

Install dnsmasq

brew update
brew install dnsmasq

Configure dnsmasq

@brightzheng100
brightzheng100 / STS-failed-to-start.md
Last active February 5, 2020 04:38
Java Development in Mac Tips

Sometimes STS/Eclipse failed to start: failed to create java virtual machine.

It might be caused by multiple JDKs installed.

So we have to specify if it helps.

$ sudo vi /Applications/STS.app/Contents/Eclipse/STS.ini
...
-vm
@brightzheng100
brightzheng100 / opentab.sh
Created January 22, 2020 04:31
iTerm Tips
#!/bin/bash
# Ref: https://gist.github.com/bobthecow/757788
# Purposes: to open a new iTerm tab vertically, with the same profile, and run the command.
# Usage: source it and
# tab Opens the current directory in a new tab
# tab [PATH] Open PATH in a new tab
# tab [CMD] Open a new tab and execute CMD
# tab [PATH] [CMD] ... You can prob'ly guess
➜ CRC crc delete
Do you want to delete the OpenShift cluster? [y/N]: y
Deleted the OpenShift cluster
➜ CRC crc cleanup
INFO Unload CodeReady Containers tray
INFO Unload CodeReady Containers daemon
INFO Removing launchd configuration for tray
INFO Removing launchd configuration for daemon
INFO Removing current user permission for /etc/hosts file
INFO Will use root access: change ownership of /etc/hosts

It's common that we use business email to commit for work while using personal email to commit for OSS.

You can configure an individual repo to use a specific user / email address which overrides the global configuration.

Let say we want to make the OSS commits as default, do this:

From the root of the repo, run

git config user.name "Your biz name here"
@brightzheng100
brightzheng100 / self-signed-cert-on-chrome.md
Created September 26, 2022 03:30
Easiest way to bypass the NET:ERR_CERT_INVALID in Chrome, with self-signed cert

Once you encounter that, right click the page and click "inspect".

Then switch to "Console" and copy-and-paste below command, then enter:

sendCommand(SecurityInterstitialCommandId.CMD_PROCEED)

Boom, it will work within seconds.