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 | |
# This script installs PhantomJS on your Debian/Ubuntu System | |
# | |
# Taken from https://gist.github.com/julionc/7476620#gistcomment-2030572 and changed the download directory | |
# | |
# This script must be run as root: | |
# sudo sh install_phantomjs.sh | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 |
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
public function domPost($content) | |
{ | |
libxml_use_internal_errors(true); | |
$dom = new \DomDocument(); | |
$dom->loadHtml('<?xml encoding="utf-8" ?>'.$content); // must include this to avoid font problem | |
$images = $dom->getElementsByTagName('img'); | |
if(count($images)>0) | |
{ | |
foreach($images as $k => $img) | |
{ |
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
# 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 | |