Check These Out
Get the svn info, grep for the "URL" of the repository, pull out the tag/branch/trunk, and then just show the helpful/meaningful bit.
That's what the sed command should've been, sorry.
Supports other file formats.
Using this command you can track a moment when usb device was attached.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
This command takes an application name as an argument and then it will listen to the tcp traffic and capture packets matching the process Id of the application.
The output shows:
local address / local port / Remote Address / Remote port / State / Owning Process ID
cryptic version
Appends the input file with the date format YYYY-MM-DD.bak. Also runs silently if you remove the -v on the cp at the end of the function.
Here's an annotated version of the command, using full-names instead of aliases. It is exactly equivalent to the short-hand version.
# Recursively list all the files in the current directory.
Get-ChildItem -Recurse |
# Filter out the sub-directories themselves.
Where-Object { return -not $_.PsIsContainer; } |
# Group the resulting files by their extensions.
Group-Object Extension |
# Pluck the Name and Count properties of each group and define
# a custom expression that calculates the average of the sizes
# of the files in that group.
# The back-tick is a line-continuation character.
Select-Object `
Name,
Count,
@{
Name = 'Average';
Expression = {
# Average the Length (sizes) of the files in the current group.
return ($_.Group | Measure-Object -Average Length).Average;
}
} |
# Format the results in a tabular view, automatically adjusted to
# widths of the values in the columns.
Format-Table -AutoSize `
@{
# Rename the Name property to something more sensible.
Name = 'Extension';
Expression = { return $_.Name; }
},
Count,
@{
# Format the Average property to display KB instead of bytes
# and use a formatting string to show it rounded to two decimals.
Name = 'Average Size (KB)';
# The "1KB" is a built-in constant which is equal to 1024.
Expression = { return $_.Average / 1KB };
FormatString = '{0:N2}'
}