Skip to content

Instantly share code, notes, and snippets.

@da-n
da-n / phpunit.xml
Created September 21, 2016 08:23
PHPUnit exclude files/directories
<?xml version="1.0" encoding="utf-8"?>
<phpunit>
<filter>
<whitelist>
<directory suffix=".php">../</directory>
<exclude>
<file>../ext_emconf.php</file>
<directory suffix=".php">../tests</directory>
</exclude>
</whitelist>
@da-n
da-n / phpunit_exception.php
Created September 20, 2016 22:50
Set PHPUnit to expect an exception
$this->setExpectedException('Exception');
atom-sync-settings
@da-n
da-n / composer.sh
Created September 19, 2016 20:09
Composer require PHPunit global
composer global require phpunit/phpunit:4.8.27
@da-n
da-n / exit_ssh.md
Last active September 19, 2016 18:06
Force exit a frozen SSH seesion

Enter ~ .

@da-n
da-n / gist:2da4f541970d83592e4b4f66f5d3abd0
Created September 16, 2016 04:29
Letsencrypt dhparam generate
$ cd /etc/ssl/certs/
$ sudo openssl dhparam -out dhparam.pem 4096
@da-n
da-n / cli-renew.ini
Created September 16, 2016 04:24
Letsencrypt ini auto-renew config
# This script should be saved in ubuntu home folder and used in combination with
# a cron job running the following command (requires certbot-auto to be present
# in ubuntu user home directory)
#
# /home/ubuntu/certbot-auto renew --standalone --config /home/ubuntu/cli-renew.ini --quiet --pre-hook "service nginx stop" --post-hook "service nginx start"
# Use a 4096 bit RSA key instead of 2048
# rsa-key-size = 4096
# Uncomment and update to register with the specified e-mail address
@da-n
da-n / gist:8e94b1d5560913485ccfd78927038291
Created September 16, 2016 04:22
Letsencrypt cert auto renew crontab -e 16.04
0 15 * * 4 /home/ubuntu/cli-renew.sh > /home/ubuntu/cli-renew.log 2>&1
@da-n
da-n / cli-renew.sh
Created September 16, 2016 04:19
Renew certs letsencrypt 16.04
#/bin/sh
echo "Running certbot-auto renew script"
date
echo
/home/ubuntu/certbot-auto renew --no-self-upgrade --standalone --pre-hook "service nginx stop" --post-hook "service nginx start"
@da-n
da-n / gist:c90ef4ae00a3fd5f4848803e2d988e13
Created September 16, 2016 04:17
Generate new cert letsencrypt 16.04
./certbot-auto --text certonly --standalone -d bitmono.com --email mail@bitmono.com