Skip to content

Instantly share code, notes, and snippets.

View hanshihai's full-sized avatar

Han, Shi-Hai hanshihai

  • Shanghai
  • Shanghai, China
View GitHub Profile
@hanshihai
hanshihai / mongodb-ssl.sh
Created April 17, 2018 08:36 — forked from kevinadi/mongodb-ssl.sh
Script to create self-signed CA certificates, server certificates, and client certificates for testing MongoDB with SSL
#!/bin/sh
# Generate self signed root CA cert
openssl req -nodes -x509 -newkey rsa:2048 -keyout ca.key -out ca.crt -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=root/CN=`hostname -f`/[email protected]"
# Generate server cert to be signed
openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=server/CN=`hostname -f`/[email protected]"
# Sign the server cert
package jeet.code;
public class CircularLinkedList {
private int size = 0;
private Node head = null;
private Node tail = null;
//add a new node at the start of the linked list
public void addNodeAtStart(int data) {
@hanshihai
hanshihai / README-Template.md
Created September 6, 2017 07:24 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@hanshihai
hanshihai / Amount2RMB.java
Created August 17, 2017 07:33 — forked from binjoo/Amount2RMB.java
JAVA:字符串金额转成中文大写
/*
* Amount2RMB.java 2008-6-15
*/
package test;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Amount2RMB {
private static final Pattern AMOUNT_PATTERN =