Skip to content

Instantly share code, notes, and snippets.

View mrchrisadams's full-sized avatar

Chris Adams mrchrisadams

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mrchrisadams on github.
  • I am mrchrisadams (https://keybase.io/mrchrisadams) on keybase.
  • I have a public key whose fingerprint is 955D 2C58 DA80 1520 A74B 6AF6 EFA0 48A3 282F 79EB

To claim this, I am signing this object:

@mrchrisadams
mrchrisadams / things.we.need.md
Last active August 29, 2015 14:00
A list of things we need to get another instance of the amee platform up online

Hi guys,

This weekend, I tried to get a version of the amee platform running locally, and spent a bit of time looking through the code, and trying to understand what it would take to get it running on new infrastructure.

As such, I'm sharing this summary of what shape the various bits are in.

Can you chime in where this summary needs any corrections?

Running the API servers themselves

@mrchrisadams
mrchrisadams / archive.php
Created June 5, 2014 14:35
strange wordpress routing behaviour
<?php
// ""?tag=keyword" will show postd matching a keyword,
// but "?m=2013" shows all posts, with no critera
// any ideas?
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<!-- show posts -->
<?php endwhile; ?>
@mrchrisadams
mrchrisadams / aws--to-gq-s3.diff
Created August 10, 2014 20:48
How to use s3cmd with Greenqloud instead of AWS
3,5c3
< bucket_location = US
< cloudfront_host = cloudfront.amazonaws.com
< cloudfront_resource = /2010-07-15/distribution
---
> bucket_location = IS
17d14
< gpg_passphrase =
19,20c16,17
< host_base = s3.amazonaws.com
@mrchrisadams
mrchrisadams / readme.md
Last active August 29, 2015 14:05
Can you travel on Deutsche Bahn trains without needing to print the tickets on paper?

I travel a lot by train these days in Europe, and I'd prefer to avoid printing tickets onto paper if I can.

Instead, I tend to have the PDF of the ticket on an iPad, and show that to the train attendant, for them to scan with their barcode scanning contraption.

I've used thissuccessfully going both ways now, but I get some funny looks from some train staff, and I want to be able to point to the terms of service to show this is all above board.

Sadly, my German is embarassingly bad at the moment, so I'm unable to decipher the terms of service myself. I think I can, but I'd rather have some confirmation from another human.

Here's the link to what I think are Deutche Bahn's terms of service for using these PDF tickets:

lovely_client_project
├── Vagrantfile
├── cruft
│   ├── db.dump.sql
│   └── todo.txt
├── docs
│   ├── architecture.md
│   ├── deployment.md
│   ├── gocardless.md
│   ├── installation.md
@mrchrisadams
mrchrisadams / gist:f75f18e0985ea808b4c4
Last active August 29, 2015 14:06
How do I avoid long lines like this in an ansible inventory, for inventory specific values?
# Generated by Vagrant
# loooong line
main ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key host_key_checking=False
[dev]
main
@mrchrisadams
mrchrisadams / slack.notification.py
Last active August 29, 2015 14:09
It turns out sending notifications to slack trivial to do. This pleases me
import requests
import json
payload = {'text': "Chris messing about with slack's API" }
jp = json.dumps(payload)
requests.post('https://hooks.slack.com/services/GARBLEDSTRING1/GARBLEDSTRING1/GARBLEDSTRING1',
data=payload)
---
env: production
vagrant: false
staging: false
debug: False
git_branch:master
deploy_user_name: deploy
deploy_user_ssh_priv_key_path: "files/deploy.key.pem"
application_name:
contact_us_emails: (sensitive)
@mrchrisadams
mrchrisadams / import_with_s3.yml
Created January 3, 2015 11:33
why wouldn't the file specificed by `creates` be created when the command runs successfully?
---
- name: run aws-cli script to fetch csv file
command: /home/{{ deploy_user }}/env/{{ app }}/bin/aws s3 cp {{ s3_download_path }} {{ csv_import_location }}
args:
creates: /var/www/my_app/data_imports/{{ csv_to_fetch }}.downloaded.txt
# async: 1800
# poll: 10
sudo: no