Skip to content

Instantly share code, notes, and snippets.

@esomore
esomore / cilium.yaml
Last active November 3, 2023 20:05
cilium 1.14.3 for talos
---
# Source: cilium/templates/cilium-agent/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: "cilium"
namespace: kube-system
---
# Source: cilium/templates/cilium-operator/serviceaccount.yaml
apiVersion: v1
@esomore
esomore / gist:fc04bc74c2ef0e25ba2230d7b007ca8c
Created September 12, 2023 04:56
# GHOSTDAG Protocol vs. Bitcoin's Decentralization
# GHOSTDAG Protocol vs. Bitcoin's Decentralization
While pruned nodes present an innovative solution to address the storage problem brought about by high TPS, it's crucial to consider the broader implications of this approach on network decentralization and neutrality. The **GHOSTDAG protocol**, as detailed by Sutton and Wyborski, introduces a set of rules that miners must follow to support secure pruning of the DAG. The protocol's main proposition suggests that if certain conditions are met, blocks can be safely pruned without compromising the integrity of the network.
In contrast, **Bitcoin**, the original decentralized cryptocurrency, has been tested over a decade and has proven its commitment to neutrality and decentralization. Its consensus mechanism ensures that no single entity can control or dominate the network<sup>1</sup>. As Bitcoin's popularity grew, so did its transaction volume, leading to scalability challenges. However, the Bitcoin community has explored and implemented several scaling solut

Keybase proof

I hereby claim:

  • I am esomore on github.
  • I am itamarperez (https://keybase.io/itamarperez) on keybase.
  • I have a public key ASBQUA5rkGf4jDxCZrhoQYTEVyunBvr0r41tRDXMWQmgqwo

To claim this, I am signing this object:

# download jdk from oracle
# install jenv
jenv enable-plugin export
jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home
jenv global 1.8.0.211
jenv enable-plugin maven
jenv enable-plugin export
jenv doctor
### deploy custom timescaledb postgres image ###
kubectl apply -f https://raw.githubusercontent.com/cosmicrocks/timescaledb/master/k8s/timescaledb/postgres-version.yaml
### deploy custom postgres user password ###
kubectl apply -f https://raw.githubusercontent.com/cosmicrocks/timescaledb/master/k8s/timescaledb/timescale-auth.yaml
### deploy timescale postgres kubedb crd ###
kubectl apply -f https://raw.githubusercontent.com/cosmicrocks/timescaledb/master/k8s/timescaledb/timescale.yaml
### deploy pg_admin ###
### the good guys at kubedb provided us with this easy one liner ###
curl -fsSL https://raw.githubusercontent.com/kubedb/cli/0.12.0/hack/deploy/kubedb.sh | bash
### verify that the setup is successful ###
kubectl get pods --all-namespaces -l app=kubedb
kubectl get crd -l app=kubedb
### (you might need to run this twice if it fails on the first run) ###
kubectl apply -k https://github.com/cosmicrocks/monitoring.git
### port-forward to grafana ###
kubectl -n monitoring port-forward $(kubectl -n monitoring get pods -l app=grafana -o jsonpath='{.items[*].metadata.name}') 3000:3000 &
and browse to https://127.0.0.1:3000
(username and password are 'admin')
kubectl apply -f - <<EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
### create new cluster and call it cosmic ###
doctl kubernetes cluster create cosmic
### add a secondary node-pool with bigger droplets for timescale ###
doctl kubernetes cluster node-pool create cosmic --name tsdb --count 4 --size s-6vcpu-16gb
### delete the default node-pool ###
doctl kubernetes cluster node-pool delete cosmic cosmic-default-pool
### list node-pools ###
sudo snap install --beta multipass --classic
multipass launch --name microk8s-vm --mem 16 --disk 80G
multipass exec microk8s-vm -- sudo snap install microk8s --classic
multipass exec microk8s.status
multipass exec microk8s-vm -- sudo iptables -P FORWARD ACCEPT\n
multipass exec microk8s-vm -- /snap/bin/microk8s.config > $KEYBASE_HOME/clusters/microk8s
multipass exec microk8s-vm -- /snap/bin/microk8s.enable dns dashboard
multipass exec microk8s-vm -- /snap/bin/microk8s.kubectl get all --all-namespaces