Skip to content

Instantly share code, notes, and snippets.

View jerryharrison's full-sized avatar
🐢
Marathon not a sprint.

Jerry Harrison jerryharrison

🐢
Marathon not a sprint.
View GitHub Profile
@AggressivelyMeows
AggressivelyMeows / worker.js
Last active September 5, 2021 15:45
A worker to upload and read files from a private B2 bucket.
// A simple guide on how to use this Worker.
// To upload to the private bucket, you can send a POST request to the URL you want the file to end up at.
// For example: worker-url.com/images/user-1/subfolder/hi.png
// Once done, you can test your file by going to:
// worker-url.com/images/user-1/subfolder/h1.png
// Super simple API to use, much better than dealing with B2 directly, in my opinion.
addEventListener('fetch', event => {
event.respondWith(handleRequest(event))
@bakbas
bakbas / backblaze-uploader-for-lambda.js
Last active September 5, 2021 15:44
Backblaze uploader for AWS Lambda
const B2 = require("backblaze-b2");
const mime = require("mime");
const backblaze_key_id = process.env.BACKBLAZE_KEY_ID;
const backblaze_application_key = process.env.BACKBLAZE_APPLICATION_KEY;
const backblaze_bucket_id = process.env.BACKBLAZE_BUCKET_ID;
const b2 = new B2({
applicationKeyId: backblaze_key_id,
applicationKey: backblaze_application_key,
@gimKondo
gimKondo / deploy-feature-by-pr-comment.yaml
Created June 10, 2020 15:59
Deploy feature branch by pull request comment
name: deploy dev from feature by pull request
on:
issue_comment:
types:
- created
jobs:
deploy:
# add comment of pull request && comment is KEYWORD
@elisescu
elisescu / help.md
Last active February 20, 2021 16:03
temp-tty-server-config

Nginx config

My nginx config. I honestly don't remember the details of all parts of the config, but I do remember having to do something explicit about the websockets connections, which initially were not allowed by the proxy. I should update the documentation of the repo one day, when I will get some time :).

nginx config for the web/browser side (http+websockets connection)

http {
    upstream tty-server {
        server localhost:8010;
@pramsey
pramsey / 0-spatial-sql-postgis.md
Last active November 13, 2023 18:33
Spatial SQL and PostGIS
@enricofoltran
enricofoltran / main.go
Last active June 26, 2024 12:16
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@diverted247
diverted247 / .elasticbeanstalk_config.yml
Last active May 12, 2020 15:36
AWS EB - Golang Binary Server Deployment
branch-defaults:
default:
environment: test
group_suffix: null
global:
application_name: test
default_platform: Go 1.4
default_region: us-west-2
@jult
jult / blockpeers.sh
Last active March 5, 2024 07:33
blocking p2p peer snoopers and evil corp (for Tixati IP filter and such)
#!/bin/sh
# This script runs every other night at 04:56 CET on a webserver I maintain
# Results are always at: https://jult.net/block.txt ( or https://jult.net/block.txt.gz )
# And much smaller, stripped of BS; https://jult.net/bloc.txt
# For use in Tixati IP filter: https://jult.net/bloc.txt.gz !!!
# And finally a txt file with just the bold IP-ranges: https://jult.net/bl.txt (or https://jult.net/bl.txt.gz )
# Download open block-lists, unpack, filter:
curl -s https://www.iblocklist.com/lists.php | grep -A 2 Bluetack | xargs wget -qO - --limit-rate=500k | gunzip -f | egrep -v '^#' > /tmp/xbp
@neverlock
neverlock / ssl_smtp_example.go
Created January 12, 2016 04:51 — forked from chrisgillis/ssl_smtp_example.go
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)