# Install pgp
brew install gnupg
# Write out the hashicorp public pgp key
cat <<EOF > hashicorp.asc
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBFMORM0BCADBRyKO1MhCirazOSVwcfTr1xUxjPvfxD3hjUwHtjsOy/bT6p9f
W2mRPfwnq2JB5As+paL3UGDsSRDnK9KAxQb0NNF4+eVhr/EJ18s3wwXXDMjpIifq
View .eslintrc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
const { readFileSync } = require('fs') | |
const schemaString = readFileSync(`${__dirname}/data/schema.graphql`, 'utf8') | |
module.exports = { | |
root: true, | |
plugins: [ | |
// 'jest', | |
'@typescript-eslint', |
View .README.md
View README.md
Smart Queue
Initial Setup
opkg update
opkg install luci-app-sqm kmod-sched-ctinfo iptables-mod-hashlimit ipset nano
# Install modified layer_cake to sqm-scripts
wget https://gist.githubusercontent.com/heri16/06c94b40f0d30f11e3a82166eca718f3/raw/layer_cake_ct.qos -O /usr/lib/sqm/layer_cake_ct.qos
View upload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bucketName = ""; | |
const bucketEnpoint = ""; | |
const s3 = new AWS.S3({ | |
params: { Bucket: bucketName }, | |
endpoint: bucketEndpoint, | |
s3BucketEndpoint: true, | |
// s3DisableBodySigning: false, | |
computeChecksums: true, | |
correctClockSkew: true, |
View App.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { Switch, Route } from 'react-router-dom' | |
import { Amplify } from '@aws-amplify/core' | |
import { amplifyConfig } from './config' | |
import { AllContextProvider } from './context' | |
import { |
View filter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { chain } = require('stream-chain'); | |
const { parser } = require('stream-json'); | |
const { pick } = require('stream-json/filters/Pick'); | |
const { filter } = require('stream-json/filters/Filter'); | |
const { streamValues } = require('stream-json/streamers/StreamValues'); | |
const { disassembler } = require('stream-json/Disassembler'); | |
const { stringer } = require('stream-json/Stringer'); | |
const ST = require('stream-template'); |
View s3-bucket-cors.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<AllowedOrigin>https://*</AllowedOrigin> | |
<AllowedMethod>HEAD</AllowedMethod> | |
<AllowedMethod>GET</AllowedMethod> | |
<AllowedMethod>PUT</AllowedMethod> | |
<AllowedMethod>POST</AllowedMethod> | |
<AllowedMethod>DELETE</AllowedMethod> | |
<AllowedHeader>*</AllowedHeader> |
View example.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const file1 = { | |
name: "example/file1.txt", | |
stream: () => new Blob(["support blobs too"]).stream() | |
}; | |
// Note: windows gets confused when file & folders starts with / | |
const fileMap = new Map([ | |
["file1", file1], | |
["file2", new File(["file1 content"], "example/file2.txt")], | |
["zip-subfolder/Sintel.mp4", "s3key/Sintel.mp4"], |
View s3-bucket-cors.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<AllowedOrigin>https://*</AllowedOrigin> | |
<AllowedMethod>HEAD</AllowedMethod> | |
<AllowedMethod>GET</AllowedMethod> | |
<AllowedMethod>PUT</AllowedMethod> | |
<AllowedMethod>POST</AllowedMethod> | |
<AllowedMethod>DELETE</AllowedMethod> | |
<AllowedHeader>*</AllowedHeader> |
View bash.bashrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# /etc/bash.bashrc | |
# | |
# ...... | |
# Custom functions | |
function expac-diff-file { | |
if [[ "$1" == "" ]]; | |
then |