A lot of new stuff
Docker and Docker-Compose commands and aliases: - dco: docker-compose - dcc: docker-compose config - dcedit/vidc/Edit-DockerCompose: edit docker-compose.yml and satellite files - dcdown.ps1 - dl/dll/dcl/dcll: view docker/docker-compose logs l : follow ll : just list - dx/dcx: docker / docker-compose exec - dcdown: docker-compose down - dcup: docker-compose up - dcr: docker-compose run - dcre: docker-compose restart - dcreup: docker-compose up with force recreate - di: docker inspect A bunch of other aliases and tools: - l/ll - shortcuts for ls -la - Edit-MyConfig with MyConfig.class: Edit various configuration files - Update-ArchOSz: my common update params for Arch all ready to run - Update-UbuntuOSz: my common update params for Ubuntu all ready to run - sz-df - a ps stylized df - sz-du - what's the size of a dir - sys.Linux/ls - a Linux specific ls (with all required configuration) Works in progress (not completely tested yet): - Stop-ProcessTree - Update-OSz.ps1 - src/smartsudo.inc.ps1
This commit is contained in:
parent
306e03874d
commit
310103c2f7
29 changed files with 226 additions and 8 deletions
35
sz-df.ps1
Normal file
35
sz-df.ps1
Normal file
|
@ -0,0 +1,35 @@
|
|||
param([ValidateSet('KB','GB','TB')]$SizeUnitName = 'GB')
|
||||
$local:zpool_cmd = $null
|
||||
$local:excludeType = ''
|
||||
|
||||
$script:SizeUnit = Invoke-Expression "1$SizeUnitName"
|
||||
$script:SizeRound = 2
|
||||
$SizeUnit /= 1KB
|
||||
|
||||
function NewDataRow{param($Size,$Used,$Available,$Percent,$Source,$FSType,$Target)
|
||||
[PSCustomObject]@{
|
||||
"Size$SizeUnitName" = [Math]::Round($Size /$SizeUnit, $SizeRound)
|
||||
"Used$SizeUnitName" = [Math]::Round($Used /$SizeUnit, $SizeRound)
|
||||
"Available$SizeUnitName" = [Math]::Round($Available/$SizeUnit, $SizeRound)
|
||||
'Used%' = [int]($Percent -replace '%$','')
|
||||
Source = $Source
|
||||
FSType = $FSType
|
||||
Target = $Target
|
||||
}
|
||||
}
|
||||
|
||||
$local:df = @()
|
||||
& df '--output=size,used,avail,pcent,source,fstype,target' |
|
||||
Select-Object -Skip 1 | ForEach-Object {
|
||||
$local:df = $_.Split(' ', [StringSplitOptions]::RemoveEmptyEntries)
|
||||
NewDataRow $df[0] $df[1] $df[2] $df[3] $df[4] $df[5] $df[6]
|
||||
} | Where-Object {
|
||||
-not ($_.FSType -eq 'zfs' -and $_.Source -match '/')
|
||||
} | Sort-Object -Property Target
|
||||
|
||||
#$zpool_cmd = get-command zpool | Where-Object CommandType -eq 'Application' | Select-Object -ExpandProperty Source
|
||||
#if( $zpool_cmd ) {
|
||||
# $excludeType = '--exclude-type=zfs'
|
||||
#}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue