Howtos / Articles

Enable Permalinks in WordPress on Nginx

A default installation of WordPress on Nginx is not going to allow the use of Permalinks. Since Nginx doesn’t support the Apache .htaccess files, the Nginx configuration files need to be edited manually to suit. To enable permalinks in Nginx: Edit the configuration file associated with your WordPress site. Eg: $ sudo nano /etc/nginx/sites-enabled/sitename.conf Locate the “location /” code block, located within the “server” block, and add the following line within: try_files $uri $uri/ /index.php?q=$uri&$args; Example config file: server {…

Read more [...]

Optimizing jpeg Image Files on Linux

Optimizing images can be a quick and easy way to shrink the file size of jpeg images, removing unneeded data within the file. This can reduce the time it takes users to download the images if they are on a web server. It can also be used to remove comment and exif data from the files, so there is no added information within the file, other than the image itself. “jpegoptim” is a free application that can be used to…

Read more [...]

Adding users to a .htpasswd file for Apache

This howto article shows you how to add a new user and password combination to a .htaccess file, for use with the Apache web server. This assumes the Apache tools are installed (specifically the ‘htpasswd’ utility).…

Read more [...]

Refreshing All Views After Table Structure Changes in Microsoft SQL

After making structure changes to a database table, you need to update any views that may be using those tables, otherwise the views may reference the wrong field, and cause all sorts of issues. The T-SQL script below will refresh all views on a database. Run this in a new query window in Microsoft SQL Server Management Studio. Make sure the database you wish to refresh is selected. DECLARE @ViewName VARCHAR(256) DECLARE cViews CURSOR READ_ONLY FOR SELECT name from sys.views…

Read more [...]

Display Total Folder Size with PowerShell and Sort by Size

The PowerShell command below can be used to display a list containing the total size (in MB) of all the files and folders (recursively) in the current directory, and sort them by total size. ls -Force | Add-Member -Force -Passthru -Type ScriptProperty -Name Length -Value {ls $this -Recurse -Force | Measure -Sum Length | Select -Expand Sum } | Sort-Object Length -Descending | Format-Table @{label=”TotalSize (MB)”;expression={[Math]::Truncate($_.Length / 1MB)};width=14}, @{label=”Mode”;expression={$_.Mode};width=8}, Name Sample Output: TotalSize (MB) Mode Name ————– —- —- 26499…

Read more [...]

Page 23 of 41« First...10...19202122232425262728...40...Last »