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 all .orig files, and delete them with confirmation | |
find . -name "*.orig" && read -q "REPLY?Delete all?" && find . -name "*.orig" -delete && echo "\nDone." | |
# pg_restore with bandwidth control and progress bar | |
cat db.dump | pv -pera -s $(stat -c %s db.dump) -L 2000000 | pg_restore -d postgres://postgres:a@localhost/db_name --clean --no-owner --verbose -Fc | |
# check pg readiness | |
for i in {1..60}; do echo "Waiting for pg ..."; pg_isready -d $PG_URL && break || sleep 1; done | |
# http://www.grymoire.com/Unix/Awk.html |
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 | |
delete_branches () { | |
branches=($(git branch | sed 's/*//g')) | |
element_count=${#branches[@]} | |
selected_branches=() | |
echo "Select branches:" | |
for br in "${branches[@]}" | |
do | |
echo "Delete $br ? y/(n)" |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowListingOfUserFolder", | |
"Action": [ | |
"s3:ListBucket", | |
"s3:GetBucketLocation" | |
], | |
"Effect": "Allow", |
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 | |
set -x | |
set -e | |
root_dir=$(pwd) | |
tmpdir=$(mktemp -d "${TMPDIR:-/tmp/}$(basename $0).XXXXXXXXXXXX") | |
git archive --prefix=my-jet/ HEAD > "$tmpdir/archive.tgz" |
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
require 'capybara' | |
require 'capybara/dsl' | |
require 'selenium-webdriver' | |
# java -jar selenium-server-standalone-3.14.0.jar | |
# | |
if ENV["SELENIUM_REMOTE_HOST"] | |
Capybara.register_driver :selenium_chrome_remote do |app| | |
args = [ | |
"--disable-infobars", |
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
require 'elasticsearch' | |
require 'time' | |
client = Elasticsearch::Client.new host: "172.17.0.1", log: true | |
mappings = { | |
mappings: { | |
log: { | |
properties: { | |
ts: { type: 'date' }, |
OlderNewer