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 / insert.go
Last active March 15, 2024 04:28
Golang script to rapidly insert data into a MySQL database
package main
import (
"bufio"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"sync"
// "math/rand"
@mathisve
mathisve / Chat.sql
Last active August 20, 2020 12:45
CoreProtect SQL queries
USE logging;
SELECT
DATE(FROM_UNIXTIME(co_chat.time)),
co_user.user,
message
FROM
co_chat
LEFT JOIN co_user
ON co_user.rowid = co_chat.user
@mathisve
mathisve / lambdaS3.go
Created August 20, 2020 12:51
download an image to S3 using Serverless Lambda in Golang
package main
import (
"fmt"
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
@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
@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 / 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 / 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 / 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 / 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'

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: