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
@kevinadi
kevinadi / mongodb-ssl.sh
Last active March 24, 2025 10:32
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
public class CircularLinkedList {
public int size =0;
public Node head=null;
public Node tail=null;
//add a new node at the start of the linked list
public void addNodeAtStart(int data){
System.out.println("Adding node " + data + " at start");
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 8, 2025 06:48
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

@binjoo
binjoo / Amount2RMB.java
Created July 18, 2013 10:15
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 =