echo "" | openssl s_client -connect server-that-you-want-to-connect:port -showcerts 2>/dev/null | openssl x509 -out cert.pem
keytool -import -storepass changeit -noprompt -file cert.pem -cacerts
echo "" | openssl s_client -connect server-that-you-want-to-connect:port -showcerts 2>/dev/null | openssl x509 -out cert.pem
keytool -import -storepass changeit -noprompt -file cert.pem -cacerts
I recently was trying to boot my old linux mint laptop and got a error message that my /boot was full. I did google for the solution and finally found a way to claim the space by removing old and unused space by just using the below script.
#!/usr/bin/env bash
OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
#!/bin/bash | |
openssl genrsa -out privkey.pem 2048 | |
openssl rsa -pubout -in privkey.pem -out pubkey.pem | |
SIGNING_KEY=$(cat privkey.pem) | |
VERIFICATION_KEY=$(cat pubkey.pem) | |
JWT_SIGNING_KEYS=$(cat <<EOF | |
jwt: | |
token: |
Run the following OpenSSL command to generate your private key and public certificate. Answer the questions and enter the Common Name when prompted.
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem
Review the created certificate:
openssl x509 -text -noout -in certificate.pem
Combine your key and certificate in a PKCS#12 (P12) bundle:
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.net.URLConnection; | |
/** | |
* The Class URLDownloader. |
public class ClearLine { | |
public static void main(String[] argv) throws Exception { | |
//https://stackoverflow.com/questions/7522022/how-to-delete-stuff-printed-to-console-by-system-out-println?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa | |
// int count = 1; | |
// System.out.print(String.format("\033[%dA",count)); // Move up | |
// System.out.print("\033[2K"); // Erase line content | |
System.out.print("hello"); |
{ | |
"noteComment": "I copied this from https://stackoverflow.com/questions/42495655/how-to-debug-angular-with-vscode", | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "chrome", | |
"request": "launch", | |
"name": "Launch Chrome", | |
"url": "http://localhost:4200", | |
"webRoot": "${workspaceRoot}", |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |