Skip to content

Instantly share code, notes, and snippets.

View cnb0's full-sized avatar

nbabu cnb0

View GitHub Profile
@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
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). 

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/

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"]
@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