Skip to content

Instantly share code, notes, and snippets.

View stiplady's full-sized avatar

Simon Tiplady stiplady

View GitHub Profile
curl -X PATCH \
"https://api.cloudflare.com/client/v4/zones/d3f3273f0444537f497bfec8bbcc0cbb/settings/ciphers" \
-H "X-Auth-Email: support@chestersolutions.co.uk" \
-H "X-Auth-Key: 187be354924b45b57035d0b9409b74919df0e" \
-H "Content-Type: application/json" \
--data '{"value": ["ECDHE-ECDSA-AES128-GCM-SHA256", "ECDHE-ECDSA-CHACHA20-POLY1305", "ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-RSA-CHACHA20-POLY1305", "ECDHE-ECDSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-ECDSA-AES128-SHA256", "ECDHE-RSA-AES128-SHA256", "ECDHE-ECDSA-AES256-SHA384", "ECDHE-RSA-AES256-SHA384", "ECDHE-ECDSA-AES128-SHA", "ECDHE-RSA-AES128-SHA", "AES128-GCM-SHA256", "AES128-SHA256", "AES128-SHA", "ECDHE-RSA-AES256-SHA", "AES256-GCM-SHA384", "AES256-SHA256", "AES256-SHA"]}'
int ledPin = 13; // Output connected to digital pin 13
int inPin = 7; // input connected to digital pin 7
int pinState = LOW;
void setup() {
pinMode(ledPin, OUTPUT); // sets the digital pin 13 as output
pinMode(inPin, INPUT); // sets the digital pin 7 as input
digitalWrite(ledPin, LOW);
}
void loop() {
@stiplady
stiplady / ResponsiveVideo.css
Last active February 21, 2020 12:09
Responsive Youtube video iframes
.videoWrapper {
position: relative;
height: 0;
}
.videoWrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
@stiplady
stiplady / gist:fe62aaa6a2e1c9841d05602f34dcf0bb
Last active April 6, 2017 13:58
Git Upgrade from 1.7.1 to 2.12.2
git --version
yum remove git
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
cd /usr/src
wget https://www.kernel.org/pub/software/scm/git/git-2.12.2.tar.gz
tar vxzf git-2.12.2.tar.gz
cd git-2.12.2
make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
@stiplady
stiplady / colorCodes.sh
Created January 19, 2017 09:16
Shows colours for each type of LS_COLORS
#!/bin/bash
# Script to show the colours used for different file types
# This is just a more readable version of the 'eval' code at:
# http://askubuntu.com/a/17300/309899
# A nice description of the colour codes is here:
# http://askubuntu.com/a/466203/309899
@stiplady
stiplady / set-magento-permissions.sh
Last active August 19, 2016 09:19
Script to configure or reset permissions for a Magento installation where the nginx/apache user is different from the FTP user Raw
# Based on the following guide with a few amendments
# http://devdocs.magento.com/guides/m1x/install/installer-privileges_after.html
# Start by setting all files/folders to be owned by the project user
chown -R projectuser:nginx .
# Webserver needs access to these folders for file upload, logging etc
chown -R nginx:nginx var/ media/
# Set read/write/execute permissions for files and folders
# Project user full access and web server read/execute (no write)
@stiplady
stiplady / xss.conf
Created August 3, 2016 09:36
xss.conf
# To be included into httpd.conf using:
# Include conf.d/xss.conf
<Directory ~ "/var/www/*/public_html/">
# Custom rule added by STiplady, Acunetix report scpecifically targets script tags in the request url
# Block out any script that includes a <script> tag in URL.
RewriteCond %{REQUEST_URI} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Following 4 rules are straight from Joomla .htaccess security rules
# Block out any script trying to base64_encode data within the URL.
@stiplady
stiplady / .htaccess
Created February 9, 2014 18:07
Redirect non-www urls to www
# You might not need this line if it already exists in your .htaccess file
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]