Skip to content

Instantly share code, notes, and snippets.

@ja-mf
ja-mf / setup.md
Created August 23, 2021 18:55 — forked from Yatoom/setup.md
Thinkfan configuration

Thinkfan setup

Note: I configured this thinkfan setup for my old Thinkpad w520 on Ubuntu 17.10.

1. Install necessary programs

Install lm-sensors and thinkfan.

sudo apt-get install lm-sensors thinkfan
@ja-mf
ja-mf / .tmux.conf
Created June 26, 2021 14:28
.tmux.conf
# cat << EOF > /dev/null
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# /!\ do not edit this file
# instead, override settings in ~/.tmux.conf.local, see README.md
# -- general -------------------------------------------------------------------
@ja-mf
ja-mf / .vimrc
Created June 26, 2021 14:27
.vimrc python
call plug#begin('~/.vim/plugged')
Plug 'williamjameshandley/vimteractive'
Plug 'valloric/youcompleteme'
Plug 'gruvbox-community/gruvbox'
Plug 'lervag/vimtex'
Plug 'tpope/vim-surround'
Plug 'anosillus/vim-ipynb'
Plug 'jpalardy/vim-slime', { 'for': 'python' }
Plug 'hanschen/vim-ipython-cell', { 'for': 'python' }
Plug 'ludovicchabant/vim-gutentags'
@ja-mf
ja-mf / replace_code.sh
Created October 24, 2012 08:50
replace a block of text multiple files
#!/bin/bash
# replace the line 1 and the first match of STRING with new_code
# of all files in find.
for file in $(find . -type f -name '*'); do
mv $file $file.old
cat new_code <(sed '1,/STRING/d' $file.old) > $file
rm $file.old
done
@ja-mf
ja-mf / nbspam.py
Created October 23, 2012 16:10
naive-bayes spam filter
from __future__ import division
import string
class BayesianSpam:
# training-set[categoria] := lista de mails en una categoria
# mail := lista de palabras
training = {'spam': [], 'no-spam': []}
# probabilidades de cero ocurrencia en cada categoria, a priori
# y de ocurrencia de cada palabra en cada categoria.
@ja-mf
ja-mf / cv.tex
Created October 7, 2012 22:10
cv-template latex
\documentclass[margin]{res}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{graphics}
\usepackage{graphicx}
%\usepackage{amsmath}
\usepackage{textpos}
\oddsidemargin -.5in
\evensidemargin -.5in
@ja-mf
ja-mf / README
Created September 13, 2012 20:02
check_sendmail nagios.
1. Configurar el path para el maillog, setear MAILLOG en check_postfix y update_postfix_stats
2. Copiar archivos al directorio de plugins de nagios y bin
3. Dar permisos al usuario definido en nrpe.cfg para que pueda leer maillog
4. Agregar al crontab:
*/5 * * * * root /usr/local/bin/update_postfix_stats
@ja-mf
ja-mf / rsync
Created September 13, 2012 19:40
rsync
#/bin/bash
if [ ! "$(pidof rsync)" ]
then
rsync -ansd-js
else
echo "rsync andando"
fi