environment-variables

Getting user environment variables using PHP

给你一囗甜甜゛ 提交于 2019-12-24 18:18:58
问题 On centos and Redhat I created a file /etc/profile.d/marketing_vars.sh and added following lines to it #Vars for PowerMail export CmsRoot="/var/www/html/cms/" export PMRoot_Dev="/var/www/html/powermail/" export PMRoot_QA="/var/www/html/powermail/" export PMRoot_Pro="/var/www/html/powermail/" On command line i hit "source marketing_vars.sh" and "chmod +x /etc/profile.d/marketing_vars.sh" I then created a test.php file and added these lines to it error_reporting(E_ALL ^ E_NOTICE); echo "PMRoot

How to “top -m 10 -n 1” command output save to String in Android Code?

独自空忆成欢 提交于 2019-12-24 14:37:37
问题 i am trying this code public String ReadFromCMD() { ProcessBuilder cmd; String result=""; //int resultshow = 0; try{ String[] args = {"/system/bin/top -m 10 -n 1"}; cmd = new ProcessBuilder(strCmdArgs); Process process = cmd.start(); InputStream in = process.getInputStream(); BufferedReader reader = new BufferedReader( new InputStreamReader(process.getInputStream())); int read; char[] buffer = new char[4096]; StringBuffer output = new StringBuffer(); process.waitFor(); while ((read = reader

Accessing global variables fails

≡放荡痞女 提交于 2019-12-24 13:23:44
问题 I was trying to implement simple authentication in R that would store credentials outside of the source code under revision control. I'm aware of the approach using options() and getOption() , but using it would force me to remove project-level .Rprofile from revision control. I prefer to use another approach, based on exporting credentials' environment variables via .bashrc of an R-associated Linux user ( ruser ) and then reading these credentials in project-specific .Rprofile into global

How to setup different environments and corresponding configurations under sails.js?

馋奶兔 提交于 2019-12-24 13:16:10
问题 I'm in the process of migrating a 2010 RoR app to Sails.js. From the face of it Sails.js looks like the best framework for migrating the app to Node.js platform. In the process, I came across a limitation - it seems like sails only caters to a development environment through local.js and a production environment. Under RoR, I had a environments folder under config, which contained dev, test, staging, production, etc. ruby files that contained constants, logging levels, etc. defined for that

Path initialization: preventing “The input line is too long”

女生的网名这么多〃 提交于 2019-12-24 12:35:06
问题 Some people say that their path is too long, However, the problem is often caused by recurring call of the same batch script with code like set mypath=%mypath%;appendix . People just do not realize that. I proposed a solution to restore the env variables upon exit set old_path=classpath set classpath=%classpath%;appendix java myApp set classpath=old_path But it is tedious and error prone. I may easily forget to recover or fail due to exception, another exit path. Can this be done

Include external XML ENTITIES using SYSTEM while resolving path with $ENV variable

断了今生、忘了曾经 提交于 2019-12-24 11:54:12
问题 Looking at some posts and others, I'm close to what I'm looking for, but not there yet. Overall goal To have XML ENTITY file s included within other XML file s , with the URI to SYSTEM taken from the an environment variable! Sample XML ENTITY files (not sure if xml declaration needed) $XML_PATH_SET_PER_ENV/entites/$CLIENT/entities.ent <!ENTITY COMPANY_ID "9800"> <!ENTITY PARENT_ID "98100"> <!ENTITY ACCOUNT_NAME "THE SUN PEOPLE"> <!ENTITY ACCOUNT_AB "TSP"> or $XML_PATH_SET_PER_ENV/entites/

composer dump-autoload not recognized command

自作多情 提交于 2019-12-24 11:35:41
问题 whenever I use composer dump-autoload with laravel I get this error Generating optimized autoload files Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover 'C:\Program' is not recognized as an internal or external command, operable program or batch file. Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1 I think it has something to do with "environment variables" so my paths C:\ProgramData\Oracle\Java

Interpreting command substitution from a variable in bash

随声附和 提交于 2019-12-24 11:03:47
问题 For the following value of FOO: $ FOO='echo `echo hello`' $ $FOO `echo hello` how can I get the expected output: hello Basically, how can I interpret a command substitution in the contents of a variable? 回答1: Answering the question as given, eval $FOO but you're probably going about your real problem the wrong way. 回答2: Try this $ FOO="echo `echo hello`" $ $FOO Just replace single quotes with double quotes . 来源: https://stackoverflow.com/questions/11531332/interpreting-command-substitution

How does docker run interpret dynamically generated --env arguments

ⅰ亾dé卋堺 提交于 2019-12-24 10:37:05
问题 I am trying to provide a dynamically generated list of --env VAR1 --env VAR2 --env-file env.list environment variables to docker run . Unfortunately it is not working. for --env mapped variables, the variables are not visible in the container. for --env-file provided file, docker complains that it cannot find the file: docker: open "env.list": no such file or directory. Details Running: # env_params contains either --env or --env-file arguments MY_VAR=123 env_params='--env "MY_VAR"' echo $

Not able to set environment variable in Dockerfile for Custom runtime environment in google app engine

巧了我就是萌 提交于 2019-12-24 10:06:53
问题 I'm using below Dockerfile for setting up a custom runtime environment for app engine. FROM ubuntu:latest RUN apt-get update -y RUN apt-get install -y python-pip build-essential libssl-dev libffi-dev python-dev libxml2-dev libxslt1-dev xmlsec1 RUN apt-get install -y curl unzip RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz RUN mkdir -p /usr/local/gcloud RUN tar -C /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz RUN /usr/local