Skip to content

Instantly share code, notes, and snippets.

View PLaRoche's full-sized avatar

Patrick LaRoche PLaRoche

View GitHub Profile
def send_sms(command):
data = command.split(" ", 2) # maxsplit
pytill.send_message([data[1]], data[2])
response = "Text sent to {}".format(data[1])
return response
@PLaRoche
PLaRoche / send_sms_question.py
Created September 11, 2018 17:09
send_sms_question
def send_sms_question(command, channel):
data = command.split(" ", 2) # maxsplit
question = pytill.make_question(data[2], channel, PUBLIC_ADDR + WEBHOOK_ADDR)
pytill.send_question([data[1]], [question], "{}-tag".format(data[2]))
response = "Question sent to {} listening for answers...".format(data[1])
return response
@PLaRoche
PLaRoche / web-service.yaml
Created June 5, 2018 14:40
sample k8s service
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
io.kompose.service: web
randomlabel : website
name: web
spec:
ports:
@PLaRoche
PLaRoche / web-deployment.yaml
Created June 5, 2018 14:38
sample k8s deployment
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
io.kompose.service: web
randomlabel : website
name: web
spec:
replicas: 1
strategy: {}
# Add to your bashrc or equivalent
# kcdr will force reload a deployment by re-annotating the metadata with the
# current timestamp.
function kcdr {
kubectl patch deployment $@ -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
}
@PLaRoche
PLaRoche / manifold.php
Last active December 13, 2017 20:35
Manifold.php for JawsDB Mysql
<?php
return [
'token' => env('MANIFOLD_API_TOKEN', null),
'resource_id' => env('MANIFOLD_RESOURCE_ID', null),
'project' => env('MANIFOLD_PROJECT', null),
'product' => env('MANIFOLD_PRODUCT', null),
'aliases' => [
'database' => [
'connections' => [
@PLaRoche
PLaRoche / post-receive-hook.sh
Created June 1, 2016 23:28
new laravel post receive hook with gulp, etc in it
#!/bin/sh
# from - See more at:
# http://www.codyjbutz.com/blog/deploying-laravel-5-using-git-hooks#sthash.6YmBWVjW.dpuf
WEBDIRECTORY=/var/www/simplecourt.com
GITDIRECTORY=/home/deployer/repos/simplecourt.git
USER=deployer
GROUP=www-data
#set HOME so that git uses the correct ~/.git/ folder
@PLaRoche
PLaRoche / git_push.sh
Created June 1, 2016 23:26
git shell push script
#!/bin/bash
# Deploy to via pushing to a remote git repository.
#
# Add the following environment variables to your project configuration and make
# sure the public SSH key from your projects General settings page is allowed to
# push to the remote repository as well.
# * REMOTE_REPOSITORY, e.g. "git@github.com:codeship/documentation.git"
# * REMOTE_BRANCH, e.g. "production"
#
#
@PLaRoche
PLaRoche / howto_laravel_gitVersion_footer_codeship.md
Created February 17, 2016 01:30
codeship git versions in footer (laravel)
@PLaRoche
PLaRoche / post-receive
Last active January 19, 2016 12:39
git post receive hook for a laravel app
#!/usr/bin/env ruby
# post-receive
#From: http://krisjordan.com/essays/setting-up-push-to-deploy-with-git
# NOTE: if you have a sudo requires tty you have to change the require tty line in your sudeors file
# Make sure you can write to the dir:
`sudo chown -R ec2-user:ec2-user /var/app/current`