Skip to content

Instantly share code, notes, and snippets.

View alexrios's full-sized avatar
🦎
Zigging around

Alex Rios alexrios

🦎
Zigging around
View GitHub Profile
@alexrios
alexrios / install_flipt.sh
Created January 2, 2024 20:41
Installing flipt from releases
#!/bin/bash
# Set default values if not already set
: ${FLIPT_VERSION:="1.34.0"}
: ${ARCH:="linux_x86_64"}
# Check if the script is running as root (sudo)
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root. Please use sudo."
exit 1
@alexrios
alexrios / shell.nix
Created December 29, 2023 19:29
nix shell for OpenAI Whisper
{ pkgs ? import <nixpkgs> {}} :
pkgs.mkShell {
buildInputs = [
pkgs.python3
pkgs.poetry
pkgs.python311Packages.torch
pkgs.ffmpeg_5-full
pkgs.openai-whisper
];
}
@alexrios
alexrios / text-generation-webui.txt
Created July 28, 2023 02:04
Instructions to use any LLM model locally
# this tutorial assumes conda and git are both installed on your computer
conda create -n tg python=3.10.9
conda activate tg
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
git clone https://github.com/oobabooga/text-generation-webui.git
cd text-generation-webui
pip install -r requirements.txt
# GPU only:
# this tutorial assumes conda and git are both installed on your computer
conda create -n tg python=3.10.9
conda activate tg
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
git clone https://github.com/oobabooga/text-generation-webui.git
cd text-generation-webui
pip install -r requirements.txt
# GPU only:
How We Do Code Review
Lukas Spieß
September 22nd, 2017
Visual Studio Mobile Center is now Visual Studio App Center. Learn more here. The Mobile Center team is a diverse mix of engineers, product managers, and UI/UX designers with varying professional backgrounds, experience, and countries of origin. Our team has people from over 10 countries working across 8 time zones. Some are fresh out of college, while others have been in the industry for more than 20 years, and we all came in with our own understanding and definition of “code review.”
We spend a significant part of our day doing code review in GitHub and Visual Studio Team Services, so we welcome anything that makes it faster, easier, and better. After pinpointing several common pain points, we established and widely circulated a common set of code review principles for submitters and reviewers.
@alexrios
alexrios / main.go
Created October 2, 2022 21:19
TSE Presidenciaveis 2022 - Go version
package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"time"
)
@alexrios
alexrios / redMetricsMiddleware.go
Created July 28, 2022 20:35
Tally based RED metrics middleware
package middleware
import (
"net/http"
"github.com/uber-go/tally/v4"
)
type statusCodeAwareWriter struct {
http.ResponseWriter
@alexrios
alexrios / goimports.sh
Created July 12, 2022 13:24
goimports excluding folders
DIRS=$(go list -f {{.Dir}} ./... | grep -vE 'docs|proto|gen')
for d in $DIRS; do goimports -w $d/*.go; done
@alexrios
alexrios / new_8G_swap.sh
Created August 22, 2021 23:47
Create swap file on Arch (run with sudo)
#!/bin/sh
fallocate -l 8G /swapfile
chmod 600 /swapfile
mkswap /swapfile
echo '/swapfile none swap sw 0 0 ' | tee -a /etc/fstab
## 1 - reboot
## 2 - check swap with: cat /proc/meminfo | grep SwapTotal
@alexrios
alexrios / regras-do-encontro.md
Last active October 18, 2022 21:25
System Design BR - Discussão das regras do encontro

Regras do encontro

Concordar em discordar.

Seja educado! Não existe uma maneira única de experimentar ou interpretar um conteúdo. Na verdade, opiniões divergentes são boas e bem vindas.

Seja gentil, mas firme.

Insistiremos para que o tempo de discussão seja limitado ao conteúdo.

Não monopolize a conversa

Nunca é fácil. “Vamos ouvir alguns outros” é uma abordagem. Podemos ter uma estratégia sobre só uma pessoa falar, e as pessoas que querem falar devem "levantar a mão".