Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# coding: utf8
"""plot offset"""
import os
import concurrent.futures
from datetime import datetime, timedelta
import subprocess
import json
@emctoo
emctoo / .env.example
Last active May 25, 2025 01:20
Kafka Replay
# Kafka connection settings
BOOTSTRAP_SERVERS=localhost:9092
# Topic to replay messages from (required)
topic=your-kafka-topic
# Time range settings (timestamp format - default approach)
START_TIME=2025-05-16T00:00:01
END_TIME=2025-05-16T23:59:59
@emctoo
emctoo / .gitignore
Last active May 14, 2025 07:31
A simple file server
.env
.envrc

Setting up qemu VM using nix flakes

Did you know that it is rather easy to setup a VM to test your NixOs configuration?

Create simple flake:

# flake.nix
{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
@emctoo
emctoo / starship.toml
Created May 27, 2022 07:09
~/.config/starship.toml
# ~/.config/starship.toml
# Don't print a new line at the start of the prompt
add_newline = false
[cmd_duration]
show_milliseconds = true
format = "took [$duration](bold yellow) "
[character]
@emctoo
emctoo / snat-dnat.md
Last active April 11, 2022 08:22
nat.md

ip forward

sudo modprobe ip_tables
sudo modprobe ip_conntrack
sudo modprobe iptables_nat

sysctl -w net.ipv4.ip_forward = 1
@emctoo
emctoo / .babelrc
Last active February 1, 2019 02:24
webpack for phoenix, integrated with vue, needs some cleanup
{
"presets": [
[
"@babel/preset-env",
{
"targets":
{
"browsers": [
"last 2 Chrome versions"
]
@emctoo
emctoo / cycle.go
Created December 20, 2016 14:41
feh momentum
package main
import (
"fmt"
"io/ioutil"
"log"
"math/rand"
"os"
"os/exec"
"syscall"