The following scripts assist in purging and stopping the build up of binary logs by MySQL see http://technology.blue-bag.com/binary-logs-are-filling-my-mac-help
This file contains hidden or 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
| server { | |
| server_name example.com; | |
| root /var/www/drupal8; ## <-- Your only path reference. | |
| location = /favicon.ico { | |
| log_not_found off; | |
| access_log off; | |
| } | |
| location = /robots.txt { |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # If the file has already been modified don't try and modify it again | |
| if grep -Fq "slack-night-mode" /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js; then | |
| /usr/bin/osascript <<EOA | |
| tell app "System Events" | |
| display notification "Dark Mode enabled previously.\rYou have made your choice to forsake the Light Mode." with title "Slack Dark Mode" | |
| end tell | |
| EOA | |
| exit 0; |
This file contains hidden or 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 -e | |
| # Delete all stopped containers (including data-only containers). | |
| docker ps -a -q --no-trunc --filter "status=exited" | xargs --no-run-if-empty docker rm -v | |
| # Delete all tagged images more than a month old | |
| # (will fail to remove images still used). | |
| docker images --no-trunc --format '{{.ID}} {{.CreatedSince}}' | grep ' months' | awk '{ print $1 }' | xargs --no-run-if-empty docker rmi || true | |
| # Delete all 'untagged/dangling' (<none>) images |
This file contains hidden or 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/bash | |
| # bash generate random alphanumeric string | |
| # | |
| # bash generate random 32 character alphanumeric string (upper and lowercase) and | |
| NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
| # bash generate random 32 character alphanumeric string (lowercase only) | |
| cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
This file contains hidden or 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
| # <type>(<scope>): <subject> | |
| #|<---- Using a Maximum Of 50 Characters ---->| | |
| # <body> | |
| #|<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->| | |
| # <footer> | |
| # Example: Closes #23 | |
| # --- COMMIT END --- |
This file contains hidden or 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
| mysql -u root | |
| SELECT PASSWORD('MYFANCYPASSWORD') | |
| copy the output hash * and all. | |
| CREATE USER 'myfancyusername'@'%' IDENTIFIED BY PASSWORD '*HASH'; | |
| GRANT ALL PRIVILEGES ON *.* TO 'myfancyusername'@'%' WITH GRANT OPTION; |
This file contains hidden or 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
| // This will redirect the page on form load to: $base_url/node?search=FOO&reset | |
| $form_state['redirect'] = array( | |
| 'node', | |
| array( | |
| 'query' => array( | |
| // adds to url: ?search=FOO | |
| 'search' => $var, | |
| // adds to url: &reset | |
| 'reset' => NULL, | |
| ), |
This file contains hidden or 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/bash | |
| # Help menu | |
| print_help() { | |
| cat <<-HELP | |
| This script is used to fix permissions of a Drupal installation | |
| you need to provide the following arguments: | |
| 1) Path to your Drupal installation. | |
| 2) Username of the user that you want to give files/directories ownership. |
This file contains hidden or 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
| find ~ -type d -name .git -exec dirname {} \; | tr '\n' '\000' | xargs -0 -n1 -I % git -C "%" status |