Long to Base64 and Base64 to Long in Java

The following code converts a base64 String to a long and vice versa. private static final String alphabet = “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-“; public static String encodeBase64(long v) { char[] a = alphabet.toCharArray(); v = Math.abs(v); String s = “”; for (int i = 0; i < 11; i++) { long val = v & 63; s = […]

Get an A+ rating in SSL Labs

Get Certificate from Letsencrypt sudo apt-get -y install git bc sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt ./letsencrypt-auto certonly –standalone –email yourmail@gmail.com -d www.example.com Strong Diffie-Hellman sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048 Link to SSL Certificate / Key cd /etc/nginx mkdir ssl cd ssl ln -s /etc/letsencrypt/live/www.example.com/privkey.pem nginx.key ln -s /etc/letsencrypt/live/www.example.com/fullchain.pem taskbaSe.crt Use the following in your […]