Skip to content

Instantly share code, notes, and snippets.

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(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263) a
@vfrico
vfrico / nginx.conf
Created October 13, 2021 15:12
nginx proxy interno redirige
server {
listen 8181;
listen [::]:8181;
server_name domain.name.example.com;
# 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
vfrico / divisores.py
Created December 6, 2018 12:15
Obtiene los divisores de un número (Versión recursiva)
#!/usr/bin/python3
def divisor_helper(n, i):
if i == 0:
return []
elif n % i == 0:
recursion = [i] + divisor_helper(n, i-1)
return recursion
else:
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
vfrico / Makefile
Last active March 5, 2019 23:37
Makefile para compilar un projecto en LaTeX
MAIN_LATEX=latex_file
BUILD_DIR=build/
LATEXMK_OPTS="-output-directory=$(BUILD_DIR)"
PDFLATEX_OPTS="--output-directory=$(BUILD_DIR)"
TEX_ENGINE=-pdflatex="pdflatex $(PDFLATEX_OPTS)"
# TEX_ENGINE=-xelatex
@vfrico
vfrico / virtuoso-local.service
Last active June 5, 2018 18:02
Systemd service to start virtuoso
[Unit]
Description=Virtuoso service
After=network.target
Requires=network.target
[Service]
Type=simple
ExecStart=/usr/local/virtuoso-opensource/bin/virtuoso-t +configfile /usr/local/virtuoso-opensource/var/lib/virtuoso/db/virtuoso.ini +foreground +wait
@vfrico
vfrico / make virtuoso.sh
Created May 29, 2018 10:46
Compilar virtuoso
sudo apt-get install autoconf automake libtool flex bison gperf gawk m4 make libssl1.0-dev
./configure
make
@vfrico
vfrico / java_launcher.c
Created May 15, 2018 21:51
Java wrapper in 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.