Resolution for ‘Unable to create directory’ error in WordPress. This error is caused by an inappropriate set of folder and file permissions. The following statements assume you have shell access to the document root of…
GoAccess
A visual web log analyzer. https://goaccess.io/ Connect to your webserver via ssh and pipe the access log to goaccess running locally. Create a report in html format. ssh user@ \ ‘cat /var/log/apache2/example.com-le-ssl.conf/access.log’ | \ goaccess…
Homestead Vagrant xdebug3 vscode phpspec
Reset to original state ./vagrant destroy –force && ./vagrant up .vscode/launch.json { “version”: “0.2.0”, “configurations”: [ { “name”: “Listen for Xdebug”, “type”: “php”, “request”: “launch”, “port”: 9003, “log”: true, “pathMappings”: { “/home/vagrant/homestead.test”: “/home/chris/code/homestead.test” } }…
Selenium with Python
Create a virtual environment python3 -m venv env Get gekodriver (for FireFox) https://github.com/mozilla/geckodriver/releases It needs to be in the PATH (using Ubuntu here) sudo mv geckodriver /usr/local/bin/geckodriver Activate the virtual environment source env/bin/activate Install Selenium…
Captive portal
When connected to a wifi captive portal and the login screen won’t appear, try any of the following: http://clients3.google.com/generate_204 (from a Chromium browser) 192.168.1.1 192.168.1.2
Scaffold Symfony app from existing database
Prepare for a new run rm -r src/Entity/* rm -r src/Form/* rm -r src/Controller/* rm -r src/Repository/* rm -r templates/* Copy in a backup of base twig template cp base.html.twig templates/ Generate entities from an…
Query DNS data
dig Query for information on all DNS records dig your_domain_name.com ANY Query for A records dig your_domain_name.com A host, nslookup and dig share similar functionality. whois Return information about a domain name registration, including the…
Ubuntu select and paste with Mouse Keys
On Linux I like to make use of the select and paste feature i.e. selecting text copies it and the middle mouse button pastes it. When a laptop touchpad has no buttons a middle mouse…
WordPress debugging
To turn on debugging add the following to wp-config.php // Turn debugging on define(‘WP_DEBUG’, true); // Tell WordPress to log everything to /wp-content/debug.log define(‘WP_DEBUG_LOG’, true); // Display error messages define(‘WP_DEBUG_DISPLAY’, true); Write to /wp-content/debug.log error_log(‘logging…
Backup mysql database via socks tunnel
The following bash script will open a socks tunnel with a remote host and use a local mysqldump cli tool to backup a mysql database. #!/bin/sh DT=$(date ‘+%Y-%m-%dT%H:%M:%S’) SUFFIX= FILENAME=$DT$SUFFIX BACKUPSPATH= USER= IP= PORT= DBUSER=…