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 -e | |
### Copyright 1999-2015. Parallels IP Holdings GmbH. All Rights Reserved. | |
### Secure plesk clean installation with hostname certificate by Let's Encrypt | |
export PYTHONWARNINGS="ignore:Non-standard path" | |
LE_HOME=${LE_HOME:-"/usr/local/psa/var/modules/letsencrypt"} | |
HOSTNAME=$(hostname) | |
# Use staging server for testing | |
# --server https://acme-staging.api.letsencrypt.org/directory |
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
dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'(uname -r)'/q;p' | xargs sudo apt-get -y purge |
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 | |
TIMESTAMP=$(date +'%Y-%m-%d_%Hh%Mm') | |
BACKUP_FOLDER=/mnt/backup/mysql | |
MYSQL_USER=admin | |
MYSQL_PASS=`cat /etc/psa/.psa.shadow` | |
MAX_DAYS=15 | |
DATABASES=`mysql --user=$MYSQL_USER -p$MYSQL_PASS -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema|performance_schema)"` | |
mkdir -p "$BACKUP_FOLDER" |
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 | |
/* | |
************************************************************************* | |
* * | |
* WHMCS - The Complete Client Management, Billing & Support Solution * | |
* Copyright (c) WHMCS Ltd. All Rights Reserved, * | |
* Release Date: 24th November 2011 * | |
* Version 5.0 * | |
* * | |
************************************************************************* |
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/sh | |
MAIL_BIN=`command -v mail` | |
QUEUE_SIZE=`/usr/sbin/postqueue -p | tail -n1 | awk '{print $5}'` | |
QUEUE_SUMMARY=`/usr/sbin/qshape -s deferred | head` | |
MAILTO="[email protected]" | |
LIMIT=100 | |
function send_notification_mail() { | |
echo $QUEUE_SUMMARY | $MAIL_BIN -s "WARNING: mail queue critical on $HOSTNAME" $MAILTO |
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
SELECT domains.name as domain, Templates.name as plan, domains.status, clients.type, clients.login, clients.pname, clients.email, clients.external_id, Subscriptions.locked, Subscriptions.synchronized, Subscriptions.custom | |
FROM domains | |
LEFT JOIN clients ON domains.cl_id = clients.id | |
LEFT JOIN Subscriptions ON domains.id = Subscriptions.object_id AND Subscriptions.object_type = 'domain' | |
LEFT JOIN PlansSubscriptions ON Subscriptions.id = PlansSubscriptions.subscription_id | |
LEFT JOIN Templates ON PlansSubscriptions.plan_id = Templates.id | |
WHERE clients.type = 'client' | |
AND clients.parent_id = '1' | |
AND domains.parentDomainId = '0' | |
INTO OUTFILE '/tmp/domains-client.csv'; |
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 | |
#ioncube php 5.4 64bit for ubuntu | |
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz | |
tar xvfz ioncube_loaders_lin_x86-64.tar.gz | |
sudo mkdir /usr/lib/php5/modules/ | |
sudo cp ioncube/ioncube_loader_lin_5.4.so /usr/lib/php5/modules/ | |
sudo touch /etc/php5/mods-available/ioncube.ini | |
echo "zend_extension=/usr/lib/php5/modules/ioncube_loader_lin_5.4.so" | sudo tee /etc/php5/mods-available/ioncube.ini | |
sudo php5enmod ioncube |
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
#find . -type f -name '*.png' -exec optipng -o5 -quiet -preserve {} \; | |
#find . -type f -name '*.jp*' -exec mogrify -compress jpeg -quality 70 {} \; | |
find . -type f -iname "*.jp*g" | xargs mogrify -resize '1280x1280>' | |
find . -type f -iname "*.jp*g" | xargs jpegoptim --strip-all --max=90 | |
# With parallel | |
find . -type f -iname "*.jp*g" -print0 | parallel --progress -0 -j +0 "mogrify -resize 1280x1280\> {}" | |
find . -type f -iname "*.jp*g" | parallel --progress "jpegoptim --strip-all --max=65 {}" |
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 | |
/** | |
* Twitter API search images | |
* | |
* @author Alexander Garzon <http://about.me/agarzon> | |
* @license MIT License | |
* @require http://github.com/j7mbo/twitter-api-php | |
*/ | |
//header('Access-Control-Allow-Origin: *'); |
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 | |
namespace Codeception\Module; | |
class CakePHPHelper extends \Codeception\Module | |
{ | |
public function __construct() | |
{ | |
define('APP_DIR', 'app'); | |
define('DS', DIRECTORY_SEPARATOR); | |
define('ROOT', getcwd()); |