Skip to content

Instantly share code, notes, and snippets.

View 524c's full-sized avatar

Roger 524c

  • Brazil
  • 15:57 (UTC -03:00)
  • X @0x524c
View GitHub Profile
@524c
524c / tmux-cheat-sheet.md
Created February 18, 2025 03:31 — forked from michaellihs/tmux-cheat-sheet.md
tmux Cheat Sheet
@524c
524c / 8-concurrent-generations.md Aggregate throughput just over 2 tok/sec on R1 671B with 8 concurrent generations.

tl;dr;

You can run the real deal big boi R1 671B locally off a fast NVMe SSD even without enough RAM+VRAM to hold the 200+GB weights. No it is not swap and won't kill your SSD's read/write cycle lifetime.

  • 8k context @ ~1.3 tok/sec single generation
  • 16k context @ ~0.93 tok/sec single generation
  • 2k context @ ~2.08 tok/sec with 8 parallel slots @ ~0.26 tok/sec each concurrently
  • 2k context @ ~2.13 tok/sec single generation after disabling GPU!

Notes and example generations below.

Creating the license
Monokai Pro requires an email to purchase a license, so we're going to need one here. I'm going to use a placeholder address: [email protected].
Sublime Text 3 -
Take your email address and get the MD5 hash of it; you can use a website like https://www.md5hashgenerator.com/ for this. My test email comes out with 5658ffccee7f0ebfda2b226238b1eb6e or use https://monogen.vercel.app/.
Now, take the first 25 characters (so 5658ffccee7f0ebfda2b22623 for me), and insert a - after every 5 characters. You'll now have a valid license; in my case, it's 5658f-fccee-7f0eb-fda2b-22623.
Visual Studio Code -
To get it to work with VScode, you need to MD5 the extension UUID with the email you want to use and use the first 25 characters of the MD5 hash for VScode.
@524c
524c / nginx_deployment.yaml
Created June 21, 2024 13:46 — forked from petitviolet/nginx_deployment.yaml
sample Nginx configuration on Kubernetes using ConfigMap to configure nginx.
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
nginx.conf: |
user nginx;
worker_processes 3;
error_log /var/log/nginx/error.log;
events {

Upgrading Kubernetes Cluster with Kops, and Things to Watch Out For

Alright! I'd like to apologize for the inactivity for over a year. Very embarrassingly, I totally dropped the good habit. Anyways, today I'd like to share a not so advanced and much shorter walkthrough on how to upgrade Kubernetes with kops.

At Buffer, we host our own k8s (Kubernetes for short) cluster on AWS EC2 instances since we started our journey before AWS EKS. To do this effectively, we use kops. It's an amazing tool that manages pretty much all aspects of cluster management from creation, upgrade, updates and deletions. It never failed us.

How to start?

Okay, upgrading a cluster always makes people nervous, especially a production cluster. Trust me, I've been there! There is a saying, hope is not a strategy. So instead of hoping things will go smoothly, I always have bias that shit will hit the fan if you skip testing. Plus, good luck explaining to people

Install ffmpeg

brew install ffmpeg

Download file through url, like this:

ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "http://url-file.domain.m3u8" -c copy video.mp4
@524c
524c / esmodules.md
Created September 14, 2023 14:58 — forked from danpetitt/esmodules.md
Typescript, Jest and ECMAScript Modules

Typescript, Jest and ECMAScript Modules (ESM)

Package.json

Add the type property to package.json to ensure modules are supported:

{
  "type": "module",
}
@524c
524c / libevent-example.c
Created August 16, 2023 12:42 — forked from ajhwb/libevent-example.c
Asynchronous network I/O using libevent
/*
* Libevent is a high-performance and portable asynchronous networking I/O library (http://libevent.org)
* This is small program to demonstrate the basic of libevent programming
*
* Copyright (C) 2012, Ardhan Madras <[email protected]>
*/
#include <event.h>
#include <arpa/inet.h>
#include <netinet/in.h>
@524c
524c / saga-sample.js
Created April 27, 2023 15:43 — forked from icebob/saga-sample.js
Saga middleware PoC for Moleculer
"use strict";
const _ = require("lodash");
const chalk = require("chalk");
const Promise = require("bluebird");
const ServiceBroker = require("../src/service-broker");
const { MoleculerError } = require("../src/errors");
// --- SAGA MIDDLEWARE ---
const SagaMiddleware = function() {