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
@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.
@cnb0
cnb0 / README.md
Created September 25, 2021 10:36 — forked from cjtallman/README.md
Vagrant Gitlab Server

Vagrant Gitlab Server

Quickly set up a local Gitlab CE server using Vagrant.

Run vagrant up to setup the virtual server.

Server Details

  • Ubuntu 16.04
  • Installs latest Docker

Git/Github step-by-step Workflow

Step-by-step guide for creating a feature or bugfix branch, submit it for code review as a pull request and once approved, merge upstream. This guide is intended for internal developers with push access to all relevant repos.

You should understand rebasing and squashing. For a very good explanation on rebasing and squashing with pull requests see How to Rebase a Pull Request. Also worth reading is the Hacker's Guide to Git.

Setup

@cnb0
cnb0 / gitlab-ci.yml
Created October 30, 2021 10:04 — forked from doevelopper/gitlab-ci.yml
Gitlab ci template config for my c++ project
variables:
GIT_SSL_NO_VERIFY: "true"
GIT_DEPTH: "3"
GET_SOURCES_ATTEMPTS: "3"
ARTIFACT_DOWNLOAD_ATTEMPTS: "2"
GIT_SUBMODULE_STRATEGY: "recursive"
GIT_STRATEGY: "fetch"
GIT_CHECKOUT: "false"
CMAKE_BUILD_TYPE: "Release"
BUILD_DIRECTORY: "build-$CI_PROJECT_NAME"