Skip to content

Instantly share code, notes, and snippets.

@vfrico
vfrico / lines.sh
Created May 15, 2018 18:04
Read file line by line on bash
#!/bin/bash
# Usage: ./lines.sh lineas.txt
while IFS='' read -r line || [[ -n "$line" ]]; do
echo "$line"
done < "$1"
@vfrico
vfrico / ocrmypdf.PKGBUILD
Created May 15, 2018 17:53
PKGBUILD for ocrmypdf. The current version on the AUR is outdated and does not work
# Maintainer: mutantmonkey <aur@mutantmonkey.in>
# Contributor: Daniel Reuter <daniel.robin.reuter@googlemail.com>
# Contributor: Víctor Fernández Rico <vfrico@gmail.com>
pkgname=ocrmypdf
pkgver=6.1.5
pkgrel=1
pkgdesc="A tool to add an OCR text layer to scanned PDF files, allowing them to be searched"
url="https://github.com/jbarlow83/OCRmyPDF"
arch=('any')
license=('custom')
@vfrico
vfrico / unpaper_pdf.sh
Last active May 30, 2018 14:37
Wrapper for unpaper. Input is a double sided pdf book (scanned)
#!/bin/bash
# Usage: ./script.sh file.pdf
# Generate .png for each page on the PDF, assuming that the PDF is a scanned book.
# unpaper will crop and correct inclination and delete artifacts of each page
# Requirements:
# Ghostscript
# Unpaper (on arch repositories and https://github.com/Flameeyes/unpaper)
# basename (Maybe on coreutils package)1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Parametrizador MEL cepstrum
% Par�metros:
% Nombre del fichero de entrada: n_fichero
% Longitud de la ventana: l_v
% Desplazamiento: desplaza
% N�mero de bandas: n_bandas
% Filtrado de preenfasis: preen
% Salida gr�fica: dibuja
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@vfrico
vfrico / rename_images_to_list.py
Created March 15, 2017 18:14
Reorder images by EXIF date under same prefix
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# coding:utf-8
#
# rename_images_to_list.py: Reorder images by EXIF date under same prefix
# Copyright (C) 2017 Víctor Fernández Rico <vfrico@gmail.com>
#
# Thanks to Denis Barmenkov <denis.barmenkov@gmail.com>, for the original idea
# https://code.activestate.com/recipes/576646-exif-date-based-jpeg-files
# -rename-using-pil/
@vfrico
vfrico / Dockerfile
Created October 18, 2016 11:36
Dockerfile for vfrico/kge-server
FROM jupyter/scipy-notebook
MAINTAINER Daniel Vila Suero <dvilasuero@gmail.com>
MAINTAINER Víctor Fernández Rico <vfrico@gmail.com>
USER root
# install scikit-kge from github
#RUN git clone https://github.com/vfrico/scikit-kge.git
RUN git clone https://github.com/vfrico/kge-server.git
docker pull recognai/jupyter-scipy-kge
git clone https://github.com/vfrico/kge-wikidata
docker run -d -p 8888:8888 -v $PWD/kge-wikidata:/home/jovyan/work recognai/jupyter-scipy-kge
#!/usr/bin/env python3
class UnaClase():
def __init__(self):
self.atributo1 = 1
self.atributo2 = 2
lista = []
for i in range(0,10):
uc = UnaClase()

Keybase proof

I hereby claim:

  • I am vfrico on github.
  • I am vfrico (https://keybase.io/vfrico) on keybase.
  • I have a public key ASCrjyfbDwgtMe5Fg9OohCI6aXskZxNFUZL1u2CMxxQCAAo

To claim this, I am signing this object:

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define MAXIMO 15
int main(){
int t, total;
char text[MAXIMO];
total = 0;
printf("Introduce un texto: \n");