Skip to content

Instantly share code, notes, and snippets.

@ServerlessBot
ServerlessBot / IAMCredentials.json
Last active December 20, 2023 16:50
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
@dansmith65
dansmith65 / Install-AWSCLI.ps1
Last active December 9, 2022 12:28
Install version 1 of AWS CLI via PowerShell
# https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html
$dlurl = "https://s3.amazonaws.com/aws-cli/AWSCLI64PY3.msi"
$installerPath = Join-Path $env:TEMP (Split-Path $dlurl -Leaf)
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest $dlurl -OutFile $installerPath
Start-Process -FilePath msiexec -Args "/i $installerPath /passive" -Verb RunAs -Wait
Remove-Item $installerPath
$env:Path += ";C:\Program Files\Amazon\AWSCLI\bin"
@nomaster
nomaster / config.boot
Last active October 5, 2023 07:35
EdgeRouter: DNS forwarding to CloudFlare with DNSSEC
set service dns forwarding name-server 1.1.1.1
set service dns forwarding name-server 1.0.0.1
set service dns forwarding name-server '2606:4700:4700::1111'
set service dns forwarding name-server '2606:4700:4700::1001'
set service dns forwarding options dnssec
set service dns forwarding options trust-anchor=.,19036,8,2,49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5
set service dns forwarding options trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D
set service dns forwarding options dnssec-check-unsigned
set service dns forwarding options dnssec-timestamp=/config/dnsmasq/dnsmasq.time
@alexellis
alexellis / k8s-pi.md
Last active April 11, 2024 14:17
K8s on Raspbian
@cyrusboadway
cyrusboadway / google-domains-dynamic-dns-update.sh
Created February 20, 2016 17:21
Script to update a Google Domains DNS record
#!/bin/bash
### Google Domains provides an API to update a DNS "Syntheitc record". This script
### updates a record with the script-runner's public IP, as resolved using a DNS
### lookup.
###
### Google Dynamic DNS: https://support.google.com/domains/answer/6147083
### Synthetic Records: https://support.google.com/domains/answer/6069273
USERNAME=""
@stevejenkins
stevejenkins / EdgeMax-Google.sh
Last active November 15, 2019 17:05
IPv4/IPv6 setup script for EdgeMax EdgeOS v1.9 routers to replace the Google Fiber Network Box
# EdgeOS v1.9 Google Fiber Config Script
# by Steve Jenkins (http://www.stevejenkins.com/)
# Last updated: Aug 14, 2016
# Based on settings & scripts by Atlantisman, TK, and CompTech
# RUN THIS SCRIPT AS ROOT ON YOUR EDGEROUTER
# Script runs best if you copy and paste in sections
#______________________Basic Firewall Setup_______________________________
configure
@d-schmidt
d-schmidt / redirectExample.go
Last active March 12, 2024 08:04
How to redirect HTTP to HTTPS with a golang webserver.
package main
import (
"net/http"
"log"
)
func redirect(w http.ResponseWriter, req *http.Request) {
// remove/add not default ports from req.Host
target := "https://" + req.Host + req.URL.Path
if len(req.URL.RawQuery) > 0 {
@ygotthilf
ygotthilf / jwtRS256.sh
Last active May 23, 2024 07:42
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@solarce
solarce / docker_images.md
Created August 7, 2015 22:56
A quick list of the Travis Docker containers on quay.io that you can `docker pull`

The following is a list of public Docker images Travis uses for our container based builds. You can grab them with docker pull quay.io/travisci/travis-$lang.

  • Do note that they are large in size, 800MB - 1.8G

Images:

@brycied00d
brycied00d / speedtest
Last active July 16, 2022 14:30
Moving Speedtest.net's Logic Inside of Nginx
# My goal was two-fold:
# Avoid installing PHP for a single 12-line PHP file (only 5 actual LOC)
# Instead this utilises ngx_lua (and luaJIT) which avoids forking out and keeps the logic in-memory.
# Optimize where I could by moving static resources into the configuration/memory.
# The large download test files can also be moved into a ramdisk to eek out a bit more performance by reducing disk IO
# Serve the same speedtest from multiple domains using only relative URLs and traversing subdomains
# The idea is that speedtest.companyA.com can be served from the same server{} block as speedtest.companyB.com
# The index page has links to allow the user to force a connection over ipv4 or ipv6. A connection to /ipv4, for
# instance, will redirect the user to ipv4.speedtest.$X/ where $X is determined dynamically. Likewise for /ipv6,
# and there's /default to redirect to just speedtest.$X/