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/sh | |
docker stop $( docker ps -qa ); docker container rm $( docker container ls -qa ); docker volume rm $( docker volume ls -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
# Eternal bash history. | |
# --------------------- | |
# Undocumented feature which sets the size to "unlimited". | |
# http://stackoverflow.com/questions/9457233/unlimited-bash-history | |
HISTCONTROL=ignoreboth:erasedups | |
HISTFILESIZE= | |
HISTSIZE= | |
HISTTIMEFORMAT="%F %T " | |
# Change the file location because certain bash sessions truncate .bash_history file upon close. |
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="dotcms"; ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519_$name -C $name |
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
# first `mkdir tables` | |
dump_file = 'DUMPFILE.sql' | |
with open(dump_file, 'r') as sql: | |
table = None | |
for line in sql.readlines(): | |
if line.startswith('COPY public.'): | |
t = line.split()[1] | |
print(f"opening {t}") | |
table = open(f"tables/{t}", 'w') |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
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
yum remove -y libpq.x86_64 postgresql.x86_64 postgresql-server.x86_64 | |
cat <<EOF > /etc/yum.repos.d/pgdg.repo | |
[pgdg12] | |
name=PostgreSQL 12 for RHEL/CentOS 7 - x86_64 | |
baseurl=https://download.postgresql.org/pub/repos/yum/12/redhat/rhel-7-x86_64 | |
enabled=1 | |
gpgcheck=0 | |
EOF | |
yum makecache | |
yum install postgresql12 |
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
""" | |
A simple proxy server, based on original by gear11: | |
https://gist.github.com/gear11/8006132 | |
Modified from original to support both GET and POST, status code passthrough, header and form data passthrough. | |
Usage: http://hostname:port/p/(URL to be proxied, minus protocol) | |
For example: http://localhost:5000/p/www.google.com | |
""" | |
import re |
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
sudo yum install -y python3-devel gcc docker | |
sudo useradd -m -G docker -s /bin/bash docker | |
sudo su - docker | |
python3 -m venv python3-env | |
source python3-env/bin/activate | |
# or export PATH=$HOME/python3-env/bin:$PATH and add to .bash_profile | |
# upgrade pip first else you may get rust errors while building docker-compose | |
pip install --upgrade pip | |
pip install docker-compose |
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
DO $$ DECLARE | |
r RECORD; | |
BEGIN | |
-- if the schema you operate on is not "current", you will want to | |
-- replace current_schema() in query with 'schematodeletetablesfrom' | |
-- *and* update the generate 'DROP...' accordingly. | |
FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = current_schema()) LOOP | |
EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.tablename) || ' CASCADE'; | |
END LOOP; | |
END $$; |
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
update_config: | |
delay: 3m | |
parallelism: 1 | |
failure_action: rollback |