Skip to content

Instantly share code, notes, and snippets.

View pawelnapierala's full-sized avatar

Paweł Napierała pawelnapierala

  • Szczecin
View GitHub Profile
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# 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
@thonixx
thonixx / test-memory-limit.php
Created August 25, 2013 15:54
Test PHPs memory limit
<pre>
<?php
$megabyte = 1528; // define the max megabytes which should be tested
function tryAlloc($megabyte){
echo "try allocating {$megabyte} megabyte...";
$mb = $megabyte;
$dummy = str_repeat("-",1048576*$mb);
echo "pass.";
echo "Usage: " . memory_get_usage(true)/1048576;