Skip to content

Instantly share code, notes, and snippets.

View da-n's full-sized avatar

Daniel Davidson da-n

  • AJ Bell
  • Bath, UK
View GitHub Profile
@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 [email protected]
@da-n
da-n / lidclose.service
Last active July 16, 2016 09:43
i3 lock for suspension
[Unit]
Description=i3 lock for suspension
[Service]
User=dan
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/i3lock -p win -d -c 000000
[Install]