Skip to content

Instantly share code, notes, and snippets.

@kevin-wang-cy
kevin-wang-cy / testgist
Created October 12, 2017 03:56
test gist
this is the gist content
@kevin-wang-cy
kevin-wang-cy / remove_git_tag
Created August 6, 2017 16:26 — forked from dearaujoj/remove_git_tag
git remove tag locally and remote
git tag -d TagName && git push origin :refs/tags/TagName
@kevin-wang-cy
kevin-wang-cy / Compile_Bitcoin_on_Ubuntu_16_04_2
Last active August 5, 2017 12:48 — forked from kostaz/Compile_Bitcoin_on_Ubuntu_14_04
Compile Bitcoin on Ubuntu 16.04.2
(a revise version basing on Kosta's )
Assuming the username of the Ubuntu user is "theusername".
Preparation
-----------
Make sure xenial-updates repository in your apt-get source list:
```
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restircted universe multiverse
Create self signed key pair and add to new key store:
keytool -genkey -alias mykey -keyalg RSA -keystore keystore.jks -keysize 2048
Export public key and import into new trust store:
keytool -keystore keystore.jks -export -alias mykey -file my.cer
keytool -import -alias mypub -file my.cer -keystore truststore.jks
(Alternate way) Manually import certificate from HTTPS server to trust store:
Firefox: Add Exception -> Get Certificat -> View -> Details -> Export as "a.der"
keytool -importcert -keystore truststore.jks -file a.der
@kevin-wang-cy
kevin-wang-cy / RsaExample.java
Created March 9, 2017 11:42 — forked from nielsutrecht/RsaExample.java
Example of RSA generation, sign, verify, encryption, decryption and keystores in Java
import javax.crypto.Cipher;
import java.io.InputStream;
import java.security.*;
import java.util.Base64;
import static java.nio.charset.StandardCharsets.UTF_8;
public class RsaExample {
public static KeyPair generateKeyPair() throws Exception {
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");