Skip to content

Instantly share code, notes, and snippets.

@fedealvz
fedealvz / Public-IP-from-nslookup.md
Created March 19, 2024 04:13
Obtener IP pública vía consulta de DNS

Obtener IP pública vía consulta de DNS

NSLOOKUP (Windows y Linux)

Devolverá la IPv4 o IPv6 usada para hacer la query de DNS.

nslookup -type=TXT o-o.myaddr.l.google.com ns1.google.com
@fedealvz
fedealvz / prueba-session.php
Last active September 7, 2023 21:07
Prueba de sesiones #session #PHP
<?php
// Más información: https://help.wnpower.com/hc/es/articles/19296028017677
// Forzar mostrar errores en pantalla
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
session_start();
@fedealvz
fedealvz / Apache-Vue-Router.htaccess
Last active August 16, 2023 05:33
Apache .htaccess para Vue, vue-router / Controller MVC
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
@fedealvz
fedealvz / wordpress-multisite-internal-redirect-loop.md
Created May 14, 2023 22:36 — forked from JustThomas/wordpress-multisite-internal-redirect-loop.md
WordPress Multisite: How to fix error "too many redirects"

WordPress Multisite: How to fix error "Request exceeded the limit of 10 internal redirects"

I am running a WordPress multisite network with sub-directory setup. When I check my error.log file, it is full of entries like this one:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'Limit InternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

The problem was, in my case, one specific rewrite rule in the .htaccess file.

Problem description

@fedealvz
fedealvz / compare_php_ini.py
Created December 29, 2022 01:56 — forked from tkhduracell/compare_php_ini.py
Compare two php.ini files using Python
#!/usr/bin/python
import re
import argparse
def main():
parser = argparse.ArgumentParser(description='Compare two php.ini files')
parser.add_argument('file1', metavar='first_php_ini', type=str, help='First file to compare')
parser.add_argument('file2', metavar='second_php_ini', type=str, help='Second file to compare')
@fedealvz
fedealvz / osxvpnrouting.markdown
Created December 29, 2021 15:02 — forked from taldanzig/osxvpnrouting.markdown
Routing tips for VPNs on OS X

Routing tips for VPNs on OS X

When VPNs Just Work™, they're a fantastic way of allowing access to a private network from remote locations. When they don't work it can be an experience in frustration. I've had situations where I can connect to a VPN from my Mac, but various networking situations cause routing conflicts. Here are a couple of cases and how I've been able to get around them.

Specific cases

Case 1: conflicting additional routes.

In this example the VPN we are connecting to has a subnet that does not conflict with our local IP, but has additional routes that conflict in some way with our local network's routing. In my example the remote subnet is 10.0.x.0/24, my local subnet is 10.0.y.0/24, and the conflicting route is 10.0.0.0/8. Without the later route, I can't access all hosts on the VPN without manually adding the route after connecting to the VPN:

@fedealvz
fedealvz / Readme.md
Last active May 27, 2021 02:07
Ignore global de archivos .DS_Store

Ignore global de archivos .DS_Store

El archivo .DS_Store lo usa MacOS para guardar la configuración de Finder (posición de iconos, vistas, etc.)

Dicho archivo oculto se cola en los repos de Git y no aporta nada.

Hay un comando para desactivar .DS_Store en MacOS, pero sólo aplica a unidades externas (ej. unidades de red y pendrives):

defaults write com.apple.desktopservices DSDontWriteNetworkStores true
@fedealvz
fedealvz / README.md
Created August 25, 2020 04:09
Git.io: GitHub URL Shortener
@fedealvz
fedealvz / .htaccess
Created August 17, 2020 05:11
WordPress .htaccess por defecto
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
@fedealvz
fedealvz / widget.js
Created July 29, 2020 19:35
Zendesk Widget Configuration Options
//Show and hide
zE('webWidget', 'hide');
zE('webWidget', 'show');
zE('webWidget', 'clear');
zE('webWidget', 'toggle');
zE('webWidget', 'reset');
zE('webWidget', 'open');
//Click to show
// <a href="javascript:void(0);" id="showWidget" onclick="zE(function() {zE.show();});">Open widget on click</a>