environment-variables

keep the same conda env after entering screen

走远了吗. 提交于 2020-01-05 04:13:09
问题 I have tried the following at the end of my .screenrc conda activate ${CONDA_DEFAULT_ENV} in my bash terminal, I typed: conda activate atwork3 echo ${CONDA_DEFAULT_ENV} > atwork3 screen -S test > # starts screen OK but comes with env base echo ${CONDA_DEFAULT_ENV} > base I read that you cannot put bad commands in the .screenrc or the full file gets ignored which is probably what happens to me here I also tried things from how-to-open-tabs-windows-in-gnu-screen-execute-commands-within-each-one

Randomization of environment variable addresses

一世执手 提交于 2020-01-04 10:41:52
问题 I am using bash. I have switched off ASLR in Ubuntu 11.04 using #sysctl -w kernel.randomize_va_space=0 And I have exported a variable from the shell using $ export MYSHELL=/bin/sh I wrote a C program to get the address of the MYSHELL : void main(){ char* shell = getenv("MYSHELL"); if (shell) printf("0x%x\n", (unsigned int)shell); } It spat out 0xbffffe82 . When I used it as a part of my attack for ret-to-libc, the address changes (although by a very small offset). Why does this happen? Also

Android SDK not working

隐身守侯 提交于 2020-01-04 05:15:34
问题 The Android SDK doesn't open so i tried to open Android.bat to see the errors and I get this Error: The system cannot find the file specified. The system cannot find the file specified. The system cannot find the file specified. The system cannot find the file specified. Error: Could not find or load main class com.android.sdkmanager.Main Press any key to continue . . . Here is my Environment Variables: ANDROID_SWT: C:\adt-bundle-windows-x86\sdk\tools\lib\x86. JAVA_HOME: C:\Program Files\Java

setting DJANGO_SETTINGS_MODULE on windows Correctly

半世苍凉 提交于 2020-01-04 04:38:10
问题 There are my post on this query but most of them are for linux. None of them exlicitly for windows in my application i'm setting up the database (sqlite3 , default in Django). after editing setting.py file of my application (mysite) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'D:/Django_Code/sqlite.db', # Or path to database file if using sqlite3. 'USER': '', # Not used with sqlite3. 'PASSWORD': '', #

Adding variables at build time in Xcode

邮差的信 提交于 2020-01-04 04:13:16
问题 I have some dynamic values I need to change based on the type of build I am doing in Xcode. I have created 2 schemes DEV and PROD and set environment variables in each I then consume these in code as follows var serviceDomain: String { let envVar = ProcessInfo.processInfo.environment guard let value = envVar["APP_SERVICE_DOMAIN"] else { fatalError("Missing APP_SERVICE_DOMAIN enviroment variable") } return value } Is this the correct way to approach this? Once an app is compiled, should these

How to add a directory to the $PATH variable with macosx leopard

泪湿孤枕 提交于 2020-01-04 04:12:07
问题 I really am unable to add a directory to the $PATH variable. I have tried to add a file text to etc/paths.d/ containing the path i want to add, but the OS refutes to let me add a file to that directory (permission denied). I don't know why, since i login as admin... Please help me, i need to add the adb path for the android sdk on macosx. 回答1: The permissions on /etc/paths.d only allow the root account to write to it, not normal admins. This is actually fairly common in OS X, since many users

Import error? (PYTHON 3.2)

随声附和 提交于 2020-01-04 03:15:53
问题 I have my own module named v_systems, and I'm trying to import that module in another python file (which is also saved in the same directory as the file v_systems is saved) I need to import it as import v_systems as vs or even if I try to import as import v_systems . However it gives me an error saying no module v_systems exists. How may I fix this error? 回答1: It might not be in the system path. Do the following: It needs to be in the directory of the sys.path . What I did is I created a

Setting a part of a PWD as a prompt and keeping a variable updated

随声附和 提交于 2020-01-04 02:56:10
问题 I'm using tcsh, and I'm trying to set a part of the PWD to appear always in the prompt (so I will always know in which "parent" directory I am). I managed to extract the needed part of the prompt in the following way, and it works fine (I call it MyTreePath ): set MyTreePath=`echo $PWD | awk '{... print whichTree}'` I've added the code above to my .tcshrc and I've added %$MyTreePath to my set prompt line in .tcshrc . The problem is that once the shell is opened, the MyTreePath doesn't change,

how to set different environment variables of Deployment replicas in kubernetes

旧巷老猫 提交于 2020-01-04 02:26:26
问题 I have 4 k8s pods by setting the replicas of Deployment to 4 now. apiVersion: v1 kind: Deployment metadata: ... spec: ... replicas: 4 ... The POD will get items in a database and consume it, the items in database has a column class_name . now I want one pod only get one class_name 's item. for example pod1 only get item which class_name equals class_name_1 , and pod2 only get item which class_name equals class_name_2 ... So I want to pass different class_name as environment variables to

Gradle Environment variables. Load from file

坚强是说给别人听的谎言 提交于 2020-01-03 16:53:56
问题 I am new to Gradle. Currently I have this task: task fooTask { doLast { exec { environment 'FOO_KEY', '1234567' // Load from file here! commandLine 'fooScript.sh' } } } fooScript.sh #!/bin/bash echo $FOO_KEY Everything works great. But I have env.file with all needed environment variables. This file is used in Docker builder. env.file FOO_KEY=1234567 Question: how can I use env.file together with Gradle environment to load all needed env. params? 回答1: What about this : task fooTask { doLast {