Skip to content

Instantly share code, notes, and snippets.

View cnb0's full-sized avatar

nbabu cnb0

View GitHub Profile
@cnb0
cnb0 / web-servers.md
Created January 17, 2020 06:21 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
FROM tomcat:8.0.51-jre8-alpine
EXPOSE 8080
RUN rm -rf /usr/local/tomcat/webapps/*
COPY target/*.war /usr/local/tomcat/webapps/ROOT.war
CMD ["runsvc.sh","run"]

Docker Internals ,

  1. Ubuntu Linux - to get the best experience as Docker is built for Linux and production deployments are on Linux https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04 orhttps://linuxize.com/post/how-to-install-and-use-docker-on-ubuntu-18-04/

  2. For Mac users its a  3 step process to run Ubuntu Linux and then install docker   -

  3. Install vagrant/Virtualbox as per video        https://www.youtube.com/watch?v=4Ue1WmcHipg 2.  install ubuntu linux using vagrant$mkdir docker-ubuntu ; cd docker-ubuntu$vagrant init bento/ubuntu-18.04 $vagrant up --provider=virtualbox$vagrant ssh here you should be able to login to Ubuntu/Linux Follow the steps in below url or any urls provided in step 1 to install docker on Ubuntuhttps://linuxize.com/post/how-to-install-and-use-docker-on-ubuntu-18-04/

vagrant init    # Initialize Vagrant by creating a .vagrant directory and the "Vagrantfile" file (configuration template). 
vagrant init ubuntu / trust    # Initialize Vagrant and install a ubuntu / trusty64 VM (It can be installed with other commands as well).
 
vagrant up           # Start a VM, if it is the first see it will provision it. 
vagrant resume       # Activate a previously suspended VM, it can also be done with "vagrant up". 
vagrant provision    # Provision a VM again according to the configuration. 
vagrant reload # Restarts       (loading the Vagrantfile file). Add - provision to provision.
 
vagrant ssh 		# Connect using ssh (it must be in the same directory). 
@cnb0
cnb0 / kafka.md
Created October 26, 2020 14:23 — forked from ashrithr/kafka.md
kafka introduction

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
@cnb0
cnb0 / README.md
Created March 18, 2021 11:32 — forked from rafi/README.md
k3d-workshop

K3D Workshop

App Case-Study

A "simple" distributed app today.

  • HTTP Rest API
  • Task Workers (Queue consumers) and Crons (Periodic jobs)
  • Web client
  • Android / iOS client
@cnb0
cnb0 / Vagrantfile
Created April 7, 2021 07:54 — forked from bhdrkn/Vagrantfile
RabbitMQ Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby ts=2 sw=2 expandtab:
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provision "shell", inline: <<-SHELL
echo 'deb http://www.rabbitmq.com/debian/ testing main' >/etc/apt/sources.list.d/rabbitmq.list
wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
apt-key add rabbitmq-signing-key-public.asc
apiVersion: v1
kind: ConfigMap
metadata:
name: rabbitmq-config
namespace: default
data:
enabled_plugins: |
[
rabbitmq_management,
rabbitmq_peer_discovery_k8s,
#!/bin/sh
#
# This script deploys the given manifest,
# tracks the deployment, and rolls back on failure.
#
# First execute this with "myapp.yaml" and then try it with "myapp.failing.yaml"
#
MANIFEST_PATH=$1
DEPLOYMENT_NAME=myapp
@cnb0
cnb0 / Vagrantfile
Created August 30, 2021 16:00 — forked from rjz/Vagrantfile
Vagrant with MariaDB provisioned (ansible)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.