Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

JuanJo Ciarlante jjo

🏠
Working from home
View GitHub Profile
View mtr-jjo.txt
$ mtr www.nhs.uk
My traceroute [v0.93]
jjo-x270 (192.168.0.106) 2020-08-18T12:55:27-0300
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. ip-192-168-0-1.ec2.internal 0.0% 10 3.2 13.5 1.4 77.5 25.1
2. static.214.65.itcsa.net 77.8% 10 5.0 4.1 3.3 5.0 1.2
3. (waiting for reply)
4. ae0-90G.ar7.LAX1.gblx.net 10.0% 10 285.3 295.2 283.2 324.0 14.9
@jjo
jjo / Dockerfile
Last active May 13, 2020
Generic python dockerfile for multistage builds
View Dockerfile
FROM python:3.8-slim as compile-image
RUN apt-get update && apt-get install -y --no-install-recommends build-essential gcc && apt-get clean
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . /app
FROM python:3.8-slim as runtime-image
View clusterfoo-thanos-store-gateway.yaml
# Deploy an additional thanos-store-gateway instance in to feed
# thanos-querier with TSDB from a different cluster S3 bucket
# (no direct connectivity between clusters)
# There `clusterfoo` is the "remote" cluster, running under
# a different AWS_ACCOUNT_NUM, using kiam to assume a role
# able to read the S3 bucket.
---
apiVersion: apps/v1beta2
kind: StatefulSet
metadata:
View tg-cornix-hirn-free-setup_crypto-timba.md

Steps to setup Telegram(TG) Cornix BOT autotrading, feeding from Hirn Crypto Free signals TG channel against Binance.

These signals instruct the BOT to trade altcoins against BTC, towards getting returns in BTC, typically via high-freq trading (sometimes ~handful trades per min).

  • [1] Add cornix bot to TG: https://t.me/cornix_trading_bot (free trial 2/weeks)
  • [2] Add Hirn Crypto Free (signals) to TG: https://t.me/hirn_Crypto (free)
  • [3] Create Binance API key, only allowing in-account trading (default), save key and secret
  • Setup cornix bot, from Main Menu ->
    • Add Another Client -> New Client -> Link to an existing account -> Binance using API <key>,<secret> from [3]
    • Subscribe to Channel -> should automagically show Hirn ... from [2]
View psp.jsonnet
local kube = (import "lib/kube.libsonnet") {
PodSecurityPolicy(name):: kube._Object("policy/v1beta1", "PodSecurityPolicy", name) {
metadata+: {
assert !std.objectHas(self, "namespace"): "PSPs are not namespaced",
},
},
};
{
View sapito-docker-compose-debug.out
jjo@sapito:~/coro/clases-devops/c01/p01/api_jwt$ docker-compose up
Starting api_jwt_init_1 ... done
Starting api_jwt_main_1 ... done
Starting api_jwt_test_1 ... done
Attaching to api_jwt_init_1, api_jwt_main_1, api_jwt_test_1
init_1 | fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
test_1 | fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
init_1 | fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
main_1 | Server started at 3001
init_1 | v3.8.4-63-g0ce51efa7e [http://dl-cdn.alpinelinux.org/alpine/v3.8/main]
View resourceConfigAddCmd
var resourceConfigAddCmd = &cobra.Command{
Use: "add",
Short: "adds specific resources to be watched",
Long: `adds specific resources to be watched`,
Run: func(cmd *cobra.Command, args []string) {
conf, err := config.New()
if err != nil {
logrus.Fatal(err)
}
flags := []struct {
View docker-runc-cve-replace.sh
#!/bin/bash
#
# Workaround CVE-2019-5736 via patched runc provided by
# https://github.com/rancher/runc-cve
# The script does:
# 1) find "docker-runc" executable and docker version
# 2) download corresponding patched runc
# 3) dpkg-divert (ie "permanently move") pkg installed runc and replace it by 2)
#
# Run with "-n" for dry-run.
@jjo
jjo / kube-router.ds.yaml
Created Jan 11, 2019
kube-router v0.2.4 DaemonSet running on a Raspberry PI B+ cluster (ARMv7)
View kube-router.ds.yaml
## Output from:
# kubectl get ds --namespace=kube-system kube-router -oyaml
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
creationTimestamp: "2018-12-04T20:17:44Z"
generation: 2
labels:
k8s-app: kube-router
tier: node
@jjo
jjo / kube-router.ds.yaml
Created Jan 11, 2019
kube-router v0.2.4 DaemonSet running on a Raspberry PI B+ cluster (ARMv7)
View kube-router.ds.yaml
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
creationTimestamp: "2018-12-04T20:17:44Z"
generation: 2
labels:
k8s-app: kube-router
tier: node
name: kube-router