Put this into ~/.bashrc file of your account (if the file does not exist, you create it):
shopt -s histappend PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
In order for this to start working you need to log out and in again.
Put this into ~/.bashrc file of your account (if the file does not exist, you create it):
shopt -s histappend PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
In order for this to start working you need to log out and in again.
Execute following command in mysql shell by connecting with your username and password:
mysql> SELECT CONCAT(ROUND(KBS/POWER(1024, IF(PowerOf1024<0,0,IF(PowerOf1024>3,0,PowerOf1024)))+0.4999), SUBSTR(' KMG',IF(PowerOf1024<0,0, IF(PowerOf1024>3,0,PowerOf1024))+1,1)) recommended_key_buffer_size FROM (SELECT LEAST(POWER(2,32),KBS1) KBS FROM (SELECT SUM(index_length) KBS1 FROM information_schema.tables WHERE engine='MyISAM' AND table_schema NOT IN ('information_schema','mysql')) AA ) A, (SELECT 3 PowerOf1024) B;
Response will be something like this:
+-----------------------------+ | recommended_key_buffer_size | +-----------------------------+ | 1G | +-----------------------------+ 1 row in set (0.08 sec)
When I used this calculation for my Raspberry Pi 2 running MySQL result was 0G, so you need to modify the query to show either MB or KB values by using:
For key_buffer_size recommended size in MB:
SELECT CONCAT(ROUND(KBS/POWER(1024, IF(PowerOf1024<0,0,IF(PowerOf1024>3,0,PowerOf1024)))+0.4999), SUBSTR(' KMG',IF(PowerOf1024<0,0, IF(PowerOf1024>3,0,PowerOf1024))+1,1)) recommended_key_buffer_size FROM (SELECT LEAST(POWER(2,32),KBS1) KBS FROM (SELECT SUM(index_length) KBS1 FROM information_schema.tables WHERE engine='MyISAM' AND table_schema NOT IN ('information_schema','mysql')) AA ) A, (SELECT 2 PowerOf1024) B;
Result:
+-----------------------------+ | recommended_key_buffer_size | +-----------------------------+ | 1M | +-----------------------------+ 1 row in set (0.44 sec)
For key_buffer_size recommended size in KB:
SELECT CONCAT(ROUND(KBS/POWER(1024, IF(PowerOf1024<0,0,IF(PowerOf1024>3,0,PowerOf1024)))+0.4999), SUBSTR(' KMG',IF(PowerOf1024<0,0, IF(PowerOf1024>3,0,PowerOf1024))+1,1)) recommended_key_buffer_size FROM (SELECT LEAST(POWER(2,32),KBS1) KBS FROM (SELECT SUM(index_length) KBS1 FROM information_schema.tables WHERE engine='MyISAM' AND table_schema NOT IN ('information_schema','mysql')) AA ) A, (SELECT 1 PowerOf1024) B;
and result is:
+-----------------------------+ | recommended_key_buffer_size | +-----------------------------+ | 23K | +-----------------------------+ 1 row in set (0.44 sec)
For some time now I am using my gk802 device as headless server running Debian Jessie. Finally I have decided to remove all GUI related packages from the system.
After searching the net I found out that this can be accomplished with: Continue reading “How to remove all GUI related packages in Debian”
After switching ISP providers I have replaced my trusty TP-LINK 1043ND running OpenWrt with Cisco EPC3928S which also has Gigabit Ethernet ports and 300Mbit WiFi I noticed problems with my RTL8152 based USB->Ethernet adapter which I was using with my gk802 device. Continue reading “Force 100Mbit ethernet speed on RTL-8152 USB ethernet adapter”
To measure boot times use
systemd-analyze
Result should look something like:
Startup finished in 2.463s (kernel) + 53.052s (userspace) = 55.516s
Continue reading “Analyze and optimize boot up with systemd”