Friday, December 17, 2010

From FLAC to MP3 and back again–EAC Rips with LAME

Maximum PC has a great post on Ripping archival quality MP3s from audio CDs, but one of the user comments following the article simplifies the LAME options.

User vintagegold suggests using the following:

-V0 %s %d

I just tried the above settings within LAME to rip a classical CD – Borodin – and it sounds great on my AKG K 271 Studio headphones.  The HydrogenAudio wiki does indicate one preset with even higher quality for archiving, but my ears(which are still sensitive enough to hear the frequency on certain monitors/LCDs) don’t find the higher constant 320 kbit bitrate necessary.

Some of my essential EAC Screenshots – refer to the Maximum PC article for setting up Accurate Rip and other portions of EAC:

EAC0001EAC0002EAC0003

Arturo "Buanzo" Busleiman has current Windows and Mac downloads of the LAME binaries [high quality MPEG Audio Layer III (MP3) encoder] on his Argentina-hosted site.  The Audacity for Windows download worked on windows 7 x64.

Goodbye FLAC – I’ll not miss your options.
-8 -A tukey(0.25) -A gauss(0.1875) -b 4096 -V -T "artist=%a" -T "title=%t" -T "album=%g" -T "date=%y" -T "tracknumber=%n" -T "genre=%m" %s --sector-align

Wednesday, December 15, 2010

Wildcard Search for Exchange Recipients PowerShell Function

I wanted to do a partial string search against names and aliases, and used the output from the Exchange Management Shell Command Log to write a PowerShell function that returned the type of broad result set I wanted, finding a match with names OR aliases.

function Get-Recip
{
param (
[string]$Filter=$(throw 'Partial Recipient Name or Partial Recipient Alias required')
)

# Wildcard search prepended and appended to filter string passed, limit result set to 1000 matches

$Filter= "*"+ $Filter + "*";

Get-Recipient -PropertySet ConsoleLargeSet -ResultSize '1000' -SortBy DisplayName `
-RecipientType 'DynamicDistributionGroup','UserMailbox','MailContact','MailUser', `
'MailUniversalDistributionGroup','MailUniversalSecurityGroup','MailNonUniversalGroup' `
-Filter {(Name -like $Filter ) -OR (Alias -like $Filter)}

}

Monday, December 13, 2010

Free Space on all servers for all fixed drives? Done.

A while ago I posted on querying free disk space using WMI and batch.

I wouldn't query free disk space using batch anymore.  The PowerShell script I tweaked and currently use to query free disk space is displayed below.  The script truncates for readability – the rounding methods are commented out if that’s your preference:
# spaceused.ps1
# Lars-UT http://larsrasmussen.blogspot.com
(Get-Date -format 'yyyy-MM-dd hh:mm:ss').ToString() | Out-Default
$outData = @("")
$server = $args[0]
$dataFromServer = Get-WmiObject Win32_Volume -ComputerName $server | Select-Object SystemName,Label,Name,DriveLetter,DriveType,Capacity,Freespace

foreach ($currline in $dataFromServer) {
if ((-not $currline.name.StartsWith("\\")) -and ($currline.Drivetype -ne 5)) {
[float]$tempfloatcapacity = [math]::truncate($currline.Capacity/ 1000000000)
#[float]$tempfloatcapacity = [math]::round(($currline.Capacity/ 1000000000),1)
add-member -InputObject $currline -MemberType NoteProperty -name Capacity_in_GB -value "$tempfloatcapacity GB"

[float]$tempfloat = ($currline.Freespace / 1000000) / ($currline.Capacity / 1000000)
$temppercent = [math]::round(($tempfloat * 100),2)
add-member -InputObject $currline -MemberType NoteProperty -name FreePercent -value "$temppercent %"

[float]$tempfloatfreespace = [math]::truncate($currline.Freespace/ 1000000000)
#[float]$tempfloatfreespace = [math]::round(($currline.Freespace/ 1000000000),1)
add-member -InputObject $currline -MemberType NoteProperty -name Freespace_in_GB -value "$tempfloatfreespace GB"

$outData = $outData + $currline
}
}

$outData | Select-Object SystemName,Label,Name,Capacity_in_GB,Freespace_in_GB,FreePercent | sort-object -property Name | format-table -autosize

To run this against muliple servers just put the server names, one per line, in a text file and save that file. You'll then assign that file to a variable in PowerShell and loop through each line for each server:

PS C:\> $serverlist = Get-Content .\ServerNames-Prod.txt
PS C:\> foreach ($server in $serverlist) { .\spaceused.ps1 $server }


Here’s the pretty output!  Yep, those are sub-second times for querying multiple servers.



spaceused.ps1



Need to document this?  Use Start-Transcript.  I’ve seen auditors use it like so:



PS C:\> $strTimestamp =  [string](Get-Date -format "yyyy-MM-dd_hh-mm")
PS C:\> start-transcript .\ServerSpace-$strTimestamp.txt
PS C:\> foreach ($server in $serverlist) { .\spaceused.ps1 $server }
PS C:\> Stop-Transcript


Enjoy.