This file contains 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
import scrape from 'website-scraper'; | |
import TurndownService from 'turndown'; | |
import { JSDOM } from 'jsdom'; | |
import path from 'path'; | |
import fs from 'fs-extra'; | |
const turndownService = new TurndownService(); | |
class MyPlugin { |
This file contains 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 bash | |
tmux new-session -d -s multiplex | |
tmux select-window -t multiplex:0 | |
INDEX=0 | |
for i in alice bob charles denice ephrahim fantasea greg | |
do | |
tmux split-window -h | |
tmux select-pane -t $INDEX |
This file contains 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: Dependabot auto-approve | |
on: pull_request_target | |
permissions: | |
pull-requests: write | |
# From the docs at https://github.com/dependabot/fetch-metadata#enabling-auto-merge | |
jobs: | |
dependabot: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} |
This file contains 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
javascript: (function () { | |
main(); | |
function extractText(element) { | |
if (element.nodeType === Node.TEXT_NODE) { | |
return element.textContent.trim() + ' '; | |
} | |
if (element.nodeType !== Node.ELEMENT_NODE) { | |
return ''; | |
} |
This file contains 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
# Prerequisites: | |
# [GNU Parallel](https://www.gnu.org/software/parallel/) | |
# [kubectl-neat](https://github.com/itaysk/kubectl-neat) | |
# [mikefarah/yq](https://github.com/mikefarah/yq) | |
# | |
# Usage: | |
# - Copy and paste the below into your active shell session. Alternatively, add to your shell initialization scripts. | |
# - kubectl_export <namespace> | |
# The folder structure will be created: <namespace>/<kind>/<resource_name>.yaml | |
# |
This file contains 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
ruby -rcolorize -rnet/http -e ' | |
def check() | |
s_time = Time.now() | |
res = Net::HTTP.get_response(URI( "https://example.com/")) | |
ensure | |
e_time = Time.now() | |
code = defined?(res.code) ? res.code : "5xx" | |
return [e_time - s_time, code] | |
end | |
while true do |
This file contains 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 | |
set -eu -o pipefail | |
[[ $(w | wc -l) -lt 3 ]] && { | |
echo "Nobody logged in" | |
sudo shutdown -hP +60 "Shutting down due to no active sessions" | |
} || { | |
echo "Users logged in" >/dev/null | |
} |
This file contains 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 bash | |
## | |
# Usage: tf_move_state.sh source_directory target_directory source_resource_name <target_resource_name (uses source_resource_name if not provided)> | |
# Provide source and target directories using relative paths. | |
# WARNING: TEST ON AN INCONSPICUOUS AREA AS STAINING MAY OCCUR | |
# Credit to https://github.com/mcalhoun | |
set -e |
This file contains 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: Add Terraform Plan to Pull Requests | |
on: | |
pull_request: | |
env: | |
# See page below about disabling Hashicorp Upgrade and Security Checks | |
# https://www.terraform.io/docs/commands/index.html#upgrade-and-security-bulletin-checks | |
CHECKPOINT_DISABLE: true |
This file contains 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
for i in $(aws servicediscovery list-services --filter Name=NAMESPACE_ID,Values=[ns-MYNAMESPACEIDHERE],Condition=EQ --query "Services[].Id" --output text) ; do aws servicediscovery delete-service --id $i; done |
NewerOlder