Skip to content

Instantly share code, notes, and snippets.

View nimboya's full-sized avatar

Ewere Diagboya nimboya

View GitHub Profile
@nimboya
nimboya / kubedeploy.yml
Created November 30, 2019 18:22
Sample Kubernetes Manifest File
apiVersion: apps/v1
kind: Deployment
metadata:
name: myappms
labels:
app: myappms
spec:
replicas: 2
selector:
matchLabels:
@nimboya
nimboya / task.json
Created November 30, 2019 17:26
Sample ECS Task Definition
{
"ipcMode": null,
"executionRoleArn": "arn:aws:iam::123456789876:role/ecsTaskExecutionRole",
"containerDefinitions": [
{
"dnsSearchDomains": null,
"logConfiguration": {
"logDriver": "awslogs",
"secretOptions": null,
"options": {
@nimboya
nimboya / file.secrets
Last active August 5, 2022 08:14
VPN Config Using OpenSwan/LibreSwan
20.5.1.167 10.71.83.44 : PSK "phlTXL0BKXcBn6WgEX_p6wsi1_d5W1FE"
20.5.1.167 41.190.1.25 : PSK "phlTXL0BKXcBn6WgEX_p6wsi1_d5W1FE"
34.251.232.201 41.190.1.25 : PSK "phlTXL0BKXcBn6WgEX_p6wsi1_d5W1FE"
34.251.232.201 10.71.83.44 : PSK "phlTXL0BKXcBn6WgEX_p6wsi1_d5W1FE"
@nimboya
nimboya / dynamodb.local.py
Last active November 16, 2018 13:26
DynamoDB Local
import boto3
ddb = boto3.client('dynamodb', endpoint_url='http://localhost:8000/')
response = ddb.list_tables()
print(response)
@nimboya
nimboya / Jenkinsfile
Created October 20, 2018 18:34
Sample Jenkins file for Serverless Build
#!/usr/bin/env groovy
import java.util.Date
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def displayName = env.JOB_NAME
def bucketName = env.JOB_NAME
def isMaster = env.BRANCH_NAME == "master"
@nimboya
nimboya / serverless.yaml
Created October 20, 2018 12:41
A Serverless Framework Configuration File
service: kannel_sms_sender
app: kannel_sms_sender_service
provider:
name: aws
runtime: nodejs8.10
environment: ${file(env.yml):${self:provider.stage}}
region: eu-west-1
functions:
@nimboya
nimboya / config.json
Created October 20, 2018 12:36
A Basic Configuration for Chalice
{
"stages": {
"dev": {
"api_gateway_stage": "api",
"environment_variables": { "APP_TABLE_NAME": "itsshort" }
}
},
"version": "2.0",
"app_name": "itsshort"
}
@nimboya
nimboya / nginxlogstash.log
Created September 25, 2018 14:40
Convert Nginx to JSON using Logstash
input {
file{
path=>["/media/access*"]
start_position=>"beginning"
}
}
filter {
grok {
match => { "message" => ["%{IPORHOST:[remote_ip]} - %{DATA:[user_name]} \[%{HTTPDATE:[time]}\] \"%{WORD:[method]} %{DATA:[url]} HTTP/%{NUMBER:[http_version]}\" %{NUMBER:[response_code]} %{NUMBER:[body_sent_bytes]} \"%{DATA:[referrer]}\" \"%{DATA:[agent]}\""] }
remove_field => "message"
@nimboya
nimboya / logstash-awses.conf
Created September 25, 2018 13:01
Logstash Writing to AWS ElasticSearch
input {
file{
path=>["/media/data/output.json"]
codec=>"json"
type=>"log"
start_position=>"beginning"
@nimboya
nimboya / lambdakinesis.py
Last active August 31, 2018 18:32
Transform Records from Kinesis using Lambda Function for JSON data
import math
print('Loading function')
def lambda_handler(event, context):
output = []
for record in event['records']:
payload = base64.b64decode(record['data'])
entry = json.loads(payload)
result = {