Skip to content

Instantly share code, notes, and snippets.

View zeerorg's full-sized avatar
💻
Fixing 🔄 Breaking

Rishabh Gupta zeerorg

💻
Fixing 🔄 Breaking
View GitHub Profile
@zeerorg
zeerorg / mac_local_redis_cluster.sh
Last active November 21, 2023 13:05
Macos docker run
container_name="local-redis"
if [ "$( docker container inspect -f '{{.State.Status}}' $container_name )" = "running" ]; then
docker stop $container_name
fi
if docker ps -a --format '{{.Names}}' | grep -q "^$container_name$"; then
docker rm $container_name
fi

Python3-Debian

Link

Runs on Root user hence cannot be invoked from arbitrary --user flag.

Error: docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "chdir to cwd (\"/root\") set in config.json failed: permission denied": unknown

The same error occurs in python-flask template link

# Deploy openfaas with k3d
command -v helm > /dev/null
if [ $? == "1" ];
then
curl -s https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
fi
command -v k3d > /dev/null
if [ $? == "1" ];
# Script to deploy openfaas in local kubernetes cluster
# Step 1 install helm and tiller
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
kubectl -n kube-system create sa tiller \
&& kubectl create clusterrolebinding tiller \
--clusterrole cluster-admin \
--serviceaccount=kube-system:tiller

Deploying openfaas cloud on armhf

Prerequisites

  1. A domain name which can point to your deployment. (subdomain names also work)
  2. Setup Github app. Refer this. You'll need to transfer the downloaded private-key.pem file to arm device.
  3. Docker hub account.

Core components steps:

  1. Sign in to docker hub on your machine using:
zeerorg
alexellis
openfaas
@zeerorg
zeerorg / update_cloudflare_dns.py
Created January 5, 2019 14:22
Effectively use cloudflare as dynamic dns provider
#!/usr/bin/python3
import json
import urllib.request
authkey = ''
email = ''
zone_id = ''
dns_id = ''
my_ip = urllib.request.urlopen('https://api.ipify.org').read().decode('utf-8')

Keybase proof

I hereby claim:

  • I am zeerorg on github.
  • I am zeerorg (https://keybase.io/zeerorg) on keybase.
  • I have a public key ASCi8XtY3QXAT5WDUnZaiwl1SmxDPkZQQo2D07IwwyJU7Qo

To claim this, I am signing this object:

#!/bin/bash
# setup download folder
mkdir -p ~/Downloads/Debs
# update and upgrade system
sudo apt update && sudo apt upgrade -y
# general first installs
sudo apt install git build-essential -y
  1. title
  2. body
  3. uid
  4. imageList ( no need for single image )
  5. fileList
  6. timestamp
  7. previousPost ( for linking )

    Won't be having:
    authorImage since it should be fetched from specific author repo