Skip to content

Instantly share code, notes, and snippets.

@jason-riddle
jason-riddle / curl_examples.sh
Created October 21, 2019 01:39
Examples for Curl #snippet #complete
# Robust curl command to retry, timeout, and save the output to a file
curl --silent --show-error \
--location --max-redirs 3 \
--retry 3 --retry-connrefused --retry-delay 2 \
--max-time 30 \
"$url"
@jason-riddle
jason-riddle / dmesg_to_utc.sh
Last active October 21, 2019 01:58
Convert dmesg timestamps to UTC format
#!/bin/bash
# Translate dmesg timestamps to human readable format
# desired date format
date_format="%Y-%m-%dT%H:%M:%SZ"
# [ 3.469072] EXT4-fs (xvda1): mounted filesystem with ordered data mode. Opts: (null)
# [ 3.483769] dracut: Remounting /dev/disk/by-label/\x2f with -o noatime,ro
# [ 3.495019] EXT4-fs (xvda1): mounted filesystem with ordered data mode. Opts: (null)
# [ 3.506417] dracut: Mounted root filesystem /dev/xvda1
@jason-riddle
jason-riddle / keytool_guide.sh
Last active October 22, 2019 19:19
Examples using keytool #keytool
# List certs in keystore
keytool -list -v -keystore /etc/ssl/certs/java/cacerts
# Grep for a specific certificate
echo -n 'changeit' | keytool -list -keystore /etc/ssl/certs/java/cacerts 2>/dev/null | grep -B1 -i 01:18
@jason-riddle
jason-riddle / README.md
Created March 15, 2022 04:47 — forked from mosquito/README.md
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/[email protected]. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
Requires=docker.service
After=docker.service
[
{
"userId": 39490,
"orderId": 2782,
"createdAt": "2019-09-09T14:34:56.972Z",
"updatedAt": "2022-05-07T11:47:15.932Z",
"is_nft": false
},
{
"userId": 29873,
# https://github.com/jason-riddle/amazon-bedrock-kendra-lex-chatbot
variable "lambda_image" {
description = "The Lambda container image to use in the stack"
type = string
default = "foo"
# default = "${ACCOUNT_ID}.dkr.ecr.${STACK_REGION}.amazonaws.com/${CF_STACK_NAME}:latest"
}
resource "aws_kendra_index" "kendra_index" {
locals {
drupal7sites = [
"sfdbi-7.99",
]
drupal8sites = [
"dpa-8.00",
]
}
<#
1.ps1
This script groups photo files from a root directory into DVD-sized groups.
It processes files in alphabetical order (excluding hidden files, symlinks,
files with .json, .xmp, .csv, or .ps1 extensions) and writes a CSV file ("groups.csv")
listing each file's group, group size, full path, and file size in bytes.
Usage:
.\1.ps1 [-Mode test]
If the parameter -Mode is set to "test", the DVD capacity is set to 200 MB.