This file contains hidden or 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
- name: Digital Ocean | |
hosts: all | |
connection: local | |
gather_facts: false | |
vars: | |
do_token: abc123 | |
droplets: | |
- vippers-one | |
- vippers-two | |
- vippers-three |
This file contains hidden or 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
/* | |
Example usage: | |
ts-node index.ts bradyholt/repo123 ~/dev/repo123 devtag | |
*/ | |
import axios from "axios"; | |
import childProcess = require("child_process"); | |
let repoName = process.argv[2]; | |
let repoPath = process.argv[3]; |

This file contains hidden or 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
[ | |
{rabbitmq_email, [ | |
%% gen_smtp server parameters | |
%% see https://github.com/Vagabond/gen_smtp#server-example | |
{server_config, [ | |
[{port, 2525}, {protocol, tcp}, {domain, "geekytidbits.com"}, {address,{0,0,0,0}}] | |
]}, | |
%% how clients are authenticated; either 'false' or 'rabbitmq' (default) | |
{server_auth, false}, | |
%% whether STARTTLS shall be offered; either 'true' or 'false' (default) |
This file contains hidden or 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
# Find latest version of packages | |
curl -X POST \ | |
-H "Accept: application/vnd.github.package-deletes-preview+json" \ | |
-H "Authorization: bearer $GITHUB_API_TOKEN" \ | |
-d '{"query":"query { repository(owner:\"johndoe\", name:\"myepo\") { registryPackagesForQuery(first:10) { edges { node { latestVersion { id } } } } } }"}' \ | |
https://api.github.com/graphql | |
# Example output from above command | |
# {"data":{"repository":{"registryPackagesForQuery":{"edges":[{"node":{"latestVersion":{"id":"MDE01234523233"}}}]}}}} |
This file contains hidden or 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
SELECT set_config('current.user', 'my_user', false); | |
SELECT set_config('current.dbname', 'my_database', false); | |
CREATE USER current_setting('current.user'); | |
-- Give CREATE, CONNECT, TEMPORARY permissions | |
GRANT ALL PRIVILEGES ON DATABASE current_setting('current.dbname') TO current_setting('current.user'); | |
-- Grant INSERT, UPDATE, DELETE access to all EXISTING tables in public schema | |
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO current_setting('current.user'); |
This file contains hidden or 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
/** | |
* Pollster - The SmartThings Polling Daemon. | |
* | |
* Pollster works behind the scenes and periodically calls 'poll' or | |
* 'refresh' commands for selected devices. Devices can be arranged into | |
* three polling groups with configurable polling intervals down to 1 minute. | |
* | |
* Please visit [https://github.com/statusbits/smartthings] for more | |
* information. | |
* |
This file contains hidden or 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
TOKEN=123; curl -Ss -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \ | |
"https://api.github.com/repos/username/repo_name/releases?per_page=100&page=1" \ | |
| jq -r '.[] | select(.draft == true) | .id' \ | |
| xargs -I {} -L 1 \ | |
curl -L -H "Authorization: token $TOKEN" -X DELETE "https://api.github.com/repos/username/repo_name/releases/{}" |
This file contains hidden or 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
git-move() { | |
echo "Moving commits on current branch to a new branch..." | |
# This is useful if commits were mistakenly made on master and need to be move to a new branch. | |
# $1 - New target branch name | |
if [ -z "$1" ]; then echo "New branch name required!"; exit 0; fi | |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
echo "Moving local commits on ${CURRENT_BRANCH} to $1" | |
git branch ${1} && git reset --hard origin/${CURRENT_BRANCH} && git checkout ${1} | |
} |
This file contains hidden or 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
# Source :https://stackoverflow.com/a/67000032/626911 | |
org=<your org> | |
repo=<your repo> | |
# Get workflow IDs with status "disabled_manually" | |
workflow_ids=($(gh api repos/$org/$repo/actions/workflows | jq '.workflows[] | select(.["state"] | contains("disabled_manually")) | .id')) | |
for workflow_id in "${workflow_ids[@]}" | |
do | |
echo "Listing runs for the workflow ID $workflow_id" |