diff --git a/base/Aliases/l.ps1 b/base/Aliases/l.ps1 index 9e2740c..8570212 100644 --- a/base/Aliases/l.ps1 +++ b/base/Aliases/l.ps1 @@ -1 +1 @@ -ls +_ll diff --git a/base/Aliases/ll.ps1 b/base/Aliases/ll.ps1 index 9e2740c..8570212 100644 --- a/base/Aliases/ll.ps1 +++ b/base/Aliases/ll.ps1 @@ -1 +1 @@ -ls +_ll diff --git a/base/profile.d/dot-shorthand.ps1 b/base/profile.d/dot-shorthand.ps1 new file mode 100644 index 0000000..6261454 --- /dev/null +++ b/base/profile.d/dot-shorthand.ps1 @@ -0,0 +1,4 @@ +filter dot([string]$Parameter){ $_ | Select-Object -ExpandProperty $Parameter } + +Set-Alias : dot +Set-Alias _ dot diff --git a/base/src/config.files.json b/base/src/config.files.json index 11e9138..3c9fa10 100644 --- a/base/src/config.files.json +++ b/base/src/config.files.json @@ -1,13 +1,13 @@ { "omp": "~/.oh-my-posh.omp.json", - "profile": [ - "~/.profile", + "/profile": [ "/etc/profile", "/etc/profile.d/" ], + "profile": "~/.profile", "bashrc": "~/.bashrc", "zshrc": "~/.zshrc", - "zsys": "/etc/zsys.conf", + "/zsys": "/etc/zsys.conf", "shrc": "~/.shrc", "sz-aliases-sh": "~/.sz.aliases.sh", "sz-shrc": [ @@ -27,6 +27,7 @@ "@shell-loading-snippets/zsh" ], "sz-rc-all": [ + "#profile", "#sz-aliases-sh", "#sz-local-rc", "#sz-shrc", @@ -34,7 +35,7 @@ "#zshrc" ], "sz-local-rc": "~/.sz.local.sh", - "ansible": [ + "/ansible": [ "/etc/ansible/ansible.cfg", "/opt/ansible/ansible.cfg", "/opt/ansible/hosts" @@ -67,6 +68,6 @@ "ssh-auth": "~/.ssh/authorized_keys", "ssh-known": "~/.ssh/known_hosts", "ssh-conf": "~/.ssh/config", - "sshd-conf": "/etc/ssh/sshd_config", + "/sshd-conf": "/etc/ssh/sshd_config", "ssh" : [ "#ssh-auth", "#ssh-known", "#ssh-conf", "#sshd-conf", "#ssh-pub", "#ssh-id" ] } diff --git a/docker/Get-DockerNetwork.ps1 b/docker/Get-DockerNetwork.ps1 new file mode 100644 index 0000000..7cb0541 --- /dev/null +++ b/docker/Get-DockerNetwork.ps1 @@ -0,0 +1,12 @@ +[CmdletBinding()]param() + +$(docker network ls -q) | + ForEach-Object { + $local:tmpObj = docker inspect $_ | ConvertFrom-Json | + Select-Object *,@{L='Subnet';E={$_.IPAM.Config[0].Subnet}} + + $tmpObj.PSObject.TypeNames.Insert(0,"DockerNetworksOutput") + $tmpObj + } # | Format-Table @{E='Id';W=12},Name,Driver,Scope,Subnet + + diff --git a/docker/profile.d/TypeData.format.ps1xml b/docker/profile.d/TypeData.format.ps1xml index 3129220..38b1f75 100644 --- a/docker/profile.d/TypeData.format.ps1xml +++ b/docker/profile.d/TypeData.format.ps1xml @@ -69,5 +69,32 @@ PortBindings + + lsdn + + DockerNetworksOutput + + + + 13 + 27 + 8 + 8 + 40 + + + + + + $_.Id -replace '^(.{12}).*$','$1…' + Name + Driver + Scope + Subnet + + + + + diff --git a/shell-loading-snippets/bash b/shell-loading-snippets/bash index 675e6e7..9aa0a33 100755 --- a/shell-loading-snippets/bash +++ b/shell-loading-snippets/bash @@ -1,6 +1,14 @@ +echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; snippet/bash" >> /tmp/default_shell + ## Place the following line at the top of your .zshrc to make powershell your default shell. ## __P=".local/share/powershell/Scripts/shell-loading-snippets/$(basename $SHELL)"; find ~/$__P -exec true \; && . ~/$__P +function PowerShellLauncher() { + + export SZ_POWERSHELL_LAUNCER_CALLED=1 + + [[ $- != *i* ]] && return + if [[ -x ~/.dotnet/tools/pwsh && "1" != "$(which pwsh > /dev/null && echo 1)" ]]; then PWSH='~/.dotnet/tools/pwsh' alias pwsh="$PWSH " @@ -22,3 +30,6 @@ if [[ "$SZ_SKIP_DEFAULT_SHELL" != "1" ]]; then fi echo "continue" >> /tmp/default_shell export SZ_SKIP_DEFAULT_SHELL=1 +} + +[[ "$SZ_POWERSHELL_LAUNCER_CALLED" != "1" ]] && PowerShellLauncher diff --git a/shell-loading-snippets/sh b/shell-loading-snippets/sh index 675e6e7..31cf2c8 100755 --- a/shell-loading-snippets/sh +++ b/shell-loading-snippets/sh @@ -1,6 +1,14 @@ +echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; snippet/sh" >> /tmp/default_shell + ## Place the following line at the top of your .zshrc to make powershell your default shell. ## __P=".local/share/powershell/Scripts/shell-loading-snippets/$(basename $SHELL)"; find ~/$__P -exec true \; && . ~/$__P +function PowerShellLauncher() { + + export SZ_POWERSHELL_LAUNCER_CALLED=1 + + [[ $- != *i* ]] && return + if [[ -x ~/.dotnet/tools/pwsh && "1" != "$(which pwsh > /dev/null && echo 1)" ]]; then PWSH='~/.dotnet/tools/pwsh' alias pwsh="$PWSH " @@ -22,3 +30,6 @@ if [[ "$SZ_SKIP_DEFAULT_SHELL" != "1" ]]; then fi echo "continue" >> /tmp/default_shell export SZ_SKIP_DEFAULT_SHELL=1 +} + +[[ "$SZ_POWERSHELL_LAUNCER_CALLED" != "1" ]] && PowerShellLauncher diff --git a/shell-loading-snippets/zsh b/shell-loading-snippets/zsh index 52a6661..074720a 100755 --- a/shell-loading-snippets/zsh +++ b/shell-loading-snippets/zsh @@ -1,25 +1,35 @@ +echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; snippet/zsh" >> /tmp/default_shell + ## Place the following line at the top of your .zshrc to make powershell your default shell. ## __P=".local/share/powershell/Scripts/shell-loading-snippets/$(basename $SHELL)"; find ~/$__P -exec true \; && . ~/$__P +function PowerShellLauncher() { + + export SZ_POWERSHELL_LAUNCER_CALLED=1 -if [[ -x ~/.dotnet/tools/pwsh && "1" != "$(which pwsh > /dev/null && echo 1)" ]]; then - PWSH='~/.dotnet/tools/pwsh' - alias pwsh="$PWSH " + [[ $- != *i* ]] && return + + if [[ -x ~/.dotnet/tools/pwsh && "1" != "$(which pwsh > /dev/null && echo 1)" ]]; then + PWSH='~/.dotnet/tools/pwsh' + alias pwsh="$PWSH " - export DOTNET_CLI_TELEMETRY_OPTOUT=1 -fi + export DOTNET_CLI_TELEMETRY_OPTOUT=1 + fi -echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; pwsh: $(which pwsh); Setup-ScriptEnv: $(ls ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1) " >> /tmp/default_shell -if [[ "$SZ_SKIP_DEFAULT_SHELL" != "1" ]]; then - export SZ_SKIP_DEFAULT_SHELL=1 - if [[ "1" == "$(which pwsh > /dev/null && echo 1)" && -f ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1 ]]; then - echo 'Starting PowerShell SZcripts...' - echo "pwsh" >> /tmp/default_shell - pwsh - if [[ ! -f /tmp/keep_shell_after_pwsh ]]; then - exit + echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; pwsh: $(which pwsh); Setup-ScriptEnv: $(ls ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1) " >> /tmp/default_shell + if [[ "$SZ_SKIP_DEFAULT_SHELL" != "1" ]]; then + export SZ_SKIP_DEFAULT_SHELL=1 + if [[ "1" == "$(which pwsh > /dev/null && echo 1)" && -f ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1 ]]; then + echo 'Starting PowerShell SZcripts...' + echo "pwsh" >> /tmp/default_shell + pwsh + if [[ ! -f /tmp/keep_shell_after_pwsh ]]; then + exit + fi fi fi -fi -echo "continue" >> /tmp/default_shell -export SZ_SKIP_DEFAULT_SHELL=1 + echo "continue" >> /tmp/default_shell + export SZ_SKIP_DEFAULT_SHELL=1 +} + +[[ "$SZ_POWERSHELL_LAUNCER_CALLED" != "1" ]] && PowerShellLauncher