Skip to content

Instantly share code, notes, and snippets.

@enriquemanuel
enriquemanuel / mfa.sh
Created April 10, 2020 14:19
SocksProxy that uses SSH Config to SSH via SSM to an AWS Instance to not use SSH
#!/bin/bash
bold=$(tput bold)
normal=$(tput sgr0)
USAGE=$(cat <<-END
source ./issue_mfa.sh [AWS_USERNAME] [MFA_TOKEN]
Issues an aws security token and sets it automatically.
If added the -v flag it will echos AWS_SECRET_ACCESS_KEY,
AWS_ACCESS_KEY_ID, AWS_SECURITY_TOKEN, and AWS_SESSION_TOKEN
@andrewodri
andrewodri / Dockerfile
Last active December 22, 2023 20:56
Connect Fargate instance to SSM Session Manager
FROM debian:10-slim
RUN apt-get update -y && \
apt-get install -y awscli curl gnupg && \
apt-key adv --fetch-keys "https://nginx.org/keys/nginx_signing.key" && \
echo "deb http://nginx.org/packages/debian buster nginx" > /etc/apt/sources.list.d/nginx.list
RUN curl --silent --show-error --location --output /tmp/amazon-ssm-agent.deb "https://s3.us-east-1.amazonaws.com/amazon-ssm-us-east-1/latest/debian_amd64/amazon-ssm-agent.deb" && \
dpkg -i /tmp/amazon-ssm-agent.deb
@ruanbekker
ruanbekker / deployment.yml
Last active April 11, 2021 17:17
Localstack on k3d
apiVersion: apps/v1
kind: Deployment
metadata:
name: localstack
spec:
selector:
matchLabels:
app: localstack
replicas: 1
template:
@Mattamorphic
Mattamorphic / publish.yml
Last active August 22, 2020 18:34
NPM Publish GitHub Package Registry
name: Deploy package to GitHub package registry
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
@jonico
jonico / docker-build-publish.yaml
Created August 19, 2019 07:22
Build docker image and push to GPR with GitHub Actions
name: Build and publish Jekyll Docker image for Octocat Generator
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: clean up, docker login && docker build && docker push
@kmrk
kmrk / --copy-files
Last active January 16, 2020 23:58
babel --copy-files with --ignore
#!/usr/bin/env node
// babel's cli option --copy-files will override the --ignore setting
// so copy resources like this
require('fs-extra').copy(
process.argv.slice(-2).shift(),
process.argv.slice(-2).pop(),
{ filter: (src,dist)=>{ return (src.match(/\.js|\.jsx|stories|test/)===null)} },
err => { if (err) return console.error (err); console.log ('Copy success!');
@evolkmann
evolkmann / importing.module.ts
Created January 4, 2019 15:34
Create Nest.js modules with custom config
import { Module } from '@nestjs/common';
import { MyLibModule } from './my-lib.module';
@Module({
imports: [
MyLibModule.register({ name: 'Enzo' }),
]
})
export class ImportingModule {}
#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>
uint8_t note = 38;
int SNARE[6] = {150, 4000, 38, 3, 0, 0}; //{threshold, sensitivity, note(no use), flag, velocity, last peakValue}
boolean snareFlag = false;
BLECharacteristic *pCharacteristic;
@ganeshkbhat
ganeshkbhat / expressjs-req.baseUrl-req.originalUrl-req.path-difference.snippet.js
Created October 4, 2018 03:03
ExpressJS Series: Difference the req.baseUrl req.originalUrl req.path
app.use('/admin', function(req, res, next) {
/* GET 'http://www.example.com/admin/new' */
console.log(req.originalUrl); // '/admin/new'
console.log(req.baseUrl); // '/admin'
console.log(req.path); // '/new'
next();
});
@HarryUPf
HarryUPf / README.md
Last active September 28, 2023 01:37
Raspberry Pi SunVox Headless Synth (in 10 easy steps)

Raspberry Pi SunVox Headless Synth Setup (in 10-easy-steps)

INSTRUCTIONS

STEP_01

STEP_02

  • write the extracted .img to sdcard with Etcher

STEP_03