Skip to content

Instantly share code, notes, and snippets.

Jonathan Kosgei jonathan-kosgei

Block or report user

Report or block jonathan-kosgei

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dropbox.py
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'
View calico-bgp.txt
root@ip-172-1-1-142:~# calicoctl bgp peer show
No global IPv4 BGP Peers defined.
No global IPv6 BGP Peers defined.
View terraform-bestpractices
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
View Dockerfile
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 Sep 1, 2016 — forked from lemiorhan/post-receive
Post-receive hook to deploy the code being pushed to production branch to a specific folder
View post-receive
#!/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
View intro.md
View Python Insertion Sort
>>> 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
View mongo-pv.yml
kind: PersistentVolume
apiVersion: v1
metadata:
name: pv0001
labels:
name: pv0001
type: local
spec:
capacity:
storage: 5Gi
View mongo-pvc.yml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: mongo-data-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
View mongo-set.yml
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: mongo
spec:
serviceName: mongo
template:
metadata:
labels:
name: mongo
You can’t perform that action at this time.