Using SED in Linux to Edit Large Files

Recently I encountered a server that had an Apache configuration file that was over 500,000 lines. Changes needed to make were to comment out the CustomLog line for each domain in /etc/httpd/httpd.conf. For this command, I used SED. NAME sed - stream editor for filtering and transforming text SYNOPSIS sed [OPTION]... {script-only-if-no-other-script} [input-file]... DESCRIPTION Sed is a stream editor. A…

Linux mount CIFS Windows Share

CIFS stands for Common Internet File System. This is application-level network protocol mainly used to provide shared access to files, printers, serial ports, and miscellaneous communications between nodes. You can access CIFS share from Linux and mount them as a regular filesystem. This is handy if there is a backup service like Infrascale where you set up a windows computer…

How do you calculate mysql max_connections variable

The basic formulas are: Available RAM = Global Buffers + (Thread Buffers x max_connections) max_connections = (Available RAM - Global Buffers) / Thread Buffers To get the list of buffers and their values: SHOW VARIABLES LIKE '%buffer%'; Here's a list of the buffers and whether they're Global or Thread: Global Buffers: key_buffer_size, innodb_buffer_pool_size, innodb_log_buffer_size, innodb_additional_mem_pool_size, net_buffer_size, query_cache_size Thread Buffers: sort_buffer_size,…

Add Gzip to Plesk Server

Instructions Login to your Plesk server. Select the domain you wish to enable gzip for from the left hand side. Click in Apache and nginx settings: Down the bottom, add the following to the "Additional nginx directives" field: gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; gzip_proxied any; gzip_types text/plain text/css application/x-javascript application/javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/bmp image/svg+xml; gzip_vary on; Click…