Skip to content

Instantly share code, notes, and snippets.

@oiclover
oiclover / curl-ca.md
Created December 21, 2023 10:11 — forked from olih/curl-ca.md
Curl with custom CA certificates

Using curl with custom CA certificates

This document describes how to use curl with both custom and official CA SSL certificates.

Prerequisite

You would need first to install curl , see http://curl.haxx.se/docs/install.html. Using a package manager such as yum, brew, ... for your platform should be the easiest though.

Example for Mac OS:

@oiclover
oiclover / awk-sed-cheetsheet.md
Created December 21, 2023 10:10 — forked from olih/awk-sed-cheetsheet.md
Awk and Sed cheetsheet

awk & sed cheetsheet

Extract lines between start and end

between() { sed -n "/^$1/,/^$2/p" | sed '1d;$d'; }

Also:

awk '/^START=A$/,/^END$/ { print }’ data

SSL cheetsheet

Encode file with password

alias enc='openssl enc -e -aes128 -base64 -pass "env:PASS"'

Decode file with password

alias dec='openssl enc -d -aes128 -base64 -pass "env:PASS"'
@oiclover
oiclover / jq-cheetsheet.md
Created December 21, 2023 10:09 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@oiclover
oiclover / .bash_hooks
Created December 21, 2023 10:07 — forked from bhattisatish/.bash_hooks
A script which defines actions before and after each command execution
#!/bin/bash
# NOTES
# To activate hooks, run:
# . ./.bash_hooks
# To clear hooks, run:
# trap '' DEBUG
# PROMPT_COMMAND=
@oiclover
oiclover / index2html.sed
Created December 21, 2023 10:05 — forked from bhattisatish/index2html.sed
Useful One-liners for sed
#!/usr/bin/sed -f
# index2html.sed - by Aurelio Jargas
# Get index.sed file and converts it to the main http://sed.sf.net page
#
1 i\
<html><head><title>sed.sf.net - The sed $HOME</title></head>\
<meta http-equiv="content-type" content="text/html; charset=utf-8">\
<body bgcolor="#ffffbb" text="black">\
<pre>