Skip to content

Instantly share code, notes, and snippets.

@joepol
joepol / aws-sigv4-ssm-get-parameter.sh
Created March 22, 2023 10:09 — forked from slawekzachcial/aws-sigv4-ssm-get-parameter.sh
Using CURL to call AWS ReST API, signing request with v4 signature
#!/bin/bash
# Source: https://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html
[[ -n "${AWS_ACCESS_KEY_ID}" ]] || { echo "AWS_ACCESS_KEY_ID required" >&2; exit 1; }
[[ -n "${AWS_SECRET_ACCESS_KEY}" ]] || { echo "AWS_SECRET_ACCESS_KEY required" >&2; exit 1; }
readonly parameterName="SlawekTestParam"
readonly method="POST"
@joepol
joepol / sources.list
Last active June 20, 2022 07:18 — forked from rohitrawat/sources.list
Ubuntu 16.04 Xenial default /etc/apt/sources.list
#deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
@joepol
joepol / degrees-radians.h
Last active February 27, 2020 07:37 — forked from dbrockman/degrees-radians.h
Convert degrees <-> radians [C++]
#include<math.h>
const double DEG_TO_RAD = (M_PI / 180.0);
const double RAD_TO_DEG = (180.0 / M_PI);
inline double DegreesToRadians(double angleDegrees){
return angleDegrees * DEG_TO_RAD;
}
inline double RadiansToDegrees(double angleRadians){