MYSQL_ROOT_PASSWORD=whatever
WORDPRESS_DB_USER=root
WORDPRESS_DB_PASSWORD=whatever
#WORDPRESS_HOST=192.168.1.1
#WORDPRESS_DB_HOST=192.168.1.1
This file contains 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
$stepUp: 1.20; | |
$stepDown: 0.90; | |
$fontSizePlus3: #{$stepUp * $stepUp * $stepUp}rem; | |
$fontSizePlus2: #{$stepUp * $stepUp}rem; | |
$fontSizePlus1: #{$stepUp}rem; | |
$fontSize: 1rem; | |
$fontSizeMinus1: #{$stepDown}rem; | |
$fontSizeMinus2: #{$stepDown * $stepDown}rem; | |
$fontSizeMinus3: #{$stepDown * $stepDown * $stepDown}rem; |
This file contains 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
Makefiles -- https://localheinz.com/blog/2018/01/24/makefile-for-lazy-developers/ |
This file contains 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
# Setting up certbot and autorenewal on Apache | |
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt | |
cd /opt/letsencrypt | |
sudo -H ./letsencrypt-auto certonly --standalone -d example.com -d www.example.com | |
echo '@monthly root /opt/letsencrypt/letsencrypt-auto certonly --quiet --standalone --renew-by-default -d example.com -d www.example.com >> /var/log/letsencrypt/letsencrypt-auto-update.log' | sudo tee --append /etc/crontab | |
# Add cerificates and redirect to Apache conf | |
sudo vim /etc/apache2/sites-enabled/example.com # With: | |
<VirtualHost *:80> |
This file contains 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
<?php | |
function remaining(\Generator $gen) | |
{ | |
yield from $gen; | |
} | |
function readCsv($source) | |
{ | |
if (($handle = fopen($source, "r")) !== FALSE) { |
This file contains 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
<?php | |
require_once 'vendor/autoload.php'; | |
use Symfony\Component\Console\Helper\Table; | |
use Symfony\Component\Console\Output\ConsoleOutput; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Silex\Application; | |
/** |
This file contains 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 | |
# For greatest convenience | |
alias dc='docker-compose' | |
# Clean up unused containers and images | |
alias dclean='docker rm $(docker ps -qf "status=exited")' | |
alias dclean_images='docker rmi $(docker images -qf "dangling=true")' | |
# Assume dockerized $nginx and $mysql containers... |
This file contains 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
# Proper tree view of directories (Bash) | |
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' | |
# Database table sizes (MySQL, MB) | |
SELECT SUM(data_length / (1024 * 1024)), table_schema, table_name Data_MB FROM information_schema.tables WHERE table_schema NOT IN ('information_schema','performance_schema','mysql') GROUP BY table_schema, table_name; |
This file contains 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
<?php | |
// When doctrine/orm 2.4 reverse-engineers a MySQL DB, it doesn't make the index names globally unique. | |
// This is a one-off hack script to fix up unique index names if theer are too many .orm.yml files to fix easily by hand. | |
// USAGE: | |
// for f in $(ls -1 ./src/Whatever/Bundle/WhateverBundle/Resources/config/doctrine/*.orm.yml); do \ | |
// php fix-yml.php $f > "${f/doctrine/doctrine-fix}"; \ | |
// done |
NewerOlder