Skip to content

Instantly share code, notes, and snippets.

View carlosedp's full-sized avatar

Carlos Eduardo carlosedp

View GitHub Profile
@carlosedp
carlosedp / main.yml
Created January 28, 2019 19:02
Ansible playbook to automate new Kubernetes SBC nodes
---
- name: Setup SBC
hosts: all
#become: true
#become_user: root
gather_facts: false
vars:
#New user to be created
new_user: newuser
@carlosedp
carlosedp / gist:5040f4a1b2c97c1fa260a3409b5f14f9
Created February 19, 2018 20:01
Reset Kubernetes cluster with Weave
# Drain and delete the nodes (for each node you have)
kubectl drain kubenode1 --delete-local-data --force --ignore-daemonsets
kubectl delete node kubenode1
# Reset the deployment
sudo kubeadm reset
# On each node
## Reset the nodes and weave
@carlosedp
carlosedp / PipelineBench.scala
Last active June 2, 2023 02:35
Scala JMH Benchmark Samples
// Run with `scli --jmh PipelineBench.scala`, to generate json output, add `-- -rf json` args
//> using scala 3.3.0
//> using options "-Wunused:all"
package bench
import java.util.concurrent.TimeUnit
import scala.util.chaining.*
import org.openjdk.jmh.annotations.*
[
{
"jmhVersion" : "1.29",
"benchmark" : "bench.PipelineOps.aliased",
"mode" : "avgt",
"threads" : 1,
"forks" : 1,
"jvm" : "/Users/cdepaula/Library/Caches/Coursier/arc/https/github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/graalvm-ce-java17-darwin-amd64-22.3.1.tar.gz/graalvm-ce-java17-22.3.1/Contents/Home/bin/java",
"jvmArgs" : [
"-XX:ThreadPriorityPolicy=1",
@carlosedp
carlosedp / Readme.md
Last active May 3, 2023 19:13
Find plugin updates for Scala cli, mill build tool and ammonite scripts

This is a Scala script to check for Mill build plugin and scala-cli lib updates. The plugin requires scala-cli.

Run directly from the gist with:

scala-cli https://gist.github.com/carlosedp/c3ea2814ac5392051a562e95c1298239/raw/checkdeps.sc

Or download the script, make it executable and run as:

@carlosedp
carlosedp / Dockerfile.symbiflow
Last active April 17, 2023 06:56
Symbiflow Docker image
FROM continuumio/miniconda
ENV INSTALL_DIR="/opt/symbiflow"
ENV FPGA_FAM=xc7
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y ca-certificates git build-essential wget cmake xz-utils --no-install-recommends
@carlosedp
carlosedp / docker-compose.yml
Last active April 13, 2023 13:20
ZIO Kafka sample app
# Run with docker-compose up -d
version: "2"
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
@carlosedp
carlosedp / .config
Created May 3, 2019 23:23
Odroid N2 Kernel config
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 4.9.170 Kernel Configuration
#
CONFIG_ARM64=y
CONFIG_64BIT=y
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_MMU=y
CONFIG_DEBUG_RODATA=y
CONFIG_ARM64_PAGE_SHIFT=12
@carlosedp
carlosedp / .gtkwaverc
Created February 11, 2023 14:51
GTKWave config
fontname_signals Menlo 16
fontname_waves Menlo 16
fill_waveform 1
use_roundcaps 1
wave_scrolling 1
disable_mouseover 0
highlight_wavewindow 1
use_scrollwheel_as_y on
@carlosedp
carlosedp / PipelineOps.scala
Last active January 23, 2023 12:42
Pipeline operators in Scala
#!/usr/bin/env -S scala-cli shebang
//> using scala "3"
/** Test functions */
val triple = (x: Int) => 3 * x
val half = (x: Int) => x / 2
val sum = (x: Int) => (y: Int) => x + y
/** with extension infix */
// extension [A, B](a: A)