Skip to content

Instantly share code, notes, and snippets.

View jdavidzapatab's full-sized avatar

David Zapata jdavidzapatab

View GitHub Profile
@jdavidzapatab
jdavidzapatab / Configure static IP for Ubuntu 22.04.md
Created April 25, 2023 06:48
Configure static IP for Ubuntu 22.04
@jdavidzapatab
jdavidzapatab / Commands.sh
Created April 11, 2023 08:47
Mac Commands
# Flush DNS
sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder;
# Simple website connection test/benchmarks
curl --verbose -H "Connection: close" -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' -o /dev/null -s https://google.com

Sign Jars using Gradle

To sign one or more jar files using the jarsigner tool (part of any JDK), follow these instructions. Notice this set of instructions assume you already have the needed KeyStore with the corresponding Code Signing certificate, the KeyStore and certificate key password, and you know the alias of the Key to use from the KeyStore.

  • Make sure to have a KeysStore with your Code Signing certificate, associated passwords, etc.
  • Add the following properties to your Gradle project. Remember you probably don't want your private credentials in your versioning system:
@jdavidzapatab
jdavidzapatab / Generate Jar with dependencies (fatJar) using Gradle.md
Last active July 15, 2024 15:36
Generate Jar with dependencies (fatJar) using Gradle

Generate Jar with dependencies (fatJar) using Gradle

There are multiple posts (old and new) with instructions on how to generate a fat jar, this is, a jar file for your application containing also your application's dependencies. Most solutions I have tried did not work for me, even in a simple Hello World java application, but I have found one that seems to work as expected.

Here it is:

Instructions

@jdavidzapatab
jdavidzapatab / Sign Git Commits with GPG.md
Last active April 10, 2020 00:41
Sign Git Commits with GPG

Sign Git Commits with GPG

  • Download and install GPG from www.gnupg.org. On Mac, you can install gnupg through Homebrew.
brew install gnupg
  • Generate a new GPG Key. You can select the defaults for this command, but it is required that you enter your full name and your email address when needed. The email address must be the same as your verified email address in your GitHub account if you need to push signed commits to this website. Also define a secure password (keep note of it, you will need it later):
@jdavidzapatab
jdavidzapatab / FIPS partially-based guide.txt
Last active February 7, 2020 10:08
Guide to generate private/public keys and verify certificates
Generate public/private key using FIPS 186-4, and FIPS 180-4. Using:
- Accepted hash function (i.e. SHA512)
- RSA with 2048 bits
- Strong private key password.
- Valid Certificate issued by a valid CA.
env OPENSSL_FIPS=1 openssl genrsa -aes128 -passout pass:<password> -out private.pem 2048
env OPENSSL_FIPS=1 openssl rsa -in private.pem -passin pass:<password> -pubout -out public.pem
> Generated Files: private.pem, public.pem
@jdavidzapatab
jdavidzapatab / Create Self-Signed Localhost certificate.md
Last active June 22, 2022 21:21
Create Self-Signed Localhost certificate

Steps:

  • Create a Root key:

    openssl genrsa -des3 -out rootCA.key 2048
    
  • Create a root certificate in PEM format, using the root key: