Skip to content

Instantly share code, notes, and snippets.

@cleot
cleot / letsencrypt-nginx-vhost-exception.txt
Last active July 25, 2016 10:50
Letsencrypt nginx vhost webroot exception (eg. reverse proxy)
location ~ /.well-known {
}
@cleot
cleot / rsync-passwordless.sh
Last active August 4, 2016 13:03
rsync passwordless
rsync --progress -chavzP -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" [email protected]:/path/ /path/to/storage
@cleot
cleot / nginx-vhost-letsencrypt-ocsp.conf
Created September 3, 2016 17:43
nginx ssl vHost + Letsencrypt OCSP Stapling
server {
listen 443 ssl http2;
ssl on;
#listen [::]:443 ssl http2;
server_name example.com;
keepalive_timeout 300;
# Letsencrypt
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
@cleot
cleot / nginx-letsencrypt-vhost.conf
Created September 4, 2016 14:05
nginx vhost - letsencrypt
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com *.example.com;
include global/letsencrypt-redirect.conf;
}
server {
listen 443 ssl http2;
@cleot
cleot / letsencrypt-redirect.conf
Created September 4, 2016 14:07
letsencrypt acme challange + host https redirect
location /.well-known/acme-challenge {
default_type "text/plain";
root /var/www/letsencrypt;
}
location / {
return 301 https://$server_name$request_uri;
}
@cleot
cleot / backup_html.sh
Created September 4, 2016 14:14
Backup Script HTML
#!/bin/bash
#cron 0 3 * * * /usr/bin/nice -n 10 /var/backup/backup_html.sh; /usr/bin/nice -n 10 /var/backup/backup_sql.sh
# settings
BACKUP_DIR="/var/backup/html"
DATE=`date +"%Y-%m-%d_%H:00"`
HOUR=`date +"%H"`
cd "/var/www"
@cleot
cleot / backup_sql.sh
Created September 4, 2016 14:17
Backup Script MySQL
#!/bin/bash
#cron 0 3 * * * /usr/bin/nice -n 10 /var/backup/backup_html.sh; /usr/bin/nice -n 10 /var/backup/backup_sql.sh
# settings
MYSQL_USER="backupuser"
MYSQL_PASSWORD=""
BACKUP_DIR="/var/backup/sql"
DATE=`date +"%Y-%m-%d_%H:00"`
HOUR=`date +"%H"`
@cleot
cleot / keybase.md
Created May 11, 2017 21:17
Keybase

Keybase proof

I hereby claim:

  • I am cleot on github.
  • I am cpo (https://keybase.io/cpo) on keybase.
  • I have a public key ASB3DPNbVbNLxUHGlCw_YCrebOlw3_ic7KDStzYSBeMlOAo

To claim this, I am signing this object:

pragma solidity 0.4.24;
import "https://github.com/smartcontractkit/chainlink/evm/contracts/ChainlinkClient.sol";
import "https://github.com/smartcontractkit/chainlink/evm/contracts/vendor/Ownable.sol";
contract ATestnetConsumer is ChainlinkClient, Ownable {
uint256 constant private ORACLE_PAYMENT = 1 * LINK;
uint256 public currentPrice;
int256 public changeDay;
@cleot
cleot / disable_recaptcha-wpcf7.php
Last active April 10, 2021 19:34
Disable reCaptcha Badge & Plugin for all pages except for pages with contact forms (Wordpress, Contact Form 7, Google reCAPTCHA v3)
add_action( 'wp_enqueue_scripts', 'gbol_remove_wpcf7_resources_if_no_contact_form', 1 );
function gbol_remove_wpcf7_resources_if_no_contact_form() {
global $post, $gbol_css_dependencies, $abcf7;
if ( isset( $post ) && is_singular() && has_shortcode( $post->post_content, 'contact-form-7' ) ) {
return;
}
add_filter( 'wpcf7_load_js', '__return_false' );
add_filter( 'wpcf7_load_css', '__return_false' );