Skip to content

Instantly share code, notes, and snippets.

View haydonryan's full-sized avatar

Haydon Ryan haydonryan

View GitHub Profile
@haydonryan
haydonryan / gist:944cce1a9a86f1465e21
Created November 14, 2014 21:45
drop all bales in database
SET FOREIGN_KEY_CHECKS = 0;
SET @tables = NULL;
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables
FROM information_schema.tables
WHERE table_schema = 'database_name'; -- specify DB name here.
SET @tables = CONCAT('DROP TABLE ', @tables);
PREPARE stmt FROM @tables;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
@haydonryan
haydonryan / convert pem to pfx.txt
Created April 5, 2017 15:42
convert cert and private key to PFX (AZURE)
openssl pkcs12 -export -out certificate.pfx -inkey sys.azure.hnrglobal.com.key -in sys.azure.hnrglobal.com.crt
# TODO:
# Add HTTP listener
# Add ssh listener
# Add Websockets Listener
export LOCATION="westus"
export RESOURCE_GROUP="pcfmarketplace"
export VNET="pcf-net"
export SUBNET="AppGatewaySubnet" # Note this can't have anything in the back of it.

Turn on debug logging

/home/tempest-web/tempest/web/config/environments/production.rb
config.log_level = :info   -> config.log_level = :debug

Creates logs in: /tmp/logs

SSH to OMD and become root
Switch to postgres user
Execute psql
Log into tempest_production database
Execute:
UPDATE installs SET status='failed', finished_at='2017-05-04T13:58:39.620Z', finished=true WHERE id='23';
sudo killall -HUP mDNSResponder;say DNS cache has been flushed
sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flushcache;say MacOS DNS cache has been cleared
sudo service tempest-web stop
sudo service tempest-web start
#you will have to enter the decryption passphrase after this.
#!/bin/bash
set -e
if [[ ($# -ne 3) && ($# -ne 2) ]]
then echo "wrong number of arguments:"
echo "create_cert sys_domain app_domain"
exit 1
fi
bosh --ca-cert /var/tempest/workspaces/default/root_ca_certificate target DIRECTOR-IP-ADDRESS
sudo su - tempest-web -s /bin/bash -c 'psql tempest_production'
SELECT column_name, data_type
FROM information_schema.columns
WHERE table_name = 'uaa_configs';
SELECT id, hostname
FROM uaa_configs;
UPDATE uaa_configs