Skip to content

Instantly share code, notes, and snippets.

View guillorrr's full-sized avatar

Guillermo Baron guillorrr

View GitHub Profile
@guillorrr
guillorrr / functions.ftl
Created June 5, 2024 12:39
freemarker functions
abs
absolute_template_name
ancestors
api
boolean
byte
c
c_lower_case
c_upper_case
cap_first
@guillorrr
guillorrr / api_request_debug.php
Created January 28, 2024 00:35
api request debug
<?php
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
header("Allow: GET, POST, OPTIONS, PUT, DELETE");
$method = $_SERVER['REQUEST_METHOD'];
if($method == "OPTIONS") {
die();
}
header('Content-Type: application/json');
@guillorrr
guillorrr / bash-rename.sh
Created October 22, 2023 23:00
Bash scripts
#!/bin/bash
# Leer los archivos de listado a.txt y b.txt en dos arrays
mapfile -t listado_a < old.txt
mapfile -t listado_b < new.txt
# Verificar si los tamaños de los listados son iguales
if [ ${#listado_a[@]} -ne ${#listado_b[@]} ]; then
echo "Los tamaños de los listados no coinciden."
exit 1
@guillorrr
guillorrr / enable-remote-connections-for-datastudio.sh
Created December 27, 2021 13:34
Enable remote connections to a mysql server for google data studio
# edit the my.cnf file in /etc/mysql and add the line
bind-address=0.0.0.0
# and if you have the line:
skip-networking
# make sure to comment it:
#skip-networking
# restart mysql
sudo service mysql restart
---
version: "2"
services:
emby:
image: linuxserver/emby
container_name: emby
environment:
- PUID=998
- PGID=100
- TZ=America/Denver
@guillorrr
guillorrr / queue.txt
Last active October 31, 2024 15:38
Lista de filtros para evitar hacer filas virtuales en queue-it con adblocker plus
[Adblock Plus 2.0]
! Title: Evitar filas virtuales by @guillorrr
! Expires: 1 hour
! Homepage: https://gist.github.com/guillorrr/7e3928e42c98b9b6bb99b9783b22457c
! Licence: https://www.wtfpl.net/txt/copying/
! Homepage: https://guillo.dev
! Version:
! Last modified:
||queue-it.net^
@guillorrr
guillorrr / simplify3d.sh
Last active March 4, 2021 16:46
Simplify3d install
chmod +x Simplify3D-4.0.0-*
sudo chmod +x Simplify3D-4.0.0-*
sudo ./Simplify3D-4.0.0-*
sudo cp Interface.so /opt/Simplify3D-4.0.0/
sudo nano /etc/hosts
#
127.0.0.1 api.simplify3d.com
#
@guillorrr
guillorrr / phpmyadmin.conf
Last active September 1, 2020 16:16
Change phpMyAdmin port from 80 to another number
Listen 8081
<VirtualHost *:8081>
ServerName localhost
<Directory /usr/share/phpmyadmin>
AllowOverride None
Require all granted
</Directory>
@guillorrr
guillorrr / functions.php
Created August 22, 2018 12:18
Retrieving WordPress Sidebar Widget Options
/**
* Find a given widget in a given sidebar and return its settings.
*
* Example usage:
* $options = [];
* try {
* $options = get_sidebar_widget_options('sidebar-1', 'recent-comments');
* } catch (Exception $e) {}
*
* @param $sidebar_id The ID of the sidebar. Defined in your register_sidebar() call
@guillorrr
guillorrr / install.sh
Last active February 24, 2021 13:15
Macabre Workstation
curl https://repogen.simplylinux.ch/txt/yakkety/sources_153f25ac5d13da491141a705aaa364af3987018d.txt | sudo tee /etc/apt/sources.list
sudo curl https://repogen.simplylinux.ch/txt/yakkety/sources_153f25ac5d13da491141a705aaa364af3987018d.txt | sudo tee /etc/apt/sources.list
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install htop terminator screen ssh wicd
mkdir deb
cd deb
wget -c https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt update && sudo apt install libappindicator1 libpango1.0-0 libpangox-1.0-0
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get install exfat-fuse exfat-utils hfsplus hfsutils ntfs-3g