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
#!/bin/bash | |
# Author: Thomas Berezansky <[email protected]> | |
# Author: Jason Stephenson <[email protected]> | |
# | |
# Feel free to use and to share this script in anyway you like. | |
# This script is intended as a shortcut for the git cherry-pick | |
# command when you have several commits that you want to cherry-pick | |
# into your local branch from another branch. It often results in a |
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
# npm using https for git | |
git config --global url."https://github.com/".insteadOf [email protected]: | |
git config --global url."https://".insteadOf git:// | |
# npm using git for https | |
git config --global url."[email protected]:".insteadOf https://github.com/ | |
git config --global url."git://".insteadOf https:// |
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
# Typical use-case is decoding an AWS STS message. The DecodedMessage key contains escaped JSON. | |
jq '.DecodedMessage | fromjson | .' message.json |
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
#!/bin/bash | |
RULES=$(aws waf list-rules | jq -r ".Rules[] | .RuleId") | |
for rule in $RULES; do | |
TOKEN=$(aws waf get-change-token | jq -r .ChangeToken) | |
PRED=$(aws waf get-rule --rule-id $rule | jq ".Rule.Predicates[0]") | |
aws waf update-rule --cli-input-json '{"RuleId": "'$rule'", "ChangeToken": "'$TOKEN'", "Updates": [{"Action": "DELETE", "Predicate": '"$PRED"'}]}' |
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
-- File: MarkUnreadEmails.scpt | |
-- Description: Go through the mailboxes in Outlook and mark unread messages as read | |
-- Author: Chad Armstrong | |
-- Date: 22 November 2019 | |
tell application "Microsoft Outlook" | |
set myInbox to folder "Inbox" of default account | |
set github to folder "GitHub" of myInbox | |
set other to folder "Other" of myInbox |
Created as a module that can be imported or run. Requires built in JSON, requests, and datetime modules.
Allows you to clone a branch on Github using the Github Git Database API Endpoints.
Forked Gist from:
- auwsome/Create-branch-with-Github-API.md
See:
Copied from the readline documentation.
For MacOS, replace Ctrl
with Cmd
, and Meta
with Option
.
Shortcut | Comment |
---|---|
Ctrl +A |
Beginning of line |
Ctrl +B / ← |
Backward one character |
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
#!/usr/bin/env python | |
import multiprocessing | |
import random | |
import time | |
class Logger: | |
def __init__(self, num_lines, last_output_per_process, terminal_lock): | |
self.num_lines = num_lines |
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 directories in music folder modified in last 240 hours | |
fd . '/path/to/music/' \ | |
--changed-within "240h" \ | |
--min-depth 2 \ | |
-d 2 \ | |
| \ | |
# Remove any paths containing @ symbol (Synology NAS quirk) | |
rg -v '@' \ | |
| \ |
OlderNewer