Skip to content

Instantly share code, notes, and snippets.

git clone https://github.com/mossey/laravel-nairobi-demo-app.git
cd laravel-nairobi-demo-app
docker build -t laravel-demo .
docker run -p 80:80 -e private="foo" -e public="bar" -e APP_KEY="base64:IWcCHC1eD+5Y4LNWFznWoJ5faXYmABGB4ZPrWLWmU+Y=" laravel-demo
eksctl create cluster \
--name demo-cluster \
--version 1.14 \
--region us-west-2 \
--nodegroup-name standard-workers \
--node-type t2.micro \
--nodes 2 \
--nodes-min 1 \
--nodes-max 2 \
--managed
#!/bin/bash
sudo yum update -y
sudo yum install docker -y
sudo service docker start
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
docker run -p 82:80 -d nginxdemos/hello
docker run -p 80:80 -e private="foo" -e public="bar" -e APP_KEY="base64:IWcCHC1eD+5Y4LNWFznWoJ5faXYmABGB4ZPrWLWmU+Y=" mosseyo/laravel-demo:001
@mossey
mossey / Dockerfile
Created May 7, 2019 18:10
Laravel docker file
FROM php:7-fpm-alpine
RUN apk --update add wget \
curl \
git \
grep \
nginx \
@mossey
mossey / migrate-redis.py
Created April 3, 2019 09:13 — forked from thomasst/migrate-redis.py
Migrate Redis data on Amazon ElastiCache
"""
Copies all keys from the source Redis host to the destination Redis host.
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are
restricted (e.g. on Amazon ElastiCache).
The script scans through the keyspace of the given database number and uses
a pipeline of DUMP and RESTORE commands to migrate the keys.
Requires Redis 2.8.0 or higher.
from flask import Flask, request, jsonify, json
app = Flask(__name__)
# the route is /getjson
# the method we use is POST
# the data is {"name":"Moses Nandwa","age":"10 years"}
@app.route('/getjson', methods=['POST'])
def add_message():
@mossey
mossey / cloudSettings
Created July 10, 2018 16:58
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-07-10T16:58:55.808Z","extensionVersion":"v2.9.2"}
@mossey
mossey / publish_to_queue.py
Created April 11, 2018 09:47
Publish to ASB
from azure.servicebus import ServiceBusService
from azure.servicebus import Message
key_name = "component" # SharedAccessKeyName from Azure portal
key_value = "GQ0I5xfvkOKU4u719LeXEQV7U/iiSJBmcD7HwA05rt4=" # SharedAccessKey from Azure portal
sbs = ServiceBusService("dev-bonga-asb",
shared_access_key_name=key_name,
shared_access_key_value=key_value)
msg = Message(
' {"trackingID":"mljdlkasjldkjasldkjlaksd", "senderJID":"moses@localhost","conversationID":"jsalkjdlkjakldjaklsdjlkasjd","transactionUUID":"***[email protected]\\/0303\\/2727 04:55:03","transactionType":"AccountBalance","responseCode":"00","responseDescription":"697.00"}')
%%%
%%% ejabberd configuration file
%%%
%%%'
%%% The parameters used in this configuration file are explained in more detail
%%% in the ejabberd Installation and Operation Guide.
%%% Please consult the Guide in case of doubts, it is included with
%%% your copy of ejabberd, and is also available online at
%%% http://www.process-one.net/en/ejabberd/docs/
@mossey
mossey / Jabber-SH
Created March 10, 2018 09:41 — forked from pcreux/Jabber-SH
Jabber-SH — SH console via XMPP/Jabber (GTalk) Jabber-SH allows to you to administrate a remote computer via a command line through a Jabber client. It’s like SSH via GoogleTalk! :)
#!/usr/bin/env ruby
# Jabber-SH — SH console via XMPP/Jabber (GTalk)
#
# Jabber-SH allows you to administrate a remote computer via a command line
# through a Jabber client. It’s like SSH via GoogleTalk! :)
# This is just a hack but it might be usefull sometime to run basic commands
# on a machine that is not accessible via ssh.
#
# Philippe Creux. pcreux/AT/gmail/DOT/com