Skip to content

Instantly share code, notes, and snippets.

View guitmz's full-sized avatar

Guilherme Thomazi Bonicontro guitmz

View GitHub Profile
@ethan-leba
ethan-leba / readme.org
Last active May 22, 2024 12:00
Yabai + Emacs seamless window movement

Yabai + Emacs window movement integration

This is a short guide to setting up unified window movement bindings with Yabai + SKHD and Emacs, inspired by this tmux-vim movement guide. Short video demo here.

For example, if there’s if Emacs is in focus and there’s an Emacs window to the left, then that window will be focused with the binding. Otherwise, the next application to the left will be focused. In this guide I’m using alt - HJKL, but you can substitute those with whatever you’d like.

@alexhude
alexhude / ImHex.diff
Last active February 4, 2021 19:21
Build ImHex for macOS
diff --git a/source/helpers/crypto.cpp b/source/helpers/crypto.cpp
index fa23428..e0ef3ad 100644
--- a/source/helpers/crypto.cpp
+++ b/source/helpers/crypto.cpp
@@ -41,7 +41,7 @@ namespace hex {
std::array<u8, 512> buffer = { 0 };
for (u64 bufferOffset = 0; offset < size; offset += buffer.size()) {
- const u64 readSize = std::min(buffer.size(), size - bufferOffset);
+ const u64 readSize = std::min((u64)buffer.size(), size - bufferOffset);
@muff-in
muff-in / resources.md
Last active May 19, 2024 21:45
A curated list of Assembly Language / Reversing / Malware Analysis / Game Hacking-resources
@max-rocket-internet
max-rocket-internet / prom-k8s-request-limits.md
Last active May 17, 2024 08:02
How to display Kubernetes request and limit in Grafana / Prometheus properly

CPU: percentage of limit

A lot of people land when trying to find out how to calculate CPU usage metric correctly in prometheus, myself included! So I'll post what I eventually ended up using as I think it's still a little difficult trying to tie together all the snippets of info here and elsewhere.

This is specific to k8s and containers that have CPU limits set.

To show CPU usage as a percentage of the limit given to the container, this is the Prometheus query we used to create nice graphs in Grafana:

sum(rate(container_cpu_usage_seconds_total{name!~".*prometheus.*", image!="", container_name!="POD"}[5m])) by (pod_name, container_name) /
@clemera
clemera / mode-line+.el
Last active August 20, 2023 01:26
mode-line+
;;; -*- lexical-binding: t; -*-
;; doom-mode-line > mood-line > mode-line+
;; * Deps
(defvar anzu--state nil)
(defvar multiple-cursors-mode nil)
(declare-function flycheck-count-errors "ext:flycheck" (errors))
(declare-function anzu--update-mode-line "ext:anzu" ())
(declare-function mc/num-cursors "ext:multiple-cursors" ())
@rubencaro
rubencaro / setup_go.md
Last active April 28, 2024 21:52
Golang installation guide

Golang installation guide

Since Golang version 1.11 this process is finally (almost) as easy as it should (!!). You can see full docs here. For older guides see here.

These are my notes, not a generic solution. They are not meant to work anywhere outside my machines. Update version numbers to whatever are the current ones while you do this.

Installing everything needed the first time

Install asdf and its golang plugin, then install golang

@zacharycarter
zacharycarter / wclwn.md
Last active March 12, 2024 12:45
Binding to C Libraries with Nim
@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@mhubig
mhubig / Dockerfile
Last active November 3, 2023 03:42
Alpine Linux based cronjob runner
FROM alpine:latest
RUN apk add --update php python py-pip mysql-client \
&& pip install awscli \
&& rm -rf /var/cache/apk/*
RUN touch crontab.tmp \
&& echo '* */6 * * * /usr/bin/php /var/www/partkeepr/app/console partkeepr:cron:run' > crontab.tmp \
&& echo '0 2 * * * /usr/bin/sql_backup' >> crontab.tmp \
&& crontab crontab.tmp \