mariadb

Prepare MariaDB for Upgrade To prepare MariaDB for Upgrade, logon to the database server as root with the root password and run the commands below sudo mysql -u root -p Then run the commands below to set innodb_fast_shutdown to 0 mysql> SET GLOBAL innodb_fast_shutdown = 0; Backup Your Databases It’s always important to backup your databases before attempting to upgrade To back up, run the commands below against each database you wish...

Read More
wordpress-logo

Add Additional Mime Types in functions.php add_filter(‘upload_mimes’,’add_custom_mime_types’); function add_custom_mime_types($mimes){ return array_merge($mimes,array ( ‘eps’ => ‘application/eps’, ‘jpg’ => ‘image/jpg’, ‘png’ => ‘image/png’, ‘jpeg’ => ‘image/jpeg’, ‘pdf’ => ‘application/pdf’, ‘doc’ => ‘application/doc’, ‘docx’ => ‘application/vnd.openxmlformats-officedocument.wordprocessingml.document’, ‘gif’ => ‘image/gif’, )); }...

Read More
mysql

Log in to MySQL from terminal mysql -u root -p Run MySQL commands CREATE database_name; CREATE USER 'some_user'@'localhost' IDENTIFIED WITH mysql_native_password BY ‘your_password’; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER, REFERENCES ON database_name.* TO 'some_user'@'localhost'; Edit above privileges as needed  ...

Read More
cli

Enable mod_rewrite Enable any Apache module using the a2enmod command. Command below on your Ubuntu server: $ sudo a2enmod rewrite In case the module is already enabled on your server, you will get an alert message. Restart Apache once you make any change to its configuration. Type the command below on a terminal window: $ sudo systemctl restart apache2 Server is now ready to accept rewrite rules.     ...

Read More

Create a python script $ more memReport.py #!/usr/bin/python import subprocess import re # Get process info ps = subprocess.Popen(['ps', '-caxm', '-orss,comm'], stdout=subprocess.PIPE).communicate()[0].decode() vm = subprocess.Popen(['vm_stat'], stdout=subprocess.PIPE).communicate()[0].decode() # Iterate processes processLines = ps.split('\n') sep = re.compile('[\s]+') rssTotal = 0 # kB for row in range(1,len(processLines)): rowText = processLines[row].strip() rowElements = sep.split(rowText) try: rss = float(rowElements[0]) * 1024 except: rss = 0 # ignore...

Read More