Skip to content

Instantly share code, notes, and snippets.

View thiagokokada's full-sized avatar

Thiago Kenji Okada thiagokokada

View GitHub Profile
@thiagokokada
thiagokokada / LEIAME.md
Last active November 13, 2024 01:46
[Vivo Fibra] Usando RTF3507VW-N1 em modo bridge

[Vivo Fibra] Usando RTF3507VW-N1 em modo bridge

Por que usar o RTF3507VW-N1 em modo bridge?

O roteador Askey RTF3507VW-N1 fornecido pela Vivo tem vários problemas:

  • Existe um cache interno de DNS (usando o dnsmasq?) bugado: ao fazer a mesma requisição DNS duas vezes seguidas, a primeira resposta vem correta, porém na seguinte temos:
@thiagokokada
thiagokokada / shell.nix
Last active July 27, 2021 15:45 — forked from Mic92/shell.nix
Nix FHS env for OpenWrt
{ pkgs ? import <nixpkgs> {} }:
let
fixWrapper = pkgs.runCommand "fix-wrapper" {} ''
mkdir -p $out/bin
for i in ${pkgs.gcc.cc}/bin/*-gnu-gcc*; do
ln -s ${pkgs.gcc}/bin/gcc $out/bin/$(basename "$i")
done
for i in ${pkgs.gcc.cc}/bin/*-gnu-{g++,c++}*; do
ln -s ${pkgs.gcc}/bin/g++ $out/bin/$(basename "$i")
@thiagokokada
thiagokokada / download_bb_if_not_exist.clj
Last active May 28, 2021 22:36
Script that downloads Babashka if not available and runs the file as a Babashka script afterwards
#!/usr/bin/env bash
#_(
bb_dir="$HOME/.bb"
if [ ! -x "$bb_dir/bb" ]; then
echo "Babashka not found. Installing it at $bb_dir directory..."
download_dir="$(mktemp -d)"
trap "rm -rf $download_dir" EXIT
@thiagokokada
thiagokokada / is_tty.clj
Last active April 29, 2021 03:33
Python's os.isatty() function equivalent to Babashka
#!/usr/bin/env bb
(ns is-tty
(:require [babashka.process :as p]))
(defn- is-tty
[fd key]
(-> ["test" "-t" (str fd)]
(p/process {key :inherit :env {}})
deref
@thiagokokada
thiagokokada / test_runner.clj
Last active July 5, 2024 14:35
Babashka's test runner that dynamically discover the tests
#!/usr/bin/env bb
;; Inspired from https://book.babashka.org/#_running_tests
(require '[clojure.test :as t]
'[clojure.string :as string]
'[babashka.classpath :as cp]
'[babashka.fs :as fs])
(cp/add-classpath "src:test")
@thiagokokada
thiagokokada / low-latency-kvm.md
Last active July 7, 2024 14:48
Low-latency KVM

Low-latency guests in KVM

Summary

Obtaining a low-latency guests in KVM (i.e.: low DPC latency for Windows guests) can be difficult. Without it, you may hear cracks/pops in audio or freezes in the VM, so they can be very annoying, specially for gaming dedicated VMs.

This document summarizes some of my findings on this subject.

Configuring KVM for real-time workloads

@thiagokokada
thiagokokada / resume.json
Last active March 21, 2024 10:47
resume.json
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Thiago Kenji Okada",
"label": "Senior Software Engineer",
"picture": "https://avatars2.githubusercontent.com/u/844343?s=460&u=b0a39e7e5e7079e199a81ba9bcce46648f1392af&v=4",
"email": "[email protected]",
"summary": "I am a Full Stack Senior Software Engineer with experience developing scalable applications in languages like Kotlin, Clojure and Ruby, frontend development with JavaScript and mobile development with Flutter. I also have experience in DevOps, mainly in AWS environment, working with tools like Ansible and Terraform and also managing multiple Kubernetes clusters. I have business experience in payment systems and financial services, and a computer science degree focused in distributed systems and cloud computing.",
"location": {
"city": "Dublin",

Keybase proof

I hereby claim:

  • I am thiagokokada on github.
  • I am thiagokokada (https://keybase.io/thiagokokada) on keybase.
  • I have a public key whose fingerprint is B291 6223 6D5D D544 24AB 0831 1CA3 07B3 74C1 BD81

To claim this, I am signing this object:

@thiagokokada
thiagokokada / mons.sh
Created December 31, 2018 17:13
Inlined version of mons
#!/bin/sh
###############################################################################
# ABOUT #
###############################################################################
# This is a modified version of mons v0.8.2 [1] with needed #
# liblist.sh v1.1 [2] functions included inline. #
# [1]: https://github.com/Ventto/mons/blob/v0.8.2/mons #
# [2]: https://github.com/Ventto/libshlist/blob/v1.1/liblist.sh #
###############################################################################
describe "+ 1.0 * 5" do
defmodule FakeIO do
defdelegate puts(message), to: IO
def gets("operation(1)> "), do: "+ 1.0"
def gets("operation(2)> "), do: "* 5"
def gets(_), do: "= 0.0"
end
test "accumulator should be 5.0" do
run = fn ->