<commit_before>#!/bin/sh

# Local dev environment setup for OSX Yosemite (basically MAMP without MAMP)

# Inspired by:
# echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew

# Description:
# This sets up Apache to run on boot on ports 8080 and 8443 with auto-VirtualHosts for directories in the ~/Sites folder and
# PHP-FPM via mod_fastcgi. The OSX firewall will forward all port 80 traffic to port 8080 and port 443 to port 8443, so 
# we don't have specify the port number when visiting web pages in local web browsers or run Apache as root. MySQL is 
# installed and set to run on boot as well. DNSMasq and some OSX configuration is used to direct any hostname ending in 
# .dev to the local system to work in conjunction with Apache's auto-VirtualHosts.

# Use Homebrew services
brew tap homebrew/services

# Install MySQL
echo 'Installing MySQL'
brew install mysql

echo 'Configuring MySQL...'

# Copy the default my-default.cnf file to the MySQL Homebrew Cellar directory where it will be loaded on application start:
cp -v $(brew --prefix mysql)/support-files/my-default.cnf $(brew --prefix)/etc/my.cnf

# Configure MySQL to allow for the maximum packet size (local dev only).
# Also keep each InnoDB table in separate files to keep ibdataN-type file sizes low and make file-based backups easier to manage.
cat >> $(brew --prefix)/etc/my.cnf <<'EOF'
 
# Modifications for local dev environment
max_allowed_packet = 1073741824
innodb_file_per_table = 1
EOF

# Uncomment the sample option for innodb_buffer_pool_size to improve performance:<commit_msg>Update MySQL error log names<commit_after>#!/bin/sh

# Local dev environment setup for OSX Yosemite (basically MAMP without MAMP)

# Inspired by:
# echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew

# Description:
# This sets up Apache to run on boot on ports 8080 and 8443 with auto-VirtualHosts for directories in the ~/Sites folder and
# PHP-FPM via mod_fastcgi. The OSX firewall will forward all port 80 traffic to port 8080 and port 443 to port 8443, so 
# we don't have specify the port number when visiting web pages in local web browsers or run Apache as root. MySQL is 
# installed and set to run on boot as well. DNSMasq and some OSX configuration is used to direct any hostname ending in 
# .dev to the local system to work in conjunction with Apache's auto-VirtualHosts.

# Use Homebrew services
brew tap homebrew/services

# Install MySQL
echo 'Installing MySQL'
brew install mysql

echo 'Configuring MySQL...'

# Copy the default my-default.cnf file to the MySQL Homebrew Cellar directory where it will be loaded on application start:
cp -v $(brew --prefix mysql)/support-files/my-default.cnf $(brew --prefix)/etc/my.cnf

# Configure MySQL to allow for the maximum packet size (local dev only).
# Also keep each InnoDB table in separate files to keep ibdataN-type file sizes low and make file-based backups easier to manage.
cat >> $(brew --prefix)/etc/my.cnf <<'EOF'
 
# Modifications for local dev environment
max_allowed_packet = 1073741824
innodb_file_per_table = 1
log = ~/Sites/logs/mysqld.log
log-error = ~/Sites/logs/mysqld.error.log
EOF

# Uncomment the sample option for innodb_buffer_pool_size to improve performance:
{'fraction_non_alphanumeric': 0.06949100883876867, 'fraction_numerical': 0.02194452910697958, 'mean_word_length': 4.285024154589372, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '566963', 'n_tokens_mistral': 1040, 'n_tokens_neox': 944, 'n_words': 437}