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
https:// { | |
log | |
tls internal { | |
on_demand | |
} | |
reverse_proxy :3000 | |
} |
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
# frozen_string_literal: true | |
source "https://rubygems.org" | |
gem "benchmark-ips" | |
gem "ruby-progressbar" | |
gem "benchmark-memory" |
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 | |
sudo echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmCWEDQANcFwUinupNVlLkYNHwDGFFMi0VcavutW4U+p5hu6sqt3LiEt3+QAq36mIL1JsoV0DVFmbVJQVe6c5zs244AoAA5JjFtq4VDa6eKecuP/jYMNFpORW4Teunc87YO2RUG75mfy4A12v4rfCdx/B01l7TmYHTsEODqhkGiih/1GyL/WBLClqFhbJVUpXyCjXi3GChTOKVbhZKXOMWu7rMU7VaCGik2luN3jaqvGywcems8KLcgX7u0dhqH7hRzY3wtv1mqmkvUna45w0B/j46+wsTdiK0m85vRn6ZRLY2cM16YAl8pqsAfHchfOlft4R9cvnFWjdE/iEcM9F7 [email protected]" >> /home/*/.ssh/authorized_keys | |
sudo chmod go-rwx /home/*/.ssh/authorized_keys | |
sudo echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmCWEDQANcFwUinupNVlLkYNHwDGFFMi0VcavutW4U+p5hu6sqt3LiEt3+QAq36mIL1JsoV0DVFmbVJQVe6c5zs244AoAA5JjFtq4VDa6eKecuP/jYMNFpORW4Teunc87YO2RUG75mfy4A12v4rfCdx/B01l7TmYHTsEODqhkGiih/1GyL/WBLClqFhbJVUpXyCjXi3GChTOKVbhZKXOMWu7rMU7VaCGik2luN3jaqvGywcems8KLcgX7u0dhqH7hRzY3wtv1mqmkvUna45w0B/j46+wsTdiK0m85vRn6ZRLY2cM16YAl8pqsAfHchfOlft4R9cvnFWjdE/iEcM9F7 [email protected]" >> /root/.ssh/authorized_keys | |
sudo chmod go-rwx /root/.ssh/authorized |
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 -e | |
git clone [email protected]:amenitiz/ododo.git -b PREPS | |
cd ododo | |
make full-initial-setup |
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 | |
wait-for-url() { | |
timeout 90 \ | |
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://app.lvh.me:3000/users/sign_in)" != "200" ]]; do echo "$(curl -s -o /dev/null -w ''%{http_code}'' app.lvh.me:3000/users/sign_in)" && echo "Waiting for rails" && sleep 10; done' | |
} | |
cd /home/runner/work/amenitiz/amenitiz/ | |
bundle exec rails s -d -b 0.0.0.0 | |
wait-for-url |
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
watch -n 1 'echo "show table http" | socat unix:/var/run/haproxy.sock -' | |
watch -n 1 'echo "show table public" | socat unix:/var/run/haproxy.sock -' |
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
goaccess -f haproxy.log --log-format='%^ %^ %^:%^:%^ %^ %^[%^]: %h:%^ [%d:%t.%^] %^ %^ %^/%^/%^/%^/%L %s %b %^ %^ %^ %^/%^/%^/%^/%^ %^/%^ "%r"' --date-format='%d/%b/%Y' --time-format='%H:%M:%S' -q |
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 | |
# install this in any folder in your path and execute it | |
# by fire.sh in case of a real fire to save your data | |
echo "Leave the building you fool i will handle it" | |
# adding new branch to not polute the one beign used | |
# and unique by user name | |
git checkout -b fire_starting_$(whoami) |
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
-- In pg_stat_statements, there is a problem: sometimes (quite often), it registers the same query twice (or even more). | |
-- It's easy to check in your DB: | |
-- | |
-- with heh as ( | |
-- select userid, dbid, query, count(*), array_agg(queryid) queryids | |
-- from pg_stat_statements group by 1, 2, 3 having count(*) > 1 | |
-- ) select left(query, 85) || '...', userid, dbid, count, queryids from heh; | |
-- | |
-- This query gives you "full picture", aggregating stats for each query-database-username ternary |
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 | |
# Include any branches for which you wish to disable this script | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop staging test) | |
fi | |
# Get the current branch name and check if it is excluded | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME_VALID_FORMAT=$(echo $BRANCH_NAME | grep -c -E "^\w{3,}-\d{3,}$") |
NewerOlder