Skip to content

Instantly share code, notes, and snippets.

View keshavab's full-sized avatar

Keshava keshavab

  • Bangalore
  • 08:25 (UTC +05:30)
View GitHub Profile
@keshavab
keshavab / self-signed-certificate-with-custom-ca.md
Created January 3, 2018 04:26 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@keshavab
keshavab / http-benchmark.md
Created November 27, 2017 05:22 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@keshavab
keshavab / update_curl.sh
Created November 20, 2017 17:14 — forked from fideloper/update_curl.sh
Update curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2
@keshavab
keshavab / steps.md
Last active November 20, 2017 13:11
Add a root certificate to Trusted Bundle

Centos

  1. Add the certificate to trust store

$cp root.crt /etc/pki/ca-trust/source/anchors

  1. Update trust bundle

$update-ca-trust extract

@keshavab
keshavab / verify.sh
Created November 9, 2017 06:26
Verify server certificate with issuing CA
# All certs in pem format
openssl verify -partial_chain -verbose -CAfile root.crt server.crt
@keshavab
keshavab / 1.sh
Created November 9, 2017 06:24
Convert rtf to txt on Mac OSx
textutil -convert txt *.rtf
@keshavab
keshavab / add CA cert on CentOS.md
Created October 12, 2017 06:23 — forked from kekru/add CA cert on CentOS Debian Ubuntu.md
Add CA cert to local trust store on CentOS or Debian
  • Open a webpage that uses the CA with Firefox
  • Click the lock-icon in the addressbar -> show information -> show certificate
  • the certificate viewer will open
  • click details and choose the certificate of the certificate-chain, you want to import to CentOS
  • click "Export..." and save it as .crt file
  • Copy the .crt file to /etc/pki/ca-trust/source/anchors on your CentOS machine
  • run update-ca-trust extract
  • test it with wget https://thewebsite.org
@keshavab
keshavab / rootca-cert-in-docker.md
Created October 4, 2017 13:19 — forked from zamd/rootca-cert-in-docker.md
trusting root ca certs in docker

Trusting custom root CA certificate in docker containers

Most large enterprises run their own PKI infrastructure and it’s common to issue internal CA signed certificate to services - The Root CA certificate is pushed to domain-joined workstations with group policy etc.

For non-domain joined services (like linux hosts etc.) it’s common to manually trust root CA cert.

Docker deamon automatically picks up the trusted root CA list from the host and use it as it's trusted CA list... Following commands can be used to add a custom CA certficate as trusted CA in Ubuntu

  • Go to /usr/share/ca-certificates/
  • Add your custom CA cert to this folder as PEM encoded file with .crt extension
@keshavab
keshavab / Dockerfile
Created June 28, 2016 13:44
systemd dockerfile
FROM keshavab/systemd
RUN yum -y install httpd; yum clean all
RUN systemctl enable httpd.service
# RUN systemctl restart httpd.service
EXPOSE 80
ENTRYPOINT ["/usr/sbin/init"]
CMD systemctl restart httpd.service
@keshavab
keshavab / gocmds.txt
Last active June 20, 2016 03:25
go commands
go test -cover
go test -coverprofile=coverage.out
go tool cover -html=coverage.out
-- run a specific testcase
go test -v -cover -run TestSubscriberStop
-- run a specific file
go test -v -cover context_messaging.go