Skip to content

Instantly share code, notes, and snippets.

View mathisve's full-sized avatar
☁️
Code & Cloud

Mathis Van Eetvelde mathisve

☁️
Code & Cloud
View GitHub Profile
@mathisve
mathisve / blockchain.json
Created May 22, 2023 16:47
Bitcoin 2023 Grafana dashboards
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
@mathisve
mathisve / caggs.SQL
Last active May 22, 2023 17:07
Timescale crypto dashboard
--DROP MATERIALIZED VIEW tick1mcagg, tick10mcagg, tick30mcagg, tick1hcagg, tick6hcagg, tick12hcagg, tick1dcagg, tick7dcagg, tick14dcagg, tick30dcagg;
--DROP MATERIALIZED VIEW fl1mcagg, fl10mcagg, fl30mcagg, fl1hcagg, fl6hcagg, fl12hcagg, fl1dcagg, fl7dcagg, fl14dcagg, fl30dcagg;
--tickcaggs
CREATE MATERIALIZED VIEW tick1mcagg WITH (timescaledb.continuous) AS
SELECT time_bucket('1m', time) as time, avg(price) as price, symbol
FROM crypto_ticks
GROUP BY time_bucket('1m', time), symbol WITH NO DATA;
CREATE MATERIALIZED VIEW tick10mcagg WITH (timescaledb.continuous) AS
@mathisve
mathisve / kubeadm.sh
Last active January 2, 2023 19:57
Kubernetes cluster using Kubeadm
## works for ubuntu
## source: https://www.linuxtechi.com/install-kubernetes-on-ubuntu-22-04/
sudo swapoff -a
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
sudo tee /etc/modules-load.d/containerd.conf <<EOF
overlay
br_netfilter
EOF

Keybase proof

I hereby claim:

  • I am mathisve on github.
  • I am mathisve (https://keybase.io/mathisve) on keybase.
  • I have a public key whose fingerprint is BBBB E77F DD61 2E0E F4F5 2FE4 8DAF 8B0A FA8E CCAB

To claim this, I am signing this object:

@mathisve
mathisve / eip.sh
Last active January 18, 2022 18:02
get elastic ips with tag
#!/bin/bash
aws ec2 describe-addresses \
--filters "Name=tag-key,Values=Static" | jq -r '.Addresses[] | .PublicIp'
@mathisve
mathisve / publish.yaml
Created December 2, 2021 15:24
react s3 cloudfront CI
name: React publish
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
@mathisve
mathisve / vcan_setup.sh
Created October 5, 2020 19:47
Get vcan up and running quickly!
#!/usr/bin/env bash
# https://elinux.org/Bringing_CAN_interface_up
# Installing can-utils
sudo sudo apt-get install can-utils
# Creating vcan0 interface
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
@mathisve
mathisve / displacement.go
Last active September 26, 2020 10:19
calculate displacement at time t using functions as variables in golang
package main
import (
"fmt"
"math"
)
func main() {
var acceleration, velocity, displacement, time float64
@mathisve
mathisve / interfaces.go
Last active September 17, 2020 08:41
Golang interaces example, from: https://youtu.be/EGRXKV6j-v0
package main
import (
"fmt"
"math"
)
type rectangle struct {
width float64
height float64
@mathisve
mathisve / LambdaUploader.sh
Created August 26, 2020 13:23
Upload python codebase & libraries to AWS Lambda
#!/usr/bin/env bash
# pip3 install --target ./package Pillow
cd package
zip -r9 ${OLDPWD}/archive.zip .
cd $OLDPWD
zip -g archive.zip main.py chromedriver
echo "UPLOADING archive.zip to AWS"
aws lambda update-function-code --function-name pythontest --zip-file fileb://archive.zip