Thursday, April 23, 2015

administration userful linux commands

ps -ylC php5-fpm --sort:rss | awk '!/RSS/ { s+=$8 }
END { printf "%s\n", "Total memory used by PHP-FPM child processes: "; printf "%dM\n", s/1024 }'

ls -1R | wc -l shows number of files in folder.

sudo cat /var/log/nginx/site_access.log | awk '{ print $1 }' | sort | uniq -c | sort -n ( This command will count how many times any given IP has hammered your site).

Wednesday, April 22, 2015

Forgot msyql-mariadb password ubuntu 14



Stop msyql process:

sudo service mysql stop

Run mysql as safe service:

sudo mysqld_safe --skip-grant-tables --skip-networking &

Log on with root use and without any password:

mysql -u root

change database:

use mysql;

Change password for root user:

update user set password=PASSWORD("new-password") where User='root';

Commit changes:

flush privileges;


Leave mysql client:

quit;

Tuesday, April 7, 2015

upgrade from drupal 7.34 to 7.35



upgrade from drupal 7.34 to 7.35

Using the information from the following site. Upgrade from drupal 7.34 to 7.35 is accomplishing. Only there are some modifications in the steps, which helps a secure upgrade.

https://www.drupal.org/node/1494290


Instructions on how to update Drupal core with a newer version of Drupal of the same category or same base version [ ie Drupal 7.1 to 7.2 etc ]
  1. Make a backup of your Drupal instance. (For ex: with MySQL)
  1. Download the latest release of your current Drupal version.
  1. Extract the [tar ball or zip] Drupal package.
  1. Set your site on maintenance mode (For ex: How on D7)
  1. Don't delete all the files & folders.
  1. Instead i copy all the files, except the robot.txt htaccess and sites, and paste/replaced them into my site.
  1. If the update release includes changes to settings.php replace old settings.php in.../sites/default/ with the new one, and edit site-specific entries (eg database name, user, and password)
  1. If you have modified files such as .htaccess or robots.txt re-apply those changes to the new files.
  1. If you have a favicon.ico file that was deleted replace it too
  1. Login to your site as administrator or as user no 1
  1. Instead i use drush to update the site #drush updb
  1. Follow the process to update your Drupal instance
  1. Disable maintenance mode
  1. I run another update command using drush to update only the security drush up --security-only.





Troubleshooting:

When i checked out my modules page, there was an error concerning the profile.

Notice: Undefined index: distribution_name in drupal_install_profile_distribution_name() (line 207 of includes/install.inc)

The solution is to run the following command in your database.

UPDATE system SET status=1 WHERE name='standard';



Cheers