Skip to content

Instantly share code, notes, and snippets.

@pniaps
pniaps / Build_seed_iso
Created March 20, 2023 18:07 — forked from asvignesh/Build_seed_iso
Samples to create a cloud-init configuration ISO.
$ genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data
@pniaps
pniaps / backup.sh
Created February 20, 2023 01:29 — forked from aymencis/backup.sh
OVH NFS BACKUP
#!/bin/sh
# BACKUP SCRIPT
CONTACT="email@email.com"
MAIL="/tmp/mail"
if [ -e "/var/lock/backup.lock" ]
then
echo " BACKUP ALREADY STARTED !!" > $MAIL
@pniaps
pniaps / openwrt.md
Last active April 28, 2021 17:38
Apuntes OpenWRT

Cambiar rango de la red del router

uci set network.lan.ipaddr=192.168.2.1;
uci commit;
/etc/init.d/network restart

Permitir WebUI desde WAN

uci add firewall rule
uci set firewall.@rule[-1].name='Allow-WEB-wan'

@pniaps
pniaps / pc componentes
Last active October 20, 2020 17:41
Ordenar ofertas de pccomponentes por descuento
//https://stackoverflow.com/questions/282670/easiest-way-to-sort-dom-nodes
var list = document.querySelectorAll('.row.page-0');
var items = list[0].childNodes;
var itemsArr = [];
for (var i in items) {
if (items[i].nodeType == 1) { // get rid of the whitespace text nodes
itemsArr.push(items[i]);
}
cat << 'EOF' > /etc/uci-defaults/reset_wan
#!/bin/sh
(crontab -l ; echo "*/5 * * * * sh /usr/bin/reset_wan") | sort | uniq | crontab -
/etc/init.d/cron start
/etc/init.d/cron enable
exit 0
EOF
chmod +x /etc/uci-defaults/reset_wan
cat << 'EOF' > /usr/bin/reset_wan
@pniaps
pniaps / install_git.sh
Created March 12, 2018 02:34
Install GIT Centos 7
#install git with user
yum install git
adduser git
passwd git
su git
cd
#add public keys to folder and generate autorized keys
mkdir /home/git/.ssh
chmod 700 /home/git/.ssh
@pniaps
pniaps / setup_server.sh
Last active March 5, 2018 09:04
CentOS 7 httpd - php7 - MariaDB 10.2
yum -y install httpd mod_ssl
systemctl start httpd.service
systemctl enable httpd.service
yum -y install epel-release yum-utils
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php72
yum -y install php php-fpm php-mysql php-mbstring php-dom php-xml php-gd
cat << EOF > /etc/yum.repos.d/MariaDB.repo
@pniaps
pniaps / TwigRenderer.php
Created July 14, 2017 12:54 — forked from stof/TwigRenderer.php
Rendering twig blocks directly from outside a twig render call, for email purpose
<?php
namespace Incenteev\MailerBundle\Mailer;
class TwigRenderer implements RendererInterface
{
private $twig;
private $styleInliner;
/**
@pniaps
pniaps / README.md
Created June 14, 2017 08:39 — forked from mindplay-dk/README.md
ISO 3166-2 Country and State/Region Tables for MySQL