Skip to content

Instantly share code, notes, and snippets.

View rafi's full-sized avatar

Rafael Bodill rafi

View GitHub Profile
@rafi
rafi / echoserver.go
Created April 1, 2021 14:00
Echoserver in Go lang
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
@rafi
rafi / README.md
Last active March 18, 2021 11:32
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
@rafi
rafi / openebs.md
Created September 9, 2020 12:00
Overview of OpenEBS
@rafi
rafi / README.md
Created August 10, 2020 09:47
Kubernetes nginx-ingress routing by header value

During a Hackathon I implemented a route-interception by HTTP Header value in Nginx-ingress for Kubernetes:

Add Nginx-ingress annotation in global ConfigMap ('http' scope):

kind: ConfigMap
data:
  http-snippet: |
    map $http_x_feature_ucache $ucache_route_service {
      default "$proxy_upstream_name";

'true' "default-cache-svc-3000";

@rafi
rafi / k8s-101-handson.md
Created August 4, 2020 13:19
Workshop material for K8s 101 hands-on.

Kubernetes 101: Hands-on

brew install kubernetes-cli minikube

minikube start # --memory=8192 --cpus=4
kubectl get -A deployment
kubectl get -A pod -w
@rafi
rafi / index.js
Created February 23, 2020 15:35
Unwatch all repos of organization
// Browse to https://github.com/watching and run in console:
(function() {
let qx = $x;
let unwatch = function(org) {
let nodes = document.querySelectorAll('.Box-row');
let rows = [ ...nodes ];
let orgRows = rows.filter(e => e.innerText.startsWith(` ${org}/`));
let orgUnsubButtons = orgRows.map(row => row.querySelector('button.select-menu-item[value="included"]'));
orgUnsubButtons.forEach(button => console.log(button.click()));
@rafi
rafi / Dockerfile
Last active January 29, 2020 23:10
Python 3 Falcon API example
FROM python:3.7-slim
RUN pip install --no-cache-dir falcon
ENTRYPOINT ["python", "app.py"]
WORKDIR /app
COPY . .
@rafi
rafi / deploy.yml
Last active August 10, 2019 11:51
Ansible prepare a detached git repository and deploy
# -----------------------------------------------
# ENSURE GIT REPOSITORIES
- name: Git | Ensure server repository
sudo_user: git
git: repo={{ upstream }}
dest={{ repo_dir }}
bare=yes
update=no
tags: git
@rafi
rafi / keybase.md
Created July 9, 2019 12:10
keybase.md

Keybase proof

I hereby claim:

  • I am rafi on github.
  • I am justrafi (https://keybase.io/justrafi) on keybase.
  • I have a public key ASBtJHqjyerrL76jBIQ4LBx6fvpegzfKLvOj4AkCDBDkTQo

To claim this, I am signing this object:

@rafi
rafi / use-telegram.md
Last active May 22, 2019 12:46
Telegram > WhatsApp+Slack+HipChat

Telegram is so much better than Slack, WhatsApp and HipChat combined.

  1. Telegram is FREE. No ads.
  2. Telegram clients are a beautiful example of great responsive, light-weight apps
  3. Telegram has superior open API to create bots. Like IRC bots.
  4. Telegram allows you to share enormous files and stores them forever
  5. Telegram creator refused to give Russian authorities access
  6. Telegram groups can have up to 100,000 people in a single group chat
  7. Telegram has channels. They are like "read-only" groups
  8. Telegram allows you to edit messages like Slack.