Skip to content

Instantly share code, notes, and snippets.

View yusiwen's full-sized avatar

Siwen Yu yusiwen

View GitHub Profile
@yusiwen
yusiwen / BouncyCastleCertificateGenerator.java
Created May 25, 2021 07:57 — forked from vivekkr12/BouncyCastleCertificateGenerator.java
Generate root X509Certificate, Sign a Certificate from the root certificate by generating a CSR (Certificate Signing Request) and save the certificates to a keystore using BouncyCastle 1.5x
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.asn1.x509.BasicConstraints;
import org.bouncycastle.asn1.x509.Extension;
import org.bouncycastle.asn1.x509.GeneralName;
import org.bouncycastle.asn1.x509.KeyUsage;
import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.cert.X509v3CertificateBuilder;
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
@yusiwen
yusiwen / 1.md
Created April 12, 2020 05:29
[Minikube behind GFW] #k8s #minikube
$ minikube start --vm-driver=virtualbox --registry-mirror=https://registry.docker-cn.com --image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers
@yusiwen
yusiwen / conventioinal-changelog-cli-workflow.md
Created April 3, 2020 17:11
[convetional-changelog-cli workflow] #git #conventional-changelog

Workflow of conventional-changelog-cli

Installation

$ npm install -g conventional-changelog-cli

Execution

@yusiwen
yusiwen / 1.md
Created April 2, 2020 04:06
[Use commitizen and cz-conventional-changelog globally] #git #commitizen
$ npm i -g commitizen cz-conventional-changelog
$ echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc; create .czrc
$ cd non-node-git-repo
$ touch foo
$ git cz -a
@yusiwen
yusiwen / 1.sh
Created March 31, 2020 16:41
[Suppressing Column Header in Query Output] #mysql
# To create output that contains only data values, suppress the column header row with the -N (or --skip-column-names) option
mysql -N -e "SELECT arms FROM limbs" cookbook | summarize
# -N and --skip-column-names were introduced in MySQL 3.22.20
# For older versions, you can achieve the same effect by specifying the “silent” option (-s or --silent) twice:
% mysql -ss -e "SELECT arms FROM limbs" cookbook | summarize
@yusiwen
yusiwen / mysql-design-guideline.md
Created March 31, 2020 11:00
[MySQL Database Design Guideline] #mysql #guideline

MySQL数据库设计规范

目录

1. 规范背景与目的	

2. 设计规范

2.1 数据库设计	

2.1.1 库名

@yusiwen
yusiwen / 1.bat
Created March 30, 2020 05:01
[Windows 10 Reset Taskbar Pinned Apps] #windows
DEL /F /S /Q /A "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*"
REG DELETE HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband /F
taskkill /f /im explorer.exe
start explorer.exe
@yusiwen
yusiwen / wsl2.md
Created March 29, 2020 17:06
[Install WSL2] #wsl #windows

Install WSL2

Ensure that you have WSL installed (you can find instructions to do so here) and that you are running Windows 10 build 18917 or higher

To make sure you are using build 18917 or higher please join the Windows Insider Program and select the 'Fast' ring or the 'Slow' ring.

You can check your Windows version by opening Command Prompt and running the ver command.

Enable the 'Virtual Machine Platform' optional component and make sure WSL is enabled

@yusiwen
yusiwen / 1.md
Created March 29, 2020 17:05
[WIndows 10 Install WSL2] #wsl #windows

Install WSL2

Ensure that you have WSL installed (you can find instructions to do so here) and that you are running Windows 10 build 18917 or higher

To make sure you are using build 18917 or higher please join the Windows Insider Program and select the 'Fast' ring or the 'Slow' ring.

You can check your Windows version by opening Command Prompt and running the ver command.

Enable the 'Virtual Machine Platform' optional component and make sure WSL is enabled

@yusiwen
yusiwen / 1.txt
Created March 29, 2020 16:57
[VMware Workstation Shared VM Remote Access Firewall Ports] #vmware #linux
Need to open 443 and 902 port
# ufw
sudo ufw allow 443
sudo ufw allow 902