Skip to content

Instantly share code, notes, and snippets.

View shirone's full-sized avatar

Shirone Windragoon shirone

View GitHub Profile
@shirone
shirone / README.md
Created April 7, 2017 13:43 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@shirone
shirone / devops_training.txt
Created June 21, 2016 04:01 — forked from ssmythe/devops_training.txt
Training materials for DevOps
======
Videos
======
DevOps
What is DevOps? by Rackspace - Really great introduction to DevOps
https://www.youtube.com/watch?v=_I94-tJlovg
Sanjeev Sharma series on DevOps (great repetition to really get the DevOps concept)
@shirone
shirone / .htaccess
Created March 23, 2016 04:02 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@shirone
shirone / mysql.sublime-build
Created January 25, 2016 08:53 — forked from arsham/mysql.sublime-build
Sublime Text 2/3 mysql build system. Change USERNAME, PASSWORD, DATABASE and the output file to your needs. Note: on cmd line, change "subl3" to proper application name.
{
"cmd": ["mysql -u USERNAME -pPASSWORD DATABASE -t < $file >> /tmp/output.sql ; subl3 /tmp/output.sql"],
"selector": "source.sql",
"shell" : true
}
@shirone
shirone / README.md
Created January 15, 2016 23:39 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@shirone
shirone / version.sh
Created January 15, 2016 23:38 — forked from oodavid/version.sh
Git > Get changes in VERSION for tagging purposes
# Search common.php for changes in the VERSION
# Note - won't follow line changes, it always looks at line 11...
git log --all --format=format:%H -G'\$VERSION' common.php | xargs -L 1 git blame common.php -L 11,11 > ~/versions.txt
@shirone
shirone / ssl-letsencrypt-auto-renew.sh
Created January 15, 2016 23:38 — forked from oodavid/ssl-letsencrypt-auto-renew.sh
Automatically renew letsencrypt SSL certificates via cron.
#!/bin/bash
# Source
# https://gist.github.com/oodavid/54cadfb92ff49618797d
# Adapted from
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04
# Make sure this is added to the crontab, ie:
# sudo crontab -e
# 30 2 * * 1 /home/ubuntu/khan-draw/ssl-letsencrypt-auto-renew.sh >> /var/log/ssl-letsencrypt-auto-renew.log
# Config
@shirone
shirone / git-php-webhook.php
Created January 14, 2016 04:42 — forked from marcelosomers/git-php-webhook.php
A basic webhook for deploying updates to repos on Github to your local server
<?php
/**
* This script is for easily deploying updates to Github repos to your local server. It will automatically git clone or
* git pull in your repo directory every time an update is pushed to your $BRANCH (configured below).
*
* Read more about how to use this script at http://behindcompanies.com/2014/01/a-simple-script-for-deploying-code-with-githubs-webhooks/
*
* INSTRUCTIONS:
* 1. Edit the variables below
* 2. Upload this script to your server somewhere it can be publicly accessed
@shirone
shirone / instagram.php
Created November 19, 2015 16:02 — forked from maxparm/instagram.php
PHP - Request Instagram api with PHP/Curl
<?php
//Get data from instagram api
$hashtag = 'max';
//Query need client_id or access_token
$query = array(
'client_id' => '',
'count' => 3
);
$url = 'https://api.instagram.com/v1/tags/'.$hashtag.'/media/recent?'.http_build_query($query);
@shirone
shirone / Sublime Text License Key.md
Created November 11, 2015 03:03
Sublime Text 2 License Key, Sublime Text 3 License Key, Sublime Text Full Version.

Sublime Text 2 & 3 License Key, Sublime Text Full Version

Sublime Text License Key

How to activate license key

  1. Go to menu Help > Enter License.
  2. Copy the license key below and paste it into the textbox > Click the Use License button.
  3. Enjoy! 👍