Skip to content

Instantly share code, notes, and snippets.

View immanuelpotter's full-sized avatar

Immanuel Potter immanuelpotter

View GitHub Profile
@unfunco
unfunco / better-ide-suggestions-serverless-typescript.md
Last active April 30, 2023 18:11
Improved IntelliSense for Serverless and TypeScript

Improved IntelliSense for Serverless and TypeScript

The aws-nodejs-typescript template provided by the [Serverless Framework] scaffolds Lambda functions in such a way that it's difficult for an IDE to infer types correctly. For example, the following code defines a Lambda function as a plain object literal, this is what is generated when creating a new service.

import { handlerPath } from '@libs/handler-resolver'
@sadikay
sadikay / video-to-gif.bash
Last active February 14, 2019 21:34
.mov to .gif - Convert quick time player videos to gif format on macOs command line.
brew install ffmpeg
brew cask install x-quartz #dependency for gifsicle, only required for mountain-lion and above
open /usr/local/Cellar/x-quartz/2.7.4/XQuartz.pkg # runs the XQuartz installer
brew install gifsicle
ffmpeg -i ~/Desktop/in1080.mov -s 920x540 -pix_fmt rgb24 -r 18 -f gif - | gifsicle --optimize=3 --delay=3 > ~/Desktop/out.gif
@apetresc
apetresc / foxyproxy.json
Created October 25, 2017 19:01
A FoxyProxy 6.x (for Firefox) version of the AWS EMR filters
{
"mode": "patterns",
"proxySettings": [
{
"title": "EMR SOCKS Proxy",
"type": 3,
"color": "#cc8c2a",
"address": "localhost",
"port": 8157,
"proxyDNS": true,
@lmakarov
lmakarov / lambda-basic-auth.js
Created August 30, 2017 19:15
Basic HTTP Authentication for CloudFront with Lambda@Edge
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
@plindberg
plindberg / README.md
Created August 5, 2017 16:46
How to set up an AWS Lambda function for returning S3 pre-signed URLs for uploading files.

README

Granted, this is little more than an obfuscated way of having a publicly writable S3 bucket, but if you don’t have a server which can pre-sign URLs for you, this might be an acceptable solution.

For this to work, you take the following steps:

  1. Create a Lambda func, along with a new IAM role, keeping the default code.
  2. Create an API in the API Gateway.
@HardenedArray
HardenedArray / Encrypted Arch Linux VirtualBox Guest Installation Procedure
Last active March 17, 2024 16:54
Efficient Encrypted Arch Linux Guest Installation in VirtualBox with a Full Plasma/KDE Environment. Perfect for Arch Linux Evaluation and Experimentation!
# OBJECTIVES: Install Arch Linux as a VirtualBox Guest with a complete Plasma5/KDE environment.
# Provide encrypted root and swap filesystems and UEFI boot our Arch Guest from within VirtualBox.
# Note: This install method is specific to VirtualBox (VBox) to allow non-Arch users and Arch testers to evaluate a properly
# configured and secure Arch OS while running a fully enabled Plasma/KDE system, and also by concurrently taking advantage
# of the multiple isolation safeguards inherently provided by the VBox environment.
# For those who want to install Arch on bare metal in a way that supports both dedicated Arch installations and Arch
# installation on a SSD/HDD multi-OS-UEFI-booting system, please refer to my Arch System Installation Guide, here:
@gcchaan
gcchaan / cfn_run.sh
Last active October 2, 2020 11:46
troposphere runner
#!/bin/bash
# https://gist.github.com/gcchaan/ad8fd83a68467503ec3e6392ebbd519a
set -ef -o pipefail
function message(){
echo 🍣 "$1"
}
function help(){
RaspberryPi OpenVPN Tutorial by [http://readwrite.com/author/lauren-orsini/]
----------------------------
* http://readwrite.com/2014/04/10/raspberry-pi-vpn-tutorial-server-secure-web-browsing/
* http://readwrite.com/2014/04/11/building-a-raspberry-pi-vpn-part-two-creating-an-encrypted-client-side
These instructions should also be suitable for any recent OpenVPN installation, on any Linux disto - modify accordingly.
NOTE: Copy'n'paste anything between quotes below - but not the quotes, and only if it is preceeded by the word run!
I've assumed you are logged in to your RaspberryPi as the pi user.
Instructions where brackets [like-this] are used means, choose your own value.
@0xjac
0xjac / private_fork.md
Last active April 26, 2024 14:38
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@mgoodness
mgoodness / k8s-svc-annotations.md
Last active March 11, 2024 16:24
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)