1. SSH Into Controller
Self explainatory.
2. Create Shell Script
Create the folder, the file...
mkdir /usr/share/cron/
vi /usr/share/cron/cgrestart.sh
The script is...
const generateCombinations = (arr, length) => { | |
if (length === 0) return [[]]; | |
if (arr.length === 0 || length > arr.length) return []; | |
if (length === 1) return arr.map(item => [item]); | |
const combinations = []; | |
for (let i = 0; i < arr.length; i++) { |
# Step 1 of 2: Export Contact Info | |
export CONTACT_INFO="FirstName=Fred,LastName=Lackey,ContactType=PERSON,AddressLine1=PO Box 6066,City=Live Oak,State=FL,CountryCode=US,ZipCode=32060,PhoneNumber=+1.4073743733,Email=fred.lackey@gmail.com" | |
# Step 2 of 2: Run command | |
aws route53domains list-domains --profile fredlackey | jq -r '.Domains' | jq -r '.[].DomainName' | while read DOMAIN; do \ | |
eval "aws route53domains update-domain-contact --profile fredlackey --domain $DOMAIN --admin-contact \"$CONTACT_INFO\" --registrant-contact \"$CONTACT_INFO\" --tech-contact \"$CONTACT_INFO\""; sleep 10; | |
done; | |
# Format for the contact info blob: | |
# FirstName=string,LastName=string,ContactType=string,OrganizationName=string,AddressLine1=string,AddressLine2=string,City=string,State=string,CountryCode=string,ZipCode=string,PhoneNumber=string,Email=string,Fax=string,ExtraParams=[{Name=string,Value=string},{Name=string,Value=string}] |
{ | |
"parentIdentifier": "ROOT", | |
"name": "", | |
"protocol": "", | |
"parameters": { | |
"port": "", | |
"read-only": "", | |
"swap-red-blue": "", | |
"cursor": "", | |
"color-depth": "", |
#!/bin/bash | |
# curl https://gist.githubusercontent.com/FredLackeyOfficial/d993aa52fbd2795bf39e9226db572dba/raw/setup-docker.sh | sudo bash | |
# bash <(curl -Ls https://gist.githubusercontent.com/FredLackeyOfficial/d993aa52fbd2795bf39e9226db572dba/raw/setup-docker.sh) | |
sudo apt remove docker docker-engine docker.io | |
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
#!/bin/bash | |
CUR_DIR=$(pwd) | |
echo "Committing end of day changes ..." | |
for i in $(find . -name ".git" | cut -c 3-); do | |
echo ""; | |
echo "Committing $i ..."; |
cmd_exists() { | |
command -v "$1" &> /dev/null | |
} | |
ncu-update-all(){ | |
if ! cmd_exists "ncu"; then | |
printf "ncu is required, please install it!\n" | |
exit 1 | |
fi |
1. SSH Into Controller
Self explainatory.
2. Create Shell Script
Create the folder, the file...
mkdir /usr/share/cron/
vi /usr/share/cron/cgrestart.sh
The script is...
Using DbSchema with Postgres & Sequelize
The road to using Postgres, Sequelize, Sequelize-Auto, and DbSchema have some bumps along the way. More specifically, these "bumps" have to do with automatic incrementing and audit fields. These are the steps I recommend when working with this combination.
Rule #1: Do not use Sync
Sequelize-Auto does not handle indexes. For this reason, any indexes created in DbSchema will be ignored. This is why we use DbSchema to work with database modifications. We only tweak enough of Sequelize's models to work with the columns. Since the models will not have indexes by default, we must never use Sequelize to push changes to the database.
The process...
1. Define Sequences
#!/bin/bash | |
# create .keep files for empty directories currently ignored by git | |
# run git clean -nd to see which directories are empty and therefore ignored by git currently | |
# run git keep to add these directories by adding a .keep file | |
# see this discussion http://stackoverflow.com/questions/115983/how-do-i-add-an-empty-directory-to-a-git-repository/21422128#21422128 | |
git clean -nd | awk '{ print $3 }' | xargs -L1 -I{} touch {}.keep |
#!/bin/bash | |
main(){ | |
local PROJECT_PATH="$(realpath "../")"; | |
local PROJECT_NAME="$(basename $PROJECT_PATH)"; | |
create_network "$PROJECT_NAME" | |
create_databases "$PROJECT_NAME" | |
create_dreamfactory "$PROJECT_NAME" | |
} |