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:
lksz 2020-10-31 17:10:32 -04:00
parent 306e03874d
commit 310103c2f7
29 changed files with 226 additions and 8 deletions

18
src/smartsudo.inc.ps1 Normal file
View file

@ -0,0 +1,18 @@
function smartsudo() {
[CmdletBinding(SupportsShouldProcess)]param(
[switch]$sudo,
[switch]$Force,
[Parameter(Position = 0, ValueFromRemainingArguments = $true)]
[string[]]$expr
)
if( $sudo -and -not $(Test-IsAdmin) ) {
Write-Verbose "Perofrming the following command line via SUDO:`n$($expr -join ' ')"
$local:base64command = ConvertTo-Base64 "$expr"
/usr/bin/env sudo pwsh -EncodedCommand $base64command
return
}
Write-Verbose "Perofrming the following expression in-line:`n$($expr -join ' ')"
Invoke-Expression "$expr"
}