Skip to content

Instantly share code, notes, and snippets.

View Sonic0's full-sized avatar
🦄
I'm eating Unicorns

Andrea Salvatori - IU6FZL Sonic0

🦄
I'm eating Unicorns
View GitHub Profile
@Sonic0
Sonic0 / https_s3_website.sh
Created April 4, 2024 13:38 — forked from haranjackson/https_s3_website.sh
An AWS CloudFormation template for a static website hosted on S3, served over HTTPS with CloudFront. "www." redirects to the naked domain.
DOMAIN= # insert your domain here (e.g. example.com)
STACK= # choose a name for your stack
REGION=us-east-1 # the ACM certificate must be in us-east-1
aws cloudformation deploy --template-file https_s3_website.yaml \
--stack-name $STACK \
--region $REGION \
--parameter-overrides DomainName=$DOMAIN
# push the website source to the s3 bucket - assuming it is contained in src/
@Sonic0
Sonic0 / parse_mysql_signwith.sh
Created January 10, 2024 17:51
Parse MySQL repository public key sign for a provided Ubuntu distribution codename
#!/bin/bash
# example: DEBUG="true" ./parse_mysql_signwith.sh focal 8.0
debug() {
if [ -n "${DEBUG}" ] && [ "${DEBUG}" = "true" ]; then
echo "DEBUG: ${*}" 1>&2
fi
}
# Check if both Ubuntu codename and MySQL version are provided as arguments
@Sonic0
Sonic0 / main.py
Created August 3, 2023 10:12 — forked from arkadiyt/main.py
import boto3
import certbot.main
import datetime
import os
import raven
import subprocess
def read_and_delete_file(path):
with open(path, 'r') as file:
contents = file.read()
#!/bin/bash
set -e
set -o pipefail
echo "Start validation $1"
BRANCH=$(git branch -r --contains ${GITHUB_SHA} | grep "")
RELEASE_VERSION=$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g" | sed -e "s/\//-/g")
#!/bin/bash
# This replace spaces in a file name
# with underscores as the default.
# replaceit
# file 1.txt will be file_1.txt
# You can provide an argument for replacement.
# replaceit -
# file-1.txt will be file_1.txt
# replaceit -f -
@Sonic0
Sonic0 / gist:b77a587a82380875dfb4708c2b575a87
Created January 7, 2021 21:22 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@Sonic0
Sonic0 / Local PR test and merge.md
Created October 25, 2020 20:47 — forked from adam-p/Local PR test and merge.md
Testing a pull request, then merging locally; and avoiding TOCTOU

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37