XPath: Compter le nombre de mots

Pour compter le nombre de mots à l’aide d’une XPAth, nous allons utiliser trois fonctions XPath: L’expression XPath effectue les opérations suivantes: Voici l’expression Xpath pour compter le nombre de mots: Il faudra simplement remplacer //*[@id=”content”] par votre XPath 🙂

How to increase maximum upload file size in LiteSpeed/WordPress/Ubuntu 20

Unlike Apache, LiteSpeed requires to restart each service interacting with it. PHP isn’t excluded of this rule, so you must restart it too after changing the php.ini file. 1/ Edit the following line (here for php8): /usr/local/lsws/lsphp80/etc/php/8.0/litespeed/php.ini For instance with nano: nano /usr/local/lsws/lsphp80/etc/php/8.0/litespeed/php.ini 2/ Change upload_max_filesize & post_max_size (you might consider increasing max_execution_time & max_input_time […]

Add column with domain name to CSV file with Python

A script to add a column containing only the domain name to an existing CSV file. It extract it from a column containing an URL. It works with .co.uk and other country code top-level domain. Just change “5” by the column containing the URL. Also don’t forget to adjust. Here is it setup for semi-colon for […]

Extract domain name with Python

tldextract is the best library to extract the domain name with Python. Here is how it looks in action: import tldextractext = tldextract.extract(‘http://forums.bbc.com’)print(ext.registered_domain) Which would output: bbc.co.uk

Finding the LCP node with Chrome DevTools

Official documentation about Largest Contentful Paint is super interesting and explicit. But it misses one thing: How to identify the largest node / block / image /text ? Chrome DevTools allows you to find which node you should optimize. Simply follow the steps below. Open Chrome Open the page you want to find the LCP […]

SSH – Could not open a connection to your authentication agent

If you get “Could not open a connection to your authentication agent“, try: eval `ssh-agent -s` | ssh-add ~/.ssh/you_id_rsa_private_key => It works on Ubuntu 16, 18 and Debian Still a bug ? Try: ssh -vvvT git@gitlab.com

How-to install mnoGoSearch on Debian Jessie

mnoGoSearch tested with a fresh cloud.runabove.com Debian Jessie 7.5 instance : sudo nano /etc/apt/sources.list #Only jessie distrib —> deb http://ftp.debian.org/debian jessie main —> deb-src http://ftp.debian.org/debian jessie main #Update package list sudo apt-get update #Upgrade distrib with new distrib repository sudo apt-get upgrade #Install MySQL & PhpMyAdmin BEFORE mnoGoSearch sudo apt-get install mysql-server phpmyadmin #Create a […]

Installation Symfony2, Solarium & NelmioSolariumBundle

Nelmio Solarium Bundle permet de connecter Solarium à Symfony2. Ce bundle est une initiative de Nelmio. Solarium est une librairie PHP qui permet de communiquer avec PHP. Cette petite liste de commandes est davantage une prise de note qu’un tutorial, afin de gagner du temps en cas de futures réinstallations.