Insomnia: how do I reference a windows environment variable in Insomnia? - insomnia

I want to use a windows environment variable in Insomnia. There is an option to read OS properties, which I thought would allow me to use windows env variables but it's not obvious how. In the below I am trying to add "testWE" and I am trying using OS/userInfo.
Another option is to use a custom function but again I am not familiar with this syntax
Any idea on how to do this?

Try the insomnia-plugin-system-env plugin.
Example:

Related

CANoe tool DBC configuration

I have been trying to create a DBC file in CANoe, but in the latest demo version 13.0 I am not getting any option for environment variables.
Can anyone please help me finding or guiding me to how to get the environment variables in the DBC file?
Many pages of the help are referring to env vars being usable only if they were added to the Database, but then again via the CANoe Ribbon there is no way of adding new Environment Variables, and this is were you are confused.
To set new Environment Variables, you'll need CANdb++. To see existing Environment Variables, go View > List > Environment Variables. From here, you can add new env vars to the database.
Env Vars are typically used as interface between network nodes and specifically in panels as handles.
Demo versions of CANoe might lack certain functionalities, but luckily the CANdb++ editor is a free tool you can download from vector
disclaimer: this answer is based on this question's answer.
I see that you are creating a new DBC probably for learning purpose. An important point to be noted here is CANoe will stop supporting Environment Variables in the future versions. The current comment from Vector (according to v13.0 help document) is this:
The creation of environment variables is no longer supported. Instead, use system variables directly in CANoe. Currently CANoe still supports the use of environment variables. This support will not be available in future versions.
So, it is preferred to use system variables rather than environment variables.
To view the above comment in the v13.0 help document, go to the index tab and type "Environment Variable".
The creation of environment variables is no longer supported. Instead, use system variables directly in CANoe. Currently CANoe still supports the use of environment variables. This support will not be available in future versions.

How can we read environment variable in postgresql

I have a postgresql function where I want to use get user defined environment variable. Is there any default function to get the environment variable directly ?
Since a function is running on the database server, you would get the environment of the database server process (I wonder if that is what you want). This should be restricted to superusers (or perhaps the pg_execute_server_program role).
There is no standard function for this, probably because it is mostly useless, but it should be easy to write a function in C, PL/PerlU or PL/PythonU to do that.
No there is no SQL function available to do this.
But it should not be complicate to do using https://www.postgresql.org/docs/12/xfunc-c.html.

How can I use #define to load tasks?

I try to find the best way to load addins and tasks in case of breaking changes.
Background
I have created an addin and several tasks based on Cake 0.25.0. The addin as well as the tasks are packaged within a NuGet package. Now I would like to update the used Cake version to 0.32.1 but that is not so easy as I try to explain below.
These NuGet packages that I created are used in multiple repositories and I provide from time to time hotfixes. To be able to automatically load the latest version of the addin/tasks there is no version defined in the pre-processor directive. Means like this:
#load nuget:My.Tasks
#addin nuget:My.AddIn
My Dilemma
I need to make sure that older releases can still use the preprocessor directives as mentioned above. Now I am searching for an approach to achieve this target.
I thought renaming the original package id's would help and everyone who would like to use the upgraded version of my packages have to change the preprocessor directive in their build.cake.
But I am quite sure there must be a smarter way and I hope you can help me.
Next idea I had is to use #define preprocessor directives. So I created a new NuGet package containing only one Cake script named bootstrapper.cake as follows:
#if (V20)
#load nuget:My.Tasks
#addin nuget:My.AddIn
#else
#load nuget:My.Tasks&version=1.0.55
#addin nuget:My.AddIn&version=1.0.55
#end
This does not work as expected. Unfortunately both versions of the respective packages are loaded into the addins respectively tools directory and I am getting errors like "error CS0111: Type 'Submission#0' already defines a member called" and others.
Is there a way to achieve my goal? The idea to use #define was quite nice from my perspective. Maybe it is somehow possible or does anyone know a better way?
Personally I think the best would be, if Cakebuild would support wildcards in the preprocessor directives like
#load nuget:My.Tasks&version=1.0.*
Best Regards
Mr. T
Ifdef won't currently work with preprocessor directives, as they're handled by the C# compiler after preprocessor directives have been executed.
What you can do is to use an environment variable, preprocessor directives support environment variables substitution.
As an example:
Setting variable
RECIPE_VERSION="&version=0.3.0-unstable0400"
Could be used like this
#load nuget:?package=Cake.Receipe%RECIPE_VERSION%
Without the environment variable set, it'll omit the version.

Using `qlot` from a Lisp REPL

I'm interested in using the qlot library from inside of a Lisp image to manage multiple local instances of quicklisp.
There doesn't seem to be any documentation on how to use it, except through a non-Lisp CLI interface, and the obvious
(qlot:with-local-quicklisp (#P"/a/path/here/") (qlot:install :skippy))
or
(qlot:with-local-quicklisp (#P"/a/path/here/") (qlot:quickload :skippy))
give me
Component "skippy" not found
[Condition of type ASDF/FIND-SYSTEM:MISSING-COMPONENT]
What I'm looking for is a way to install a particular library by name. Basically, exactly how one would use ql:quickload, but targeting a specific, local directory instead of ~/quicklisp. What am I doing wrong?
It looks like the intent is to modify dynamically scoped variables in a way that makes using ql:quickload directly possible.
So
(qlot:with-local-quicklisp (#P"/a/path/to/some/quicklisp/")
(qlot/util:with-package-functions :ql (quickload)
(quickload :skippy)))
will result in skippy being installed in the quicklisp instance at #P"/a/path/to/some/quicklisp/" instead of the default location.
This leaves me a bit perplexed as to what qlot:quickload is for; its describe output doesn't shed additional light.

Best way to using Global Variables in PowerShell?

I want to use variables over PowerShell instances away.
(I know that global variables are not nice)
Is this the best way to define a variable over instances in PowerShell? Other ideas?
($global:variable is not over PowerShell instances away)
[Environment]::SetEnvironmentVariable("TestVariable", "Test value.", "User")
[Environment]::GetEnvironmentVariable("TestVariable","User")
Yes. Other options would be to:
Write/read a hashtable to a settings file using Export/Import-CliXml.
Stash information in the user's registry hive.
But adding a user environment variable is also a good way to go and the way you suggest is what is needed for the environment changes to survive exiting the current PowerShell session.