Skip to content

Instantly share code, notes, and snippets.

@linjan2
linjan2 / _create_certificates.sh
Last active July 20, 2023 16:04
Create OpenSSL certificates
# Setup working directory
umask 0077 # create new files as u=rwX
mkdir workingdir
cd workingdir
mkdir caroot ca server client caroot/certsdir ca/certsdir
touch caroot/index.txt ca/index.txt # create index file for root CA and CA
openssl rand -hex 16 > caroot/serial.txt # create initial serial for root CA's certificates
openssl rand -hex 16 > ca/serial.txt # create initial serial for CA's certificates
@linjan2
linjan2 / simple.vim
Created September 26, 2021 10:35
Example ~/.vim/colors/simple.vim
" Example vim color scheme.
" USAGE: copy to ~/.vim/colors/simple.vim and then use `colorscheme simple`
" Uses terminal colors 0-15. GUI-colors added for syntax example.
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
@linjan2
linjan2 / numbers.sql
Last active September 11, 2021 07:11
SQL generation of numbers in rows
WITH
count(n) AS -- choose number of rows; goes from n downto 1
(
SELECT 3 AS n -- on DB2 add: FROM sysibm.sysdummy1
),
index_numbers(n) AS
(
SELECT n FROM count
UNION ALL
SELECT n-1 FROM index_numbers