Install (run) a MySQL image that will work:
docker run -p 3306:3306 --name mysql-server -e MYSQL_ROOT_PASSWORD=password -d mysql:5.7
Connect using bash and create a database:
docker exec -it mysql-server bash
mysql -uroot -ppassword
| # Define the path to the VHDX file | |
| $vdiskPath = "C:\Users\azks430\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc\LocalState\ext4.vhdx" | |
| Write-Host "Shutting down WSL..." | |
| wsl --shutdown | |
| # Wait until the VHDX file is no longer in use | |
| Write-Host "Waiting for VHD to be released..." | |
| $timeout = 30 # maximum wait time in seconds | |
| $start = Get-Date |
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| # for examples | |
| # If not running interactively, don't do anything | |
| case $- in | |
| *i*) ;; | |
| *) return;; | |
| esac |
| {% macro print_primitive_values(data) %} | |
| {% if data is mapping %} | |
| {% for key, value in data.items() %} | |
| {% if value is mapping or value is iterable %} | |
| <strong>{{ key }}</strong>: {{ print_primitive_values(value) }} | |
| {% else %} | |
| <strong>{{ key }}</strong>: {{ value }} | |
| {% endif %} | |
| {% endfor %} | |
| {% elif data is iterable and data is not string %} |
| // Mathematics. The problem of Hannibal's organs | |
| // https://twitter.com/pickover/status/1618030222246580224 | |
| let JAR = [] | |
| let BRAIN = 0 | |
| let KIDNEY = 1 | |
| // Random add a brain or a kidney | |
| function init() { | |
| JAR = [] |
| # This works with e.g. python 3.7 | |
| wget https://github.com/pypa/virtualenv/archive/refs/tags/16.7.10.tar.gz -O virtualenv-16.7.10.tar.gz | |
| tar xvfz virtualenv-16.7.10.tar.gz | |
| rm virtualenv-16.7.10.tar.gz | |
| mv virtualenv-16.7.10 ~/.virtualenv | |
| echo >> ~/.bashrc | |
| echo "alias virtualenv='python $HOME/.virtualenv/virtualenv.py'" >> ~/.bashrc | |
| echo 'Now run: source ~/.bashrc' |
| <?php | |
| // Read database configuration | |
| include_once "wp-config.php"; | |
| // Default database | |
| // $database = $databases['default']['default']; | |
| $database['host'] = DB_HOST; | |
| $database['user'] = DB_USER; | |
| $database['pass'] = DB_PASSWORD; |
| <?php | |
| /** | |
| * Druapl 7 backup if you don't have SSH access but you can use mysqldump and tar | |
| * Put this in the sites root folder and visit the script through a browser | |
| * | |
| * Fetch asdqwe-backup.sql from the server | |
| * Fetch asdqwe-backup.tar.gz from the server | |
| */ |
| #!/bin/sh | |
| # This installs when allow_url_fopen is Off (in most cases) | |
| EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig) | |
| php -d allow_url_fopen=1 -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
| ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") | |
| if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] |
| <?php | |
| /** | |
| * Takes the input file element name, e.g. `$files = rearrange_files($_FILES['files']);` | |
| * If you have a file input like this `<input type="file" name="files[]" multiple >` | |
| * Will return an array where each element is a single file. Much more convenient thant | |
| * Using the PHP $_FILES array | |
| */ | |
| function rearrange_files($file_post) { |