Wednesday, August 26, 2015

sudo service apache2 reload && sudo service apache2 restart && sudo service mysql reload && sudo service mysql restart

sudo service apache2 reload && sudo service apache2 restart && sudo service mysql reload && sudo service mysql restart && sudo service memcached restart

Tuesday, August 25, 2015

Truncate logs

truncate logfile --size 0
For the entire file system:
find / -type f -name "*.log" -exec truncate --size 0 {} +

Mysql

SET GLOBAL slow_launch_time = 1;
SET GLOBAL slow_query_log = 'ON';
SET GLOBAL log_queries_not_using_indexes = 'ON';
SET GLOBAL slow_query_log_file ='/var/lib/mysql/slow-query-log.log';
SET GLOBAL long_query_time = 1;
SHOW VARIABLES LIKE '%slow%';

#FLUSH LOGS;


SHOW GLOBAL STATUS LIKE 'Connections';
SHOW GLOBAL STATUS LIKE 'Threads_created';
SHOW GLOBAL STATUS LIKE 'Max_used_connections';

#Threads_created / Connections > 0.01
#increase thread_cache_size where thread_cache_size > Max_used_connections

Saturday, July 18, 2015

How To Properly Upgrade from Mint 17.1 (Rebecca) To Linux Mint 17.2 (Rafaela)

sudo apt-get update
sudo apt-get dist-upgrade
sudo cp /etc/apt/sources.list.d/official-package-repositories.list{,.bak}
sudo sed -i 's/rebecca/rafaela/g' /etc/apt/sources.list.d/official-package-repositories.list
sudo apt-get update
sudo apt-get dist-upgrade




Friday, July 17, 2015

optipng

sudo apt-get install optipng
optipng -i1 -o7 -v -full -sim pic.png

systemd-timesyncd

sudo apt update && sudo apt install systemd-timesyncd && sudo systemctl enable --now systemd-timesyncd