Skip to content

Instantly share code, notes, and snippets.

View taylorsmithgg's full-sized avatar

Taylor Smith taylorsmithgg

  • Independent
  • United States
View GitHub Profile
@valdemon
valdemon / config.yml
Last active May 9, 2019 13:11
Enable ECR (AWS) registries for Spinnaker with Kubernetes provider
# A part of the Halyard config file declaring the ECR registries.
# There can be multiple registries, each in different AWS account.
# In this example there are 3 "stages" accounts - dev, stage & live.
# NOTE: The declared password files must exist and provide valid base64 encoded values,
# otherwise Halayrd will endup with an exception during deployment.
# The values can be fake, they will be updated later by the Kubernetes Job (see 2-nd attached file).
# NOTE: replace ${YOUR_DEV_AWS_ACCOUNT_ID} ${YOUR_DEV_AWS_REGION}
# with appropriate values (same for STAGE & LIVE).
dockerRegistry:
@fikovnik
fikovnik / build.gradle
Created May 8, 2016 20:45
Synchronize maven repository from gradle module dependencies
task syncMavenRepository(type: JavaExec) {
classpath = configurations.mavenEmbedder
main = 'org.apache.maven.cli.MavenCli'
systemProperties['maven.multiModuleProjectDirectory'] = projectDir
args = [
'--errors',
'--batch-mode',
'--settings', '../config/repo-settings.xml',
'--file', "${buildDir}/pom.xml",
"org.apache.maven.plugins:maven-dependency-plugin:2.10:go-offline"
@wperron
wperron / secrets.awk
Last active April 15, 2022 21:57
Detecting secrets in source code with ✨ RegEx ✨
# Credit to https://github.com/dxa4481/truffleHogRegexes/blob/master/truffleHogRegexes/regexes.json
# For the different secret key patterns
#
# Usage: awk -f secrets.awk path/to/your/project/**/*.(js|ts)
/(xox[pborsa]-[0-9]{12}-[0-9]{12}-[0-9]{12}-[a-z0-9]{32})/ {printf "%s:%s %s", FILENAME, NR, $0; nextfile} # Slack Token
/-----BEGIN RSA PRIVATE KEY-----/ {printf "%s:%s %s", FILENAME, NR, $0; nextfile} # RSA private key
/-----BEGIN DSA PRIVATE KEY-----/ {printf "%s:%s %s", FILENAME, NR, $0; nextfile} # SSH (DSA) private key
/-----BEGIN EC PRIVATE KEY-----/ {printf "%s:%s %s", FILENAME, NR, $0; nextfile} # SSH (EC) private key
/-----BEGIN PGP PRIVATE KEY BLOCK-----/ {printf "%s:%s %s", FILENAME, NR, $0; nextfile} # PGP private ke
@ebbp0
ebbp0 / aws_queue.py
Last active April 21, 2022 23:15
AWS SQS send/receive with multi-threading
"""Snippet for just-add-water multithreading with AWS SQS service.
Does not currently check for send errors but will one day...
@author Elliot BP (github: ebbp0) <hello@elliot.work>
"""
import json
from multiprocessing import Process, Pipe
from typing import Any
@ugiacoman
ugiacoman / Client-Loading-Example.md
Last active June 24, 2022 20:50
SSR + CSR using next.js

Whether your component relies on client-side features or you are using 3rd party components that are not designed for server-side rendering, sometimes you'll want to defer rendering until on the client. For our example, we'll be using react-chart-2 to load a Doughnut chart.

Doughnut

You'll need a next project and to install chart.js + react-chartjs-2.

$ npm install --save chart.js react-chartjs-2  
@cludden
cludden / howto-installing-vault-on-aws-linux.md
Created February 3, 2016 00:30
HOWTO: Installing Vault on AWS Linux

HOWTO: Installing Vault On AWS Linux

This is quick howto for installing vault on AWS Linux, mostly to remind myself. At the end of this tutorial, you'll have a working vault server, using s3 for the backend, self signed certificates for tls, and supervisord to ensure that the vault server is always running, and starts on reboot.

Setting up S3

First things first, let's set up an s3 bucket to use as the storage backend for our s3 instance.

  1. From the AWS Mangement Console, go to the S3 console.

  2. Click on the Create Bucket button

@ltupin
ltupin / sh
Created February 28, 2019 14:41
Filter failed kubernetes jobs to delete it
#Should be a job too :-D
# With xargs (on all namespaces)
kc get jobs -o=jsonpath='{range .items[?(@.status.conditions[0].type == "Failed")]}{.metadata.name}{"\t"}{.metadata.namespace}{"\n"}{end}' --all-namespaces | \
xargs -n2 sh -c 'kubectl delete jobs $0 --namespace=$1'
# For loop (only in the current namespace)
for i in $(kc get jobs -o=jsonpath='{range .items[?(@.status.conditions[0].type == "Failed")]}{.metadata.name}{"\n"}{end}');
do kubectl delete jobs $i; done
@petitviolet
petitviolet / nginx_deployment.yaml
Created March 11, 2018 11:04
sample Nginx configuration on Kubernetes using ConfigMap to configure nginx.
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
nginx.conf: |
user nginx;
worker_processes 3;
error_log /var/log/nginx/error.log;
events {
@jujhars13
jujhars13 / sftp.yaml
Last active March 7, 2024 00:16
kubernetes pod example for atmoz/sftp
apiVersion: v1
kind: Namespace
metadata:
name: sftp
---
kind: Service
apiVersion: v1
metadata:
@oifland
oifland / Jenkinsfile
Last active March 23, 2024 17:59
Loops in Jenkinsfiles
// Related to https://issues.jenkins-ci.org/browse/JENKINS-26481
abcs = ['a', 'b', 'c']
node('master') {
stage('Test 1: loop of echo statements') {
echo_all(abcs)
}
stage('Test 2: loop of sh commands') {