Skip to content

Instantly share code, notes, and snippets.

@xergio
xergio / Description.md
Created September 18, 2017 15:26 — forked from juanje/Description.md
Limit Chrome from eating all the memory and CPU

I was tired of Chrome eating all my laptop resources so I decided to put some limit to it with cgroup.

As I was using Ubuntu 12.04 with support for cgroup, I installed the package cgroup-bin and add the following group to the file /etc/cgconfig.conf:

group browsers {
    cpu {
#       Set the relative share of CPU resources equal to 25%
        cpu.shares = "256";
 }
@xergio
xergio / PROTECTED_REACT_GITLAB_RSYNC_NGINX.md
Created June 26, 2018 07:59 — forked from s-lyn/PROTECTED_REACT_GITLAB_RSYNC_NGINX.md
Deploy react app with gitlab.com and RSYNC

Deploy react app with gitlab.com and RSYNC

This is tutorial is about simple client-server file updating. This is not blue-green deploy!

Protocol: RSYNC through SSH. Tested on target server: Ubuntu 16.04 x64. (suitable for Ubuntu 14.x).

@xergio
xergio / dirlist.xslt
Created December 25, 2019 00:58 — forked from wilhelmy/dirlist.xslt
make nginx dirlistings look like lighttpd's through the magic of xslt-transforming xml dirlistings. I don't even.
<?xml version="1.0"?>
<!--
dirlist.xslt - transform nginx's into lighttpd look-alike dirlistings
I'm currently switching over completely from lighttpd to nginx. If you come
up with a prettier stylesheet or other improvements, please tell me :)
-->
<!--
Copyright (c) 2016 by Moritz Wilhelmy <[email protected]>
@xergio
xergio / gist:cb17a400ae6c4812db91266aa3902f4d
Created January 13, 2020 11:21 — forked from Saeven/gist:7832090
RAW Curl Post to AWS Kinesis with PHP
<?php
/*
POST / HTTP/1.1
Host: kinesis.<region>.<domain>
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=content-type;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
@xergio
xergio / Instructions
Created December 2, 2021 09:36 — forked from benscabbia/Instructions
Cloudflare + Dynamic DNS (ddclient) = Super Awesome
# This guide will show you how to configure ddclient to dynamically update your DNS at Cloudflare.
# This cookbook makes use of a number of online guides - all of which I will reference at the end.
# Cloudflare requires ddclient to be version 3.8.2 or you will get a 'cloudflare protocol didn't exist'.
# Unfortunately, the package manager at this time makes use of 3.8.1
# My suggestion is to follow the semi-autonomous process, by downloading the out of date package
# and then manually update a few files. If you prefer, you can go down the fully manual route manual route.
# Installation - Manual (Not Tested: https://www.cloudflare.com/technical-resources/#ddclient)
# Installation - Semi-Autonomous (Recommended, follow below)
@xergio
xergio / dhcpcd.conf
Created June 3, 2025 20:08 — forked from LuisPalacios/dhcpcd.conf
Servidor Norte: /etc/dhcpcd.conf
##
## Fichero /etc/dhcpcd.conf para Raspberry Pi OS 64 bits
## Servidor ‘norte’
##
## Este fichero está relacionado con este apunte:
## https://www.luispa.com/linux/2014/10/19/bridge-ethernet.html
##
## Configuración IP:
## `eth0` con una dirección IP fija.
## `eth1` inicialmente sin servicio.
@xergio
xergio / watch_eth_bridge_con_sur.timer
Created June 3, 2025 20:08 — forked from LuisPalacios/watch_eth_bridge_con_sur.timer
Norte: Vigila el túnel bridge ethernet con sur
[Unit]
Description=Vigila y activa el tunel ethernet bridge con Sur
[Timer]
# Cuanto espero tras el boot para ejecutar por primera vez
OnBootSec=1min
# Tiempo entre ejecuciones
OnUnitActiveSec=1min
# Nombre del servicio a ejecutar
Unit=watch_eth_bridge_con_sur.service
@xergio
xergio / watch_eth_bridge_con_sur.service
Created June 3, 2025 20:08 — forked from LuisPalacios/watch_eth_bridge_con_sur.service
Norte: Vigila el túnel bridge ethernet con sur
[Unit]
Description=Vigilante Bridge Ethernet con Sur
Wants=network-online.target internet_wait.service
After=network-online.target internet_wait.service
[Service]
Type=simple
ExecStart=/usr/bin/watch_eth_bridge.sh $WATCH_ETH_BRIDGE_OPTS
EnvironmentFile=-/etc/default/watch_eth_bridge_con_sur
@xergio
xergio / 50-usb-realtek-net.rules
Created June 3, 2025 20:10 — forked from LuisPalacios/50-usb-realtek-net.rules
Cambiar la configuración de los adaptadores ethernet Realtek USB
# This is used to change the default configuration of Realtek USB ethernet adapters
ACTION!="add", GOTO="usb_realtek_net_end"
SUBSYSTEM!="usb", GOTO="usb_realtek_net_end"
ENV{DEVTYPE}!="usb_device", GOTO="usb_realtek_net_end"
# Modify this to change the default value
ENV{REALTEK_MODE1}="1"
ENV{REALTEK_MODE2}="3"
# Este servicio comprueba si tengo acceso a internet y mientras que
# no lo tenga se queda esperando (sleep's de 1 seg). Es bastante útil
# cuando queremos que otros servicios esperen a tener internet.
#
# Crea el fichero /etc/systemd/system/internet_wait.service
# Instalar con:
# systemctl enable internet_wait.service
#
# En aquellos servicios que queremos que esperen a tener interent
# tenemos que modificar su fichero .service y añadir al final de