Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@stevenringo
stevenringo / reinvent-2017-youtube.md
Created December 3, 2017 23:01
Links to YouTube recordings of AWS re:Invent 2017 sessions

| Title | Description

@atschwarz
atschwarz / SleepTimer.md
Last active December 3, 2017 01:27
OpenHAB2 - Generic sleep timer

OpenHAB2 - Generic sleep timer

The following describes the necessary Functions and Procedures to create a small "Sleep Timer Library" for OpenHAB (Don't know, if Library is the correct title, but you know what I mean ;-)). Using this approach, it's easy for you to create your own custom sleep timers.

NOTE: This stuff doesn't depend on any add-on.

Usage example

The usage example does not cover initialization or recovery on system start and demonstrates a VERY BASIC example. But it's not very hard for you to integrate and customize it to your needs ;-)

1. Create a rule, e.g. inside the file SleepTimer.rules and paste in the following code.

@tristanmorgan
tristanmorgan / vault-token-helper.sh
Last active February 22, 2021 03:25
HashiCorp Vault Token Helper (save into macOS keychain)
#!/bin/sh
set -e
[ -z "$VAULT_ADDR" ] && VAULT_ADDR="https://127.0.0.1:8200"
case $1 in
store)
security add-generic-password -U -a "VAULT-$USER" -c "hvlt" -C "hvlt" -D "Hashicorp Vault" -s "$VAULT_ADDR" -w "$(cat)"
;;
get)
@45413
45413 / string-and-filename-manipulation.ps1
Last active November 14, 2023 22:47
Powershell String and Filename Manipulation
# Working with a [System.IO.FileInfo] Object
## Get file object into variable
PS C:\DATA> $file = Get-ChildItem C:\DATA\test.xls
## Full path name
PS C:\DATA> $file.FullName
C:\DATA\test.xls
## Filename including extension
PS C:\DATA> $file.Name
@stefano-pogliani
stefano-pogliani / Dockerfile
Created September 13, 2017 14:23
Locking docker containers with slow fluentd/network
FROM debian:jessie
RUN apt-get update \
&& apt-get install -y python-pip \
&& pip install --upgrade pip flask
COPY ./server.py /server.py
EXPOSE 5000
ENV FLASK_APP=server.py
@AravindaM
AravindaM / s3_ploicy_multipart.json
Created August 13, 2017 16:06
Multipart upload S3 Policy..
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt12345",
"Action": [
"s3:AbortMultipartUpload",
"s3:GetObject",
"s3:ListBucketMultipartUploads",
"s3:ListMultipartUploadParts",
@tristanmorgan
tristanmorgan / lib-vault-api-auth.rb
Created August 10, 2017 07:08
An attempt at calling Hashicorp Vault IAM Auth backend in Ruby
# Authenticate via the AWS EC2 authentication method (IAM method). If authentication is
# successful, the resulting token will be stored on the client and used
# for future requests.
#
# @example
# Vault.auth.aws_ec2_iam("dev-role-iam", "vault.example.com") #=> #<Vault::Secret lease_id="">
#
# @param [String] role
# @param [String] iam_auth_header_value
#
@seeebiii
seeebiii / LambdaConstants.java
Last active February 9, 2024 04:17
Available default environment variables in AWS Lambda. Just copy&paste into your Node or Java project.
public class Constants {
/**
* Contains the path to your Lambda function code.
*/
public static final String LAMBDA_TASK_ROOT = System.getenv("LAMBDA_TASK_ROOT");
/**
* The environment variable is set to one of the following options, depending on the runtime of the Lambda function:
* AWS_Lambda_nodejs, AWS_Lambda_nodejs4.3, AWS_Lambda_nodejs6.10
@StevenACoffman
StevenACoffman / _MicroService Proxy Gateway Solutions.md
Last active September 28, 2023 14:54
Microservice Proxy/Gateway Solutions

MicroService Proxy Gateway Solutions

Kong, Traefik, Caddy, Linkerd, Fabio, Vulcand, and Netflix Zuul seem to be the most common in microservice proxy/gateway solutions. Kubernetes Ingress is often a simple Ngnix, which is difficult to separate the popularity from other things.

Github Star Trend:

Github Star History for Kong vs traefik vs fabio vs caddy vs Zuul

This is just a picture of this link from March 2, 2019

Originally, I had included some other solution

@ryu1kn
ryu1kn / Makefile
Last active March 19, 2023 13:02
Encrypt/decrypt with AWS KMS using AWS cli
# How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli
KEY_ID=alias/my-key
SECRET_BLOB_PATH=fileb://my-secret-blob
SECRET_TEXT="my secret text"
ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob
DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target
encrypt-text: