Howtos / Articles

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 [...]

PowerShell Command to Recursively Delete Thumbs.db

The PowerShell command below can be used to remove thumbs.db files from the current folder, and all sub folders. Make sure you change directory ‘cd’ into the folder you want the command to run from. Get-ChildItem -Path . -Include Thumbs.db -Recurse -Name -Force | Remove-Item -Force You can change the ‘-Include’ parameter to any wildcard you like, such as *.tmp or *.bak for example. Get-ChildItem -Path . -Include *.tmp -Recurse -Name -Force | Remove-Item -Force Remove the ‘Remove-Item’ statement to…

Read more [...]



Page 20 of 38« First...10...16171819202122232425...Last »