Skip to content

Instantly share code, notes, and snippets.

locals {
drupal7sites = [
"sfdbi-7.99",
]
drupal8sites = [
"dpa-8.00",
]
}
# 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" {
[
{
"userId": 39490,
"orderId": 2782,
"createdAt": "2019-09-09T14:34:56.972Z",
"updatedAt": "2022-05-07T11:47:15.932Z",
"is_nft": false
},
{
"userId": 29873,
@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/docker-compose@.service. 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
@jason-riddle
jason-riddle / jshell_docker_snippets.sh
Last active November 19, 2020 14:01
Guide using Jshell to query CPU and memory information within a docker container #jvm #guide #complete
#!/usr/bin/env bash
# Ref: https://jaxenter.com/better-containerized-jvms-jdk-10-140593.html
set -eu
OPENJDK_IMAGE='openjdk:10-ea-jdk-slim'
JSHELL_CMD=(/bin/sh -c 'jshell -q')

Prep Work (Google Cloud)

Visit https://console.cloud.google.com and a create project with the name of kubernetes-cluster and take note of the project id.

Or use gcloud alpha projects create kubernetes-cluster-1345 if you have access.

Update gcloud.

gcloud components install kubectl
@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 / 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 / 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 / burn_sdcard.sh
Last active October 21, 2019 01:37
Burn to sdcard using dd and pv #guide #complete
SD_CARD="/dev/disk1000"
LOCAL="~/Desktop/2013-09-25-wheezy-raspbian-minimal.img"
# First, unmount the disk
diskutil unmountDisk ${SD_CARD}
# If you are writing from SD card to Mac, calculate the number of bytes to skip as well as the size to pipe to pv.
# 5785600 bytes (count) * 512 (default bs) = 2962227200 bytes == 2825 Megabytes
dd if=${SD_CARD} count=5785600 | pv -s 2825M | dd of=${LOCAL} count=5785600