Skip to content

Instantly share code, notes, and snippets.

Avatar

Immanuel Potter immanuelpotter

View GitHub Profile
@sadikay
sadikay / video-to-gif.bash
Last active Feb 14, 2019
.mov to .gif - Convert quick time player videos to gif format on macOs command line.
View video-to-gif.bash
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 Oct 25, 2017
A FoxyProxy 6.x (for Firefox) version of the AWS EMR filters
View foxyproxy.json
{
"mode": "patterns",
"proxySettings": [
{
"title": "EMR SOCKS Proxy",
"type": 3,
"color": "#cc8c2a",
"address": "localhost",
"port": 8157,
"proxyDNS": true,
@lmakarov
lmakarov / lambda-basic-auth.js
Created Aug 30, 2017
Basic HTTP Authentication for CloudFront with Lambda@Edge
View lambda-basic-auth.js
'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 Aug 5, 2017
How to set up an AWS Lambda function for returning S3 pre-signed URLs for uploading files.
View README.md

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 Mar 21, 2021
Efficient Encrypted Arch Linux Guest Installation in VirtualBox with a Full Plasma/KDE Environment. Perfect for Arch Linux Evaluation and Experimentation!
View Encrypted Arch Linux VirtualBox Guest Installation Procedure
# 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 Oct 2, 2020
troposphere runner
View cfn_run.sh
#!/bin/bash
# https://gist.github.com/gcchaan/ad8fd83a68467503ec3e6392ebbd519a
set -ef -o pipefail
function message(){
echo 🍣 "$1"
}
function help(){
View Raspberry Pi - Linux OpenVPN Tutorial.txt
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 Apr 10, 2021
Create a private fork of a public repository
View private_fork.md

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 Mar 25, 2021
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
View k8s-svc-annotations.md

AWS Service annotations

  • 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)
@brandonmwest
brandonmwest / example.cs
Last active Mar 28, 2021
Generating base64-encoded Authorization headers in a variety of languages
View example.cs
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));