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 … Read more

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 … Read more

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: 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: … Read more

Add second hard drive to linux

Here is how to add a second disk to linux. In this article, the OS is CentOS 7. Check to see how many drives are installed: You can do this using the df and fdisk command: The above information show the primary disk as sda. Use fdisk to identify the second drive: The sdb drive … Read more

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: Click OK to save. Verify with GTMetrix.com Another way is to set up deflate. First you need … Read more

Error 401: Unauthorized: Access is denied due to invalid credentials

When getting an error in Windows 2008 R2, Error 401: Unauthorized: Access is denied due to invalid credentials See – https://www.codeproject.com/Answers/418802/Unauthorized-Access-is-denied-due-to-invalid-c#answer1 Specifically Solution 6 with a minor adjustment. Right click on the folder in Explorer and choose Properties. In Security tab add ‘IIS_IUSRS’ and ‘NETWORK SERVICE’ and give full control to both user. Also check … Read more