Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View fipar's full-sized avatar

Fernando Ipar fipar

View GitHub Profile
@fipar
fipar / profiler-hydra.el
Last active September 11, 2023 18:35
profiler-hydra.el
(global-set-key (kbd "s-p") 'hydra-profiler/body)
(defhydra hydra-profiler (:hint none :exit t)
"
Hydra Profiler (_q_uit)
_s_ start profiler
_x_ reset profiler
_k_ stop profiler
_r_ profiler report
"
("q" nil)
@fipar
fipar / copilot.el
Last active September 11, 2023 18:35
copilot.el
(execute-on-machine work-machine (add-to-list 'load-path
"~/l360/src/extern/copilot.el"))
(execute-on-machine work-machine (progn
(require 'copilot)
(define-key copilot-completion-map (kbd "y") 'copilot-accept-completion)
(define-key copilot-completion-map (kbd "n") 'copilot-next-completion)
(define-key copilot-completion-map (kbd "c") 'copilot-clear-overlay)
(global-set-key (kbd "s-u") 'copilot-complete)
))
@fipar
fipar / execute-on-machine.el
Created September 11, 2023 18:03
selectively execute elisp code depending on which machine I'm on
;; allow customizations per machine
(setq hostname (car (split-string system-name "\\.")))
(defmacro execute-on-machine (machine-name &rest body)
"Execute BODY only if the machine name matches MACHINE-NAME."
`(let ((current-machine hostname))
(when (string-equal current-machine ,machine-name)
,@body)))
(setq work-machine "mellotron")
@fipar
fipar / get_hyper_shortcuts.sh
Created April 29, 2020 15:23
Generate a pdf documenting my hyper and F keys emacs shortcuts
#!/bin/bash
target=hyper-shortcuts.tex
cat <<EOF>$target
\documentclass{article}
\pagestyle{empty}
\usepackage{longtable} % Because our table will spawn more than one page
\usepackage[dvipsnames]{xcolor} % To use commands like \textcolor{red}{]}
\title{Emacs Hyper and F key shortcuts}
\begin{document}
\maketitle
@fipar
fipar / cassandra-detail_rev2.json
Created November 4, 2018 14:46
cassandra-detail with deprecated count_scalar replaced by count(scalar(
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "with node exporter and jmx exporter",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@fipar
fipar / procs_using_swap.sh
Last active May 25, 2018 23:10
Get list of process names using swap in descending order (by swap usage). Assumes swap usage is printed in kb always, which I need to validate.
grep -r VmSwap /proc/[0-9][0-9]*/status 2>/dev/null|sort -k2 -nr | \
while read procentry meminkb; do
pid=$(echo $procentry|awk -F'/' '{print $3}')
echo "$(cat /proc/$pid/comm) ($pid): $meminkb"
done 2>/dev/null |more
# build.sh here is the build script shipped with gh-ost, but this should be usabe even if you just build via 'go build':
./build.sh 2>&1|grep 'cannot find'|awk '{print $5}'|tr -d '"' | xargs go get
@fipar
fipar / cassandra-pmm-docker-tests.sh
Last active April 23, 2018 21:12
Tests for the PMM external collectors plmce18 presentation
#!/bin/bash
cleanup_started_containers()
{
local _containers="pmm-server pmm-data cassandra1 cassandra2 cassandra3"
for container in $_containers; do
docker kill $container &>/dev/null
docker rm $container &>/dev/null
done
docker network rm pmm-network
@fipar
fipar / sysbenc_cassandra.txt
Created March 15, 2018 16:57
Running sysbench against Cassandra
telecaster:~ fipar$ docker run --name cassandra1 -d cassandra:latest
Unable to find image 'cassandra:latest' locally
latest: Pulling from library/cassandra
2a72cbf407d6: Pull complete
45339d0734a1: Pull complete
0881010f31a6: Pull complete
5331d043a453: Pull complete
c3eba8661eb9: Pull complete
9a8ad05c763b: Pull complete
e215e9518ddb: Pull complete
@fipar
fipar / agenda_tentativa_meetup_mysql_mvd_20171116.txt
Created November 15, 2017 14:54
Agenda tentativa para la meetup de Nov 16 en la UTU Buceo.
9:55 - intro/bienvenida
10:10 - Diferentes paradigmas de persistencia (Marcos Albe)
11:00 - break
11:10 - Group Replication in Action (Francisco Bordenave, Argentina)
11:40 - JSON en MySQL (David Ducos, Argentina)
12:10 - almuerzo
13:10 - Running database services on DC/OS (Gabriel Ciciliani, Argentina)
13:40 - Benchmarks - Breve reseña y ejemplos prácticos (Martin Arrieta)
14:10 - CockroachDB: una base de datos para el apocalipsis zombie (Fernando Ipar)
14:40 - Break