https://gist.github.com/search?q=user%3Amttjohnson+gist
user:mttjohnson gist
/* Create Sample Data for testing removal of tables views triggers routines events */ | |
delimiter // | |
CREATE PROCEDURE simpleproc (OUT param1 INT) | |
BEGIN | |
SELECT COUNT(*) INTO param1 FROM information_schema.tables; | |
END// | |
delimiter ; | |
-- CALL simpleproc(@a); | |
-- SELECT @a; |
HOST_NAME='example.com' | |
# check the known hosts list for any entries for $HOST_NAME | |
cat ~/.ssh/known_hosts | grep $HOST_NAME | |
# if the host does not exist in the list append it to the file | |
[ $(cat ~/.ssh/known_hosts | grep $HOST_NAME | wc -l) -eq 0 ] && ssh-keyscan $HOST_NAME >> ~/.ssh/known_hosts | |
# remove the key fromt he known hosts list | |
ssh-keygen -R $HOST_NAME |
https://gist.github.com/search?q=user%3Amttjohnson+gist
user:mttjohnson gist
ORIGIN_SSH_USER=example_user | |
ORIGIN_SSH_HOST=example_host | |
ORIGIN_SITE_ROOT="/example/site/root" | |
ORIGIN_SHARED_PATH | |
ORIGIN_MR_COMMAND="mr" | |
ORIGIN_PHP_COMMAND="php" | |
export ORIGIN_CONFIG_VALUE=$( | |
ssh -q ${ORIGIN_SSH_USER}@${ORIGIN_SSH_HOST} " | |
cd ${ORIGIN_SITE_ROOT}; | |
${ORIGIN_MR_COMMAND} config:get --scope=default --scope-id=0 --format=xml web/unsecure/base_url | \\ |
/* Create procedure for separating strings into a list of keywords */ | |
delimiter $$ | |
DROP PROCEDURE IF EXISTS split_value_into_multiple_rows $$ | |
CREATE PROCEDURE split_value_into_multiple_rows(tablename VARCHAR(50), | |
id_column VARCHAR(50), value_column VARCHAR(50), delim CHAR(1)) | |
BEGIN | |
DECLARE id INT DEFAULT 0; | |
DECLARE value VARCHAR(255); | |
DECLARE occurrences INT DEFAULT 0; |
# To view a history over time of yum activity | |
yum history summary | |
# To view the history list of most recent yum activity | |
# Actions in the list are Erase (E), Install (I), Update (U) | |
yum history list | |
# Details on a specific history id | |
yum history info <ID> |
Certificate Transparancy Search | |
https://crt.sh/ | |
SSL/TLS Certificates (cert) issued, and logged by various providers | |
Find all certificates for a domain name including the use of wildcards in the searches. Datetime when certificates were issued. |
# Input log file | |
2017-08-22T09:24:24+00:00 DEBUG (7): Start: M2epro Cron index | |
2017-08-22T09:24:30+00:00 DEBUG (7): Stop: M2epro Cron index | |
2017-08-22T09:25:24+00:00 DEBUG (7): Start: M2epro Cron index | |
2017-08-22T09:25:28+00:00 DEBUG (7): Start: M2epro Cron index | |
2017-08-22T09:25:29+00:00 DEBUG (7): Stop: M2epro Cron index | |
2017-08-22T09:25:32+00:00 DEBUG (7): Stop: M2epro Cron index | |
2017-08-22T09:26:24+00:00 DEBUG (7): Start: M2epro Cron index | |
2017-08-22T09:26:36+00:00 DEBUG (7): Stop: M2epro Cron index |
# enumerate ssl ciphers | |
nmap --script ssl-enum-ciphers -p 443 <hostname> | |
# Security/Server Side TLS Recommendation Guide | |
https://wiki.mozilla.org/Security/Server_Side_TLS |
# setup a remote as read only so that you do not acidently push to it. | |
git remote set-url --push upstream read-only |