EzDevInfo.com

environ

Library for managing environment variables in Clojure

What does :provided mean in profiles.clj?

Luminus right now is creating a profiles.clj with this content:

{:provided {:env {;;when set the application start the nREPL server on load
                  :nrepl-port "7001"
                  :database-url "jdbc:mysql://localhost:3306/mysqlkorma_dev?user=db_user_name_here&password=db_user_password_here"}}}

What does :provided do here? In environ's documentation it seems to point to having two entries, one for dev and one for test https://github.com/weavejester/environ.


Source: (StackOverflow)

How do I get the environment name when using environ in Clojure?

How do I get the environment name when using environ in Clojure? I mean, :dev, :test, etc. The reason for wanting this is to pass it to Yeller so when it displays errors it can tell me which environment they happened into. Errors in staging are treated differently than errors in production.


Source: (StackOverflow)

Advertisements

How to retrieve Username/Logname from Environ file

I want to fetch the USER/username/LOGNAME from the /proc/[pid]/environ file in linux. I can only access it as a root. Right now I am opening the file and trying to print the username from it. But nothing shows up on my screen. I know the PID directories constantly change their numbers/names so it's getting difficult for me to fetch the same.

file = open("/proc"+str(pid)+"environ").readlines()
for line in file:
    if line.startswith(USER):
         username = line.split()[1]
         print(username)

This is how I am using it. But nothing shows up on screen. Also there is no line that starts with USER in the environ, it is all in a paragraph wise. I would like to know how to read this data? I am displaying the same on my tkinter gui


Source: (StackOverflow)