Skip to content

Instantly share code, notes, and snippets.

View voodoodror's full-sized avatar

Dror Bletter voodoodror

View GitHub Profile
@voodoodror
voodoodror / gist:79917399513f9bd5652d153e5718922a
Last active September 19, 2023 07:52
AWS Signature 4 Bash
# Currently supports GET method but few modifications should make it universal.
# script.sh <METHOD> <URL>
# Note that this script isn't S3 upload compatible!
ACCESS_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
SECRET_KEY="YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"
DATE=$(date -u +"%Y%m%dT%H%M%SZ")
DATE_ONLY=$(date -u +"%Y%m%d")
REGION="us-east-1"
SERVICE="execute-api"
ALGORITHM="AWS4-HMAC-SHA256"
@voodoodror
voodoodror / gist:6d0fb70dc22dde9a53852e0b42f477da
Last active November 12, 2018 15:12
Bitbucket to GitHub Repository Migration Script
import json
import requests
import os
import argparse
bb_username = 'MY_USERNAME'
bb_password = 'BITBUCKET_PASSWORD'
gh_token = 'GH_TOKEN'
project_name = 'PROJECT_NAME'
import json
import requests
gh_token = '<GITHUB_TOKEN>'
results = []
params = {'page': 1, 'per_page':100}
another_page = True
api = 'https://api.github.com/orgs/<ORG>/repos'
while another_page:
r = requests.get(api, params=params, headers={'Authorization': 'token {}'.format(gh_token)})
@voodoodror
voodoodror / gist:cfe8c05e6f73ecea893581b1eb7a2a21
Last active February 3, 2021 14:13
GitHub Actions Self-Hosted Runner with AWS credentials (EKS roles confirmed)
name: CI
on:
pull_request:
branches:
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch: