Add profile
This commit is contained in:
102
.profile.ps1
Normal file
102
.profile.ps1
Normal file
@@ -0,0 +1,102 @@
|
||||
oh-my-posh init pwsh --config "C:\Users\ZackariasMontell\OneDrive - RevolutionRace\setup\theme.omp.json" | Invoke-Expression
|
||||
function cdli {
|
||||
Set-Location "C:\repos\litium"
|
||||
}
|
||||
|
||||
Set-Alias -Name cd-li -Value cdli
|
||||
|
||||
function cdsf {
|
||||
Set-Location "C:\repos\storefront"
|
||||
}
|
||||
function cdr {
|
||||
Set-Location "C:\repos"
|
||||
}
|
||||
|
||||
Set-Alias -Name cd-repos -Value cdr
|
||||
Set-Alias -Name cd-sf -Value cdsf
|
||||
|
||||
function proxy {
|
||||
winget install caddy
|
||||
& caddy 'C:\Users\ZackariasMontell\OneDrive - RevolutionRace\caddyfile'
|
||||
}
|
||||
|
||||
function reset-card {
|
||||
& "gpg-connect-agent" "killagent" "/bye"
|
||||
& "gpg-connect-agent" "/bye"
|
||||
& "gpg" "--card-status"
|
||||
}
|
||||
|
||||
function card {
|
||||
& "gpg" "--card-status"
|
||||
}
|
||||
|
||||
function Open-KubernetesDashboard {
|
||||
Write-Host "Ensuring doctl.."
|
||||
if ($os -eq 'Unix') {
|
||||
brew install doctl
|
||||
}
|
||||
else {
|
||||
winget install DigitalOcean.Doctl
|
||||
}
|
||||
|
||||
Write-Host "Checking your login status.."
|
||||
$accountInfo = doctl account get
|
||||
|
||||
if ($null -eq $accountInfo) {
|
||||
$token = Read-Host "You are not logged in, please enter your doctl token, you can create one here https://cloud.digitalocean.com/account/api/tokens"
|
||||
doctl auth init -t $token
|
||||
}
|
||||
|
||||
$cluster = Read-Host "What cluster do you want to connect to? staging or production (default: staging)"
|
||||
|
||||
if ($cluster -eq "production") {
|
||||
$cluster = "production-cluster"
|
||||
}
|
||||
else {
|
||||
$cluster = "staging-cluster"
|
||||
}
|
||||
|
||||
Write-Host "Setting up kubectl context.."
|
||||
doctl kubernetes cluster kubeconfig save $cluster
|
||||
|
||||
Write-Host "Generating token.."
|
||||
$token = kubectl -n kubernetes-dashboard create token admin-user
|
||||
Set-Clipboard -Value $token
|
||||
Write-Host "Token copied to clipboard."
|
||||
|
||||
Write-Host "Opening Kubernetes dashboard.."
|
||||
$url = "http://localhost:8080/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login"
|
||||
|
||||
Start-Process $url
|
||||
|
||||
Write-Host "Setting up port forwarding, close this when you are done.."
|
||||
kubectl proxy --port 8080
|
||||
|
||||
}
|
||||
|
||||
Set-Alias -Name dash -Value Open-KubernetesDashboard
|
||||
Set-Alias -Name k -Value kubectl
|
||||
Set-Alias -Name d -Value docker
|
||||
Set-Alias -Name do -Value doctl
|
||||
|
||||
function Open-Nuxt(){
|
||||
cdsf
|
||||
yarn
|
||||
yarn dev
|
||||
}
|
||||
|
||||
function Edit-Powershell(){
|
||||
nvim $profile
|
||||
. $profile
|
||||
}
|
||||
|
||||
function Edit-Nvim(){
|
||||
prev = (& pwd).Path
|
||||
cd ~\AppData\Local\nvim
|
||||
nvim .
|
||||
cd prev
|
||||
}
|
||||
|
||||
Set-Alias -Name vim -Value nvim
|
||||
|
||||
Set-Alias -Name yy -Value Open-Nuxt
|
||||
Reference in New Issue
Block a user