Skip to content

2025

Post22

W chatce w lesie siedzi Pan
Nie odzywa się do nikogo bo jest sam
Myśli ciężkie, głowa pogrążona w chorobie
Zaraz zawiśnie na grobie
Wspomnienia zaplątane same w sobie
Siedzi, mruga, własną głowę zruga
Pora zaraz będzie na spanie
A on wciąż, o matko Boska, gdzie jego posłanie?
Poradzić nic nie może, bo siedzi wciąż na dworze
Robaczki, wykałaczki go wkurwiają
Chciałby uciec jak ten zając
co poradzić temu Panu?
Myślę że to cud że doszedł aż tu
Drogi miał w brud
Co zrobić? Ktr pomoże
Matko boska on wciąż siedzi na dworze
Siedzi, mruga
Fajkę pyka
Tytoń słaby
Jest już cały osiwiały

Post21

blood stains in the snow
you left a few
jumping home
for me to remember the last walk
snow will melt soon
this memory
I will not let fade
you were loved
and you loved us too
of that I'm sure
it's a tough call
to let you sleep
don't fear wherever you go
remember wide beaches
you used to love
we will be there someday to
Plamy krwi na śniegu
zostawiłaś kilka,
wracając do domu,
abym zapamiętał ostatni spacer.
Śnieg wkrótce stopnieje,
ale to wspomnienie
nie pozwolę mu odejść.
Byłaś kochana
i kochałeś też nas,
tego jestem pewien.
To trudna decyzja,
pozwolić ci zasnąć.
Nie bój się, dokądkolwiek zmierzasz,
pamiętaj o szerokich plażach,
które tak kochałaś.
Czekaj tam na nas,
W końcu przyjdziemy.

Environment variable

but only in a specific directory

The idea - use the Prompt function to check if you're in a specific dir and set/unset an env var:

function Prompt {
    $currentDir = Get-Location
    if ("C:\git\that-special-dir" -eq $currentDir) {
        $env:THAT_SPECIAL_ENV_VAR = "./extra.cer"
    }
    else {
        Remove-Item Env:\THAT_SPECIAL_ENV_VAR
    }
}

Extract the special env setting/unsetting to a function:

function SetOrUnSet-DirectoryDependent-EnvironmentVariables {
    $currentDir = Get-Location
    if ("C:\git\that-special-dir" -eq $currentDir) {
        $env:THAT_SPECIAL_ENV_VAR = "./extra.cer"
    }
    else {
        Remove-Item Env:\THAT_SPECIAL_ENV_VAR
    }
}

function Prompt {
    SetOrUnSet-DirectoryDependent-EnvironmentVariables
}

If your Prompt function is already overwritten by ex. oh-my-posh:

function SetOrUnSet-DirectoryDependent-EnvironmentVariables {
    $currentDir = Get-Location
    if ("C:\git\that-special-dir" -eq $currentDir) {
        $env:THAT_SPECIAL_ENV_VAR = "./extra.cer"
    }
    else {
        Remove-Item Env:\THAT_SPECIAL_ENV_VAR
    }
}

$promptFunction = (Get-Command Prompt).ScriptBlock

function Prompt {
    SetOrUnSet-DirectoryDependent-EnvironmentVariables
    $promptFunction.Invoke()
}

Why did I need this?

In a repository with several js scrapers run by NODE a few scrape data from misconfigured websites. These websites don't provide the intermediate certificate for https. Your browser automatically fills in the gap for convenience but a simple http client like axios will rightfully reject the connection as it can't verify who it is talking to (see more here)

Solution?

Use NODE_EXTRA_CA_CERTS

  • You configure your production server with NODE_EXTRA_CA_CERTS.
  • When testing locally you get tired of remembering to set NODE_EXTRA_CA_CERTS.
  • You add NODE_EXTRA_CA_CERTS to your powershell profile. Now every time you run anything using NODE (like vs code) you see
    Warning: Ignoring extra certs from `./extra.cer`, load failed: error:02000002:system library:OPENSSL_internal:No such file or directory
    
  • You get annoyed and you ask yourself how to set an environment variable but only in a specific directory

I use this myself here -> the public part of my powershell-profile