Skip to content

Instantly share code, notes, and snippets.

Avatar

Tim Van Wassenhove timvw

View GitHub Profile
@timvw
timvw / migrate.sh
Created Jan 17, 2023
Copy and update all libs from /usr/local to current directory
View migrate.sh
for file in $(ls .); do
for ll in $(otool -L $file | grep -oE "/usr/local/[^ ]*"); do
echo "copying $ll to ."
sudo cp $ll .
#echo ""
done
done
for file in $(ls .); do
for ll in $(otool -L $file | grep -oE "/usr/local/[^ ]*"); do
@timvw
timvw / cli.sh
Last active Jan 15, 2023
Ballista session
View cli.sh
# launch cli and connect to scheduler
docker run \
--network host \
--rm -it \
-v /Users/timvw:/Users/timvw \
apache/arrow-ballista-cli:0.10.0 --host 127.0.0.1 --port 50050
create external table test stored as parquet location '/Users/timvw/Desktop/test.parquet';
select * from test limit 10;
@timvw
timvw / script.sh
Created Nov 23, 2022
From json to tsv with jq
View script.sh
```bash
cat LSQL-messages-2022-11-23-06-44-47.json | jq -r '.[].value | [.day, .count] | @tsv'
```
@timvw
timvw / port-user.sh
Created May 5, 2022
Describe which process is using a given TCP port (macos)
View port-user.sh
lsof -nP -i4TCP:$1
@timvw
timvw / Cargo.toml
Created May 3, 2022
datafusion-aws-glue-catalog (example)
View Cargo.toml
[package]
name = "rust-playground"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
aws-config = "0.11.0"
aws-sdk-s3 = "0.11.0"
@timvw
timvw / deployment-controller-token
Last active Jan 21, 2022
Get token for k8s dashboard http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login
View deployment-controller-token
kubectl -n kube-system get secret -o json | \
jq -r '.items[] | select(.metadata.name | startswith("deployment-controller-token")) | .data.token' | \
base64 --decode | \
pbcopy
@timvw
timvw / ratelimited-cats.scala
Created Nov 16, 2021
Ratelimit with cats-effect
View ratelimited-cats.scala
package be.icteam.sample
import cats.effect._
import cats.implicits._
import cats.effect.concurrent.Semaphore
import java.util.concurrent.Executors
import scala.concurrent.ExecutionContext
@timvw
timvw / master2main.sh
Created Jan 28, 2021
Deal with git repos where master has been renamed to main
View master2main.sh
git branch -m master main && \
git fetch origin && \
git branch -u origin/main main && \
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
@timvw
timvw / terraform.yml
Created Jan 20, 2021
github actions to plan/apply multiple terraform projects
View terraform.yml
name: "Terraform"
on:
push:
branches:
- master
pull_request:
jobs:
terraform:
View partitions.sh
#!/bin/bash
#set -x
partitions_between() {
local from=$1
local to=$2
local offset_in_seconds=$3
local fmt=$4
current=$from