Category: Dev
-
MySQL user management from the command line
If phpMyAdmin is not installed on your server or if you don’t have access to it but instead have shell access, you can easily manage your MySQL database users from the command line. MySQL stores the list of users in the mysql.user table. List of all databases are stored in the mysql.db table. Show list…
-
Export / Import a MySQL database between remote server and local machine
Upload or download a MySQL database between a remote server and localhost using the Linux command line. Download a remote MySQL database Download a remote MySQL database using mysqldump dump. The output of the dump is compressed using gzip. This compressed file is then unzipped and downloaded into the file remotedb.sql. Copy local database to…
-
Create a new MySQL user from the command line
Create and add a user to a MySQL database using the command line. Run MySQL Open MySQL using the below command. The username should be your root user or an admin user with access for creating other users. Create a database and a user Create a new database (if required) and create a new user.…
-
Start WSL cron in a hidden window
Enable cron to run without asking for password Normally running sudo service cron start in WSL will ask for the sudo password. This is an issue when we want to run cron from the script below. To fix this, we need to enable cron service to run without asking for the password by adding it…
-
Align second line of bullet points in CSS
HTML aligns the lines after the first line flush with the bullet point (the dot) instead of the text. You can fix this with the class below. text-indent property applies only to the first line of a text-block. So we first “pull” the first-line back along with the dot. Then we push the entire text-block…
-
Highlight the current post’s tags in WordPress
List all tags in a bulleted list and highlight only the current post’s tags. Highlight the current post’s tags using CSS The idea is to show all the tags used on the site and then add a CSS class to the tags that are used in the current post. This class can then be styled…
-
Fix PHP executable not set in VSCode when running XAMPP on Linux
This is a fix for the following error when opening PHP files in VSCode or VSCodium: Cannot validate since no PHP executable is set. Use the setting ‘php.validate.executablePath’ to configure the PHP executable. This error means that VSCode does not know how to validate the contents of a PHP file and can’t show errors in…
-
Change the file upload size in NGINX
When you have a PHP-based website like WordPress running on NGINX, you would typically change the maximum file upload size in PHP settings e.g., in php.ini file or similar. NGINX web server also has it’s own configuration where you can set the max upload size server-wide. This is set in the .conf file using the…
-
Get a Let’s Encrypt SSL certificate for your domain
Install a free SSL certificate and serve your site with “https”. Let’s Encrypt provides free SSL certificates and with the help of the installation tool called Certbot, you can easily enable an HTTPS certificate for your website. These instructions are for users running either Nginx or Apache on Ubuntu server and have access to the…