Warning phpMyAdmin Parameter Countable

Al instalar phpMyAdmin con PHP 7.2, nos da el siguiente error en la vista de las tablas:

Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable

Corregir editando: /usr/share/phpmyadmin/libraries/sql.lib.php

Cambiar: (count($analyzed_sql_results['select_expr'] == 1)

Por: ((count($analyzed_sql_results['select_expr']) == 1)

Resolver error Nginx: upstream sent too big header while reading response header from upstream

Resolver “[error] upstream sent too big header while reading response header from upstream” en NGINX.

Reemplazar en /etc/nginx/fastcgi.conf la configuración por defecto, en mi caso de EasyEngine con servidor web NGINX + fastcgi, los parametros de fastcgi_buffers y fastcgi_buffer_size.

# FastCGI cache settings
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:50m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header updating http_500 http_503;
fastcgi_cache_valid 200 301 302 404 1h;
#fastcgi_buffers 16 16k;
#fastcgi_buffer_size 32k;
fastcgi_buffers 128 4096k;
fastcgi_buffer_size 4096k;
fastcgi_param SERVER_NAME $http_host;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
fastcgi_keep_conn on;

Webify convertir fuente ttf a woff, eot y svg

Convertir fuente ttf a woff, eot y svg:

Instalar Webify:

https://github.com/ananthakumaran/webify

 

Binario:

https://ebustos.com/download/webify-linux-x86_64

 

Uso:

webify fontname.ttf

 

CSS @font-face código

@font-face {
    font-family: 'my-font-family';
    src: url('my-font-filename.eot');
    src: url('my-font-filename.eot?#iefix') format('embedded-opentype'),
    url('my-font-filename.svg#my-font-family') format('svg'),
    url('my-font-filename.woff') format('woff'),
    url('my-font-filename.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

Instalar Selenium y ChromeDriver

Selenium y ChromeDriver:

sudo apt-get install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

sudo dpkg -i google-chrome*.deb
sudo apt-get install -f

 

wget -N http://chromedriver.storage.googleapis.com/2.26/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
chmod +x chromedriver

sudo mv -f chromedriver /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver

 

pip install pyvirtualdisplay selenium

from pyvirtualdisplay import Display
from selenium import webdriver

display = Display(visible=0, size=(800, 600))
display.start()
driver = webdriver.Chrome()
driver.get('http://christopher.su')
print driver.title

Remplazar texto con recursividad y SSH

Bash script para remplazar con recursividad una cadena por otra.

#!/bin/bash

# Configurar (replace.sh):
#   - oldstring
#   - newstring
#   - /path/to/folder

oldstring=$"texto_a_remplazar"
newstring=$"texto_nuevo"
grep -rl $oldstring /path/to/folder | xargs sed -i s@$oldstring@$newstring@g

chmod +x replace.sh
./replace.sh

Instalar virtualización KVM

KVM:

aptitude update
aptitude install qemu-kvm libvirt-bin virtinst kvm virt-viewer -y

adduser tu_usuario libvirt
adduser tu_usuario kvm

 

VirtManager:

apt-get install virt-manager

 

KVM Public Bridge:

apt-get install bridge-utils

Configurar /etc/network/interfaces de la siguiente forma:

source /etc/network/interfaces.d/ 

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet dhcp
  bridge_ports eth0
  bridge_stp off
  bridge_maxwait 5

 

Reiniciar red:

systemctl restart networking

 

Comprobar:

ip ad

X2Go Server: Instalar escritorio remoto XFCE

Instalar X2Go Server en Debian 8:

apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E

echo "deb http://packages.x2go.org/debian jessie main" >> /etc/apt/sources.list.d/x2go.list

apt-get update

apt-get install x2goserver

 

Instalar con XFCE:

apt-get install xfce4 xfce4-goodies xfce4-clipman iceweasel x2goserver x2goserver-xsession

 

Instalar X2GO cliente en maquina local

Si error: “kex error : did not find one of algos diffie-hellman-group1-sha1 in list diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1 for kex algos”, ver nota: https://ebustos.com/linux/habilitar-diffie-hellman-group1-sha1-key-exchange/

EasyEngine: WordPress Multisitios con PHP 7, Let’s Encrypt y Nginx cache

Requisitos (Debian):

apt-get install sudo

 

ERROR: El certificado de “raw.githubusercontent.com” no es confiable.

apt-get install ca-certificates

 

Instalar EasyEngine:

wget -qO ee rt.cx/ee && sudo bash ee # install easyengine

 

Desconectar sesión SSH y logear de nuevo:

exit

SSH root@mi-ip

 

Instalar Packages:

ee stack install

 

Crear:

PHP7 + MySQL + SSL Website:

ee site create example.com --php7 --mysql --letsencrypt

 

WordPress Multisitios en sub-directorios Nginx Fastcgi Cache PHP 7 + SSL

ee site create example.com --wpsubdir --wpfc --user=admin --pass=micontraseña --email=info@exemple.com --php7 --letsencrypt

 

Actualizar certificado SSL Let’s Encrypt

ee site update example.com --letsencrypt=renew

 

Eliminar sitio:

ee site delete example.com

 

Instalar Composer:

https://ebustos.com/linux/instalacion-global-de-composer-dependency-manager-para-php/

 

Instalar PhpMyAdmin:

ee stack install --phpmyadmin

cd /var/www/22222/htdocs/db/pma/
composer install --no-dev

 

Administrar PhpMyAdmin:

https://misitio.com:22222

 

Recuperar contraseña administrador EasyEngine:

ee secure --auth

 

Recuperar contraseña root MySQL:

cat /etc/mysql/conf.d/my.cnf

 

 

Consultar:

https://easyengine.io/

https://letsencrypt.org/