Let's make sure our Express app has the required base modules:
# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon| #!/bin/bash | |
| yum install httpd php-mysql -y | |
| amazon-linux-extras install -y php7.3 | |
| cd /var/www/html | |
| wget https://wordpress.org/latest.tar.gz | |
| tar -xzf latest.tar.gz | |
| cp -r wordpress/* /var/www/html/ | |
| rm -rf wordpress | |
| rm -rf latest.tar.gz | |
| chmod -R 755 wp-content |
| (function (window, document) { | |
| if (window.myfbq) return; | |
| window.myfbq = (function () { | |
| if (arguments.length > 0) { | |
| var pixelId, trackType, contentObj; | |
| if (typeof arguments[0] == 'string') pixelId = arguments[0]; | |
| if (typeof arguments[1] == 'string') trackType = arguments[1]; | |
| if (typeof arguments[2] == 'object') contentObj = arguments[2]; |
| require('isomorphic-fetch'); | |
| fetch('https://1jzxrj179.lp.gql.zone/graphql', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json' }, | |
| body: JSON.stringify({ query: '{ posts { title } }' }), | |
| }) | |
| .then(res => res.json()) | |
| .then(res => console.log(res.data)); |
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| #!/bin/bash | |
| # | |
| # This script configures WordPress file permissions based on recommendations | |
| # from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
| # | |
| # Author: Michael Conigliaro | |
| # | |
| WP_OWNER=changeme # <-- wordpress owner | |
| WP_GROUP=changeme # <-- wordpress group | |
| WP_ROOT=/home/changeme # <-- wordpress root directory |
| // Returns an array of dates between the two dates | |
| function getDates (startDate, endDate) { | |
| const dates = [] | |
| let currentDate = startDate | |
| const addDays = function (days) { | |
| const date = new Date(this.valueOf()) | |
| date.setDate(date.getDate() + days) | |
| return date | |
| } | |
| while (currentDate <= endDate) { |
| <?php | |
| /** | |
| * This is free and unencumbered software released into the public domain. | |
| * | |
| * Anyone is free to copy, modify, publish, use, compile, sell, or | |
| * distribute this software, either in source code form or as a compiled | |
| * binary, for any purpose, commercial or non-commercial, and by any | |
| * means. | |
| * |