Skip to content

Instantly share code, notes, and snippets.

View ostinelli's full-sized avatar

Roberto Ostinelli ostinelli

View GitHub Profile
@ostinelli
ostinelli / openssl_common_operations.md
Last active February 12, 2020 13:54
OpenSSL common operations.

Open SSL common operations

Generate a new Private key and Certificate Signing Request

$ openssl req -out server.csr -new -newkey rsa:2048 -nodes -keyout server.key

Generate a self-signed certificate and private key

$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt
@ostinelli
ostinelli / jenkins_ci_on_osx.md
Last active February 28, 2023 02:38
Setup Jenkins CI on OSX.

Jenkins CI on OSX

Instructions on how to setup a secured Jenkins CI on a Mac.

Download & Install dependencies

All of these operations are done with your admin user.

Developer tools

Install the command line developer tools.

@ostinelli
ostinelli / jenkins_ci_on_ubuntu.md
Last active February 14, 2023 07:12
Setup Jenkins CI on Ubuntu.

Jenkins CI

Instructions on how to setup a secured Jenkins CI.

Install Jenkins

$ wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
$ sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list$ .d/jenkins.list'
$ sudo apt-get update
$ sudo apt-get install jenkins
@ostinelli
ostinelli / resource_monitor.sh
Last active November 19, 2017 01:01
Monitor server CPU and memory.
#!/usr/bin/env bash
# settings
OUTPUT_FILE=monitor.csv
# build command
cmd=""
cpu_headers=""
for (( i=4; i<=$(nproc)+4; i++ ))
do
@ostinelli
ostinelli / ecdsa_example.rb
Last active April 14, 2024 17:32
ECDSA usage from Ruby.
require 'openssl'
require 'base64'
# ===== \/ sign =====
# generate keys
key = OpenSSL::PKey::EC.new("secp256k1")
key.generate_key
public_key = key.public_key
public_key_hex = public_key.to_bn.to_s(16).downcase # public key in hex format