This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Requirements: | |
| * A Wordpress Blog | |
| * Python Packages: Markdown, PyYAML, python-wordpress-xmlrpc | |
| >>> pip install Markdown python-wordpress-xmlrpc PyYAML | |
| WARNING: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Description: | |
| # Positive plugin, it just anwsers you "超充實der!" | |
| # | |
| module.exports = (robot) -> | |
| robot.respond /今天.*|How's going/i, (msg) -> | |
| msg.send "超充實der!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Description: | |
| # Messing around with the curator.im API. | |
| # | |
| # Commands: | |
| # hubot curator - give you random girl photo from curator.im | |
| module.exports = (robot) -> | |
| robot.respond /(curator|girl)/i, (msg) -> | |
| msg.http("http://curator.im/api/stream/") | |
| .query({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Delete S3 bucket with contents, with S3 Multi-Object Delete. | |
| This script makes you delete S3 bucket quickly. | |
| Before using this script, please install boto | |
| $ pip install boto | |
| and setup ~/.boto config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """ | |
| This script can retrieve pageviews count by month and export to a CSV file | |
| Usage: | |
| >> python pv.py 2013 <input.csv> <output-csv> | |
| """ | |
| import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Requirements: | |
| * A Wordpress Blog | |
| * Ghost export file (json). | |
| * Python Packages: python-wordpress-xmlrpc | |
| >>> pip install python-wordpress-xmlrpc | |
| WARNING: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| export MYSQL_HOST=<your-mysql-host> | |
| export MYSQL_USER=<your-mysql-username> | |
| export MYSQL_PASSWORD=<your-mysql-password> | |
| export NAME=<name-of-backup> | |
| export DATE=`date +"%Y%m%d"` | |
| export BACKUP_FILE=$NAME.$DATE.sql.gz | |
| export DATABASE_SCHEMA_NAME=<database-name> | |
| export S3_BUCKET=<s3-bucket-name> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os.path | |
| from fabric.api import run, env, put | |
| from fabric.context_managers import cd | |
| from fabric.api import local | |
| from datetime import datetime | |
| from cuisine import * | |
| ROOT_PATH = os.path.dirname(__file__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Find line 386, in amazon-s3-and-cloudfront/classes/amazon-s3-and-cloudfront.php | |
| $s3client = $this->get_s3client( $region ); | |
| // Add this line below | |
| $s3client->setRegion('ap-northeast-1'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| location ~ ^/(.*)$ { | |
| resolver 8.8.8.8 valid=300s; | |
| resolver_timeout 10s; | |
| set $s3_bucket '<bucket-name>.com.s3.amazonaws.com'; | |
| set $url_full '$1'; | |
| proxy_pass http://$s3_bucket/$url_full; | |
| proxy_buffering off; | |
| proxy_set_header Host $s3_bucket; |