Skip to content

Instantly share code, notes, and snippets.

View ogarcia's full-sized avatar

Óscar García Amor ogarcia

View GitHub Profile
@ogarcia
ogarcia / getmirrors.py
Last active November 27, 2016 12:57
Get full list of synced tier 1 Arch Linux mirrors
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 Óscar García Amor <ogarcia@connectical.com>
#
# Distributed under terms of the GNU GPLv3 license.
from time import strftime
@ogarcia
ogarcia / tmux_cheatsheet.md
Last active February 19, 2016 12:27 — forked from andreyvit/tmux.md
tmux cheatsheet and shortcuts

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf.

remap prefix to Control + a

@ogarcia
ogarcia / armv7h_chroot_under_x86_64.md
Last active February 14, 2016 11:45 — forked from mikkeloscar/guide.md
Setup armv7h chroot under x86_64 host (Archlinux/Archlinuxarm based)

Setup armv7h chroot under x86_64 host (Archlinux/Archlinuxarm based)

Simple way to setup an arm chroot for building packages for your arm devices. This is an alternative to cross-compiling where you are limited to only linking against the libs in your toolchain.

Setup chroot-fs

You can store the chroot wherever you like. I choose to store it in a disk-image which I mount to my filesystem.

@ogarcia
ogarcia / beets_config.yaml
Created December 14, 2015 16:04
Beets Config File
directory: ~/Música
import:
write: yes
copy: yes
id3v23: yes
per_disc_numbering: yes
paths:
disctotal:2..: $albumartist/$album%aunique{}/%right{$disc,1}-$track $title
@ogarcia
ogarcia / elasticsearch_nginx_template.json
Last active October 28, 2015 17:01
Elasticsearch template for use with nginx logs
{
"template": "nginx-*",
"settings": {
"index.number_of_shards": "5"
},
"mappings": {
"_default_": {
"properties": {
"auth": {
"index_name": "auth",

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

@ogarcia
ogarcia / post-commit
Created July 14, 2011 08:17 — forked from ajdiaz/git post-commit hook to dot files.
git post-commit hook to dot files
#! /bin/bash
# (c) 2010 Andres J. Diaz <ajdiaz@connectical.com>
# Modified 2011 by Ryan Turner <rjturner@cmu.edu>
# Modified 2011 by Oscar Garcia Amor <ogarcia@connectical.com>
# A hook to git-commit(1) to update the home dot files link using this
# repository as based.
#
# To enable this hook, rename this file to "post-commit".
for dot in $PWD/*; do