Skip to content

Instantly share code, notes, and snippets.

View vfrico's full-sized avatar

Víctor Fernández vfrico

View GitHub Profile
View gist:ddde3506e1f847764bf136945f4812bf
Status 500
Has experimentado un error técnico. Te pedimos disculpas.
Estamos trabajando para corregir este problema.
com.smilics.wibeee.exception.UnexpectedException: Unexpected error: DEVICE_NOT_FOUND at com.smilics.wibeee.db.dynamodb.service.DynamoDBService$_findTimeZone_closure20.doCall(DynamoDBService.groovy:550) at com.smilics.wibeee.db.dynamodb.service.DynamoDBService$_findTimeZone_closure20.doCall(DynamoDBService.groovy) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke( at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke( at java.base/java.lang.reflect.Method.invoke( at org.codehaus.groovy.reflection.CachedMethod.invoke( at groovy.lang.MetaMethod.doMethodInvoke( at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod( a
vfrico / nginx.conf
Created October 13, 2021 15:12
nginx proxy interno redirige
View nginx.conf
server {
listen 8181;
listen [::]:8181;
# Reenvía las peticiones a este servidor interno
location / {
proxy_pass http://localhost:8080;
#!/bin/env python3
import random
def get_random_exclude(*n):
while True:
ran = random.randint(0,2)
if ran not in n:
return ran
def montyhall(first_behaviour, second_behaviour):
vfrico /
Created December 6, 2018 12:15
Obtiene los divisores de un número (Versión recursiva)
def divisor_helper(n, i):
if i == 0:
return []
elif n % i == 0:
recursion = [i] + divisor_helper(n, i-1)
return recursion
return divisor_helper(n, i-1)

Fibonacci recursive with cache in Rust

This sample program aims to show how to pass an array by reference to other function in Rust, by using an array as a cache of the calculus of fibonacci sequence.

Rust can not hold a number greater than fib(185) on a u128 (unsigned integer 128 bits) type, so the program asks first to the user the n number and performs this

#!/usr/bin/env python3
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt
f = open("whatsapp.txt", "r")
list_messages = []
list_users = []
vfrico / Makefile
Last active March 5, 2019 23:37
Makefile para compilar un projecto en LaTeX
View Makefile
TEX_ENGINE=-pdflatex="pdflatex $(PDFLATEX_OPTS)"
# TEX_ENGINE=-xelatex
vfrico / virtuoso-local.service
Last active June 5, 2018 18:02
Systemd service to start virtuoso
View virtuoso-local.service
Description=Virtuoso service
ExecStart=/usr/local/virtuoso-opensource/bin/virtuoso-t +configfile /usr/local/virtuoso-opensource/var/lib/virtuoso/db/virtuoso.ini +foreground +wait
vfrico / make
Created May 29, 2018 10:46
Compilar virtuoso
View make
sudo apt-get install autoconf automake libtool flex bison gperf gawk m4 make libssl1.0-dev
vfrico / java_launcher.c
Created May 15, 2018 21:51
Java wrapper in C
View java_launcher.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
C program to launch a Java Jar (eg: Minecraft server)
The purpose is to create a binary file that can be set with the SETUID permissions and owned by root.
Using this way, the server can run on the 80 port without be asked the root password.