Skip to content

Instantly share code, notes, and snippets.

import dropbox
class dropbox_monitor(NebriOS):
#Hourly cron for now, still poking at drips
schedule = "0 * * * *"
#The script is started by setting "dropbox_monitor_go to true as you suggested which starts the flow, the "code" is to restart the script when the confirmation code is enterd via an email form""
listens_to = ["dropbox_monitor_go", "code"]
#class attributes
app_key = 'APP_KEY'
app_secret = 'APP_SECRET'
root@ip-172-1-1-142:~# calicoctl bgp peer show
No global IPv4 BGP Peers defined.
No global IPv6 BGP Peers defined.
@jonathan-kosgei
jonathan-kosgei / terraform-bestpractices
Created June 21, 2016 18:08
Terraform Best Practices
Managing Multiple Environments
Terraform in Atlas makes it easy to reuse configurations and manage multiple environments. Common configurations should be written as modules, and then referenced in the main Terraform file for each environment. For example, the usual tree for managing multiple environments is:
- prod
- main.tf
- .terraform
- terraform.tfstate
- prod.tfvars
- qa
FROM jkosgei/php-nginx:v1
MAINTAINER Jonathan Kosgei <jonathankosgei1000@gmail.com>
ENV DEBIAN_FRONTEND noninteractive
RUN wget http://wordpress.org/latest.tar.gz
RUN tar xzvf latest.tar.gz;\
rsync -avP wordpress/ /var/www/html/ ;\
@jonathan-kosgei
jonathan-kosgei / post-receive
Last active September 1, 2016 20:26 — forked from lemiorhan/post-receive
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then
>>> list2
[5, 5, 5, 5, 5, 4, 4, 2, 1]
>>> def insertion_sort(list2):
... for index in range(1,len(list2)):
... position=index
... currentvalue=list2[index]
... while position>0 and currentvalue<list2[position-1]:
... list2[position]=list2[position-1]
... list2[position-1]=currentvalue
... position-=1
kind: PersistentVolume
apiVersion: v1
metadata:
name: pv0001
labels:
name: pv0001
type: local
spec:
capacity:
storage: 5Gi
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: mongo-data-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: mongo
spec:
serviceName: mongo
template:
metadata:
labels:
name: mongo