Skip to content

Instantly share code, notes, and snippets.

@xezpeleta
xezpeleta / Modelfile
Created January 31, 2024 22:53
latxa-7b-instruct Modelfile
FROM ./latxa-7b-instruct-f16.gguf
SYSTEM """
Euskarazko chatbot laguntzailea zara. Erabiltzailearen galderei modu zuzen eta egokian erantzungo diozu.
"""
TEMPLATE """[INST] {{ if and .First .System }}<<SYS>>{{ .System }}<</SYS>>
{{ end }}{{ .Prompt }} [/INST] """
@xezpeleta
xezpeleta / edgerouter_dns.md
Created January 22, 2019 12:11
Dynamic DNS on the Ubiquiti EdgeRouter X

Ubiquiti EdgeRouter X: custom dynamic DNS

ssh ubnt@<your-ip>
configure

Obtain your public IP address behind a NAT: using ipinfo.io

@xezpeleta
xezpeleta / README.md
Last active January 26, 2024 16:40
Video stabilization with Dockerized FFMPEG
#
# ffmpeg shipped with Ubuntu 18.04 doesn't have libvidstab enabled
# That's why I'm using a dockerized ffmpeg
#

docker run -it -v $(pwd):/tmp jrottenberg/ffmpeg -i /tmp/myvideo.mp4 -vf vidstabdetect=shakiness=5:show=1 /tmp/dummy.mp4
docker run -it -v $(pwd):/tmp jrottenberg/ffmpeg -i /tmp/myvideo.mp4 -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 /tmp/stabilized-output.mp4
@xezpeleta
xezpeleta / tomcat_recovery.sh
Created December 13, 2018 08:04
Tomcat auto-recovery
#! /bin/bash
URL=http://localhost
LOGFILE=/root/scripts/mywebapp_recovery.log
TIMEOUT=5
response=`curl -m $TIMEOUT -s -o /dev/null -w "%{http_code}" $URL`
if [[ "$response" != 200 ]];then
printf '[%(%d/%b/%Y:%H:%M:%S %z)T] Response code: %s\n' -1 "$response" >> $LOGFILE
# Shutdown Tomcat
@xezpeleta
xezpeleta / opeenssl_certificates.md
Last active November 7, 2018 10:22
Certs cheatsheet

Check certificate details

openssl x509 -in ca.crt -noout -text

Check certificate expiration date

openssl x509 -in ca.crt -noout -enddate
@xezpeleta
xezpeleta / LICENSE
Created June 17, 2018 12:14 — forked from mepcotterell/LICENSE
Simple Python Plugin Manager
The MIT License (MIT)
Copyright (c) 2013 Michael E. Cotterell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@xezpeleta
xezpeleta / sleep-visualizer.R
Created June 14, 2018 18:23
R and Shiny, linked selectInputs
library(shiny)
# Just to use msleep dataset
library(ggplot2)
# Remove NAs
msleep = msleep[complete.cases(msleep), ]
ui <- fluidPage(
sidebarLayout(
#!/bin/bash
set -e
# Source debconf library.
. /usr/share/debconf/confmodule
dbhost=`sed -n 's/^[ \t]*database_host:[ \t]*\([^ #\t]*\).*/\1/p' /etc/elkarbackup/parameters.yml`
dbname=`sed -n 's/^[ \t]*database_name:[ \t]*\([^ #\t]*\).*/\1/p' /etc/elkarbackup/parameters.yml`
dbusername=`sed -n 's/^[ \t]*database_user:[ \t]*\([^ #\t]*\).*/\1/p' /etc/elkarbackup/parameters.yml`
dbuserpassword=`sed -n 's/^[ \t]*database_password:[ \t]*\([^ #\t]*\).*/\1/p' /etc/elkarbackup/parameters.yml`
@xezpeleta
xezpeleta / gist:93abfabfc2e9163202b50b2f4cb728ff
Created May 30, 2017 10:16 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>