Google API Keys Missing Warning Message when using Chromium Portable - windows

When i use the new Chromium Portable browser it always shows "Google API keys are missing.Some functionality of Chromium Portable will be disabled" after starting up.
How do i get rid of this warning message and what does it mean?.

To get rid of the message...
...on Windows, you can use the command prompt to set the following environment variables to "no":
setx GOOGLE_API_KEY "no"
setx GOOGLE_DEFAULT_CLIENT_ID "no"
setx GOOGLE_DEFAULT_CLIENT_SECRET "no"
Windows' environment variables can also be set from the "Advanced System Settings" tab of the "System" control panel. After setx ... relaunching the browser should no longer have the message. Setting the variables through the "Advanced System Settings" tab may require a log-out before it takes effect.
... on Linux you can use the terminal to set the environment variables to "no" in the bash shell:
export GOOGLE_API_KEY="no"
export GOOGLE_DEFAULT_CLIENT_ID="no"
export GOOGLE_DEFAULT_CLIENT_SECRET="no"
A subsequent launch of the browser from the terminal will not show the missing API key message. To make this setting permanent and to cover invocations from clicking on an icon, follow the directions here for setting environment variables that affect terminal as well as graphical logins.
...on macOS, you can add the following key-value pairs to the LSEnvironment dictionary in Chromium.app > Contents > Info.plist:
<key>LSEnvironment</key>
<dict>
<key>GOOGLE_API_KEY</key>
<string>no</string>
<key>GOOGLE_DEFAULT_CLIENT_ID</key>
<string>no</string>
<key>GOOGLE_DEFAULT_CLIENT_SECRET</key>
<string>no</string>
</dict>
(Note that macOS may have cached the existing Info.plist file, so changes may not take effect immediately. See this answer for some ways around that.)
As for the meaning, I think Dragomir Goranov's answer gives sufficient information.

I needed to get rid of this message too, so I just took what mormegil suggested but applied it to a batch script that launches Chromium.
My below sample batch file will launch Chromium into KIOSK mode but you can just remove the --kiosk if you don't need that.
set GOOGLE_API_KEY="no"
set GOOGLE_DEFAULT_CLIENT_ID="no"
set GOOGLE_DEFAULT_CLIENT_SECRET="no"
"C:\chromium\ChromiumPortable_49.0.2593.0.paf\App\Chromium\32\chrome.exe" --kiosk
I did it this way since I don't want to set those environment variables to affect other instances of Chromium but rather just the one that I'm launching with my batch script.

It means that some functionality will not work. For example "Chrome Sync API" requires API keys.
For more information you can check this URL: http://www.chromium.org/developers/how-tos/api-keys
If something is not clear to you after you read the provided information, please specify exactly what.

Disabling API Key will disable functionality like SYNC. A better solution is to use Google API Keys that LINUX Chromium Browser comes with.
Paste the following into command window on Windows:
setx GOOGLE_API_KEY "AIzaSyCkfPOPZXDKNn8hhgu3JrA62wIgC93d44k"
setx GOOGLE_DEFAULT_CLIENT_ID "811574891467.apps.googleusercontent.com"
setx GOOGLE_DEFAULT_CLIENT_SECRET "kdloedMFGdGla2P1zacGjAQh"
on Linux:
export GOOGLE_API_KEY="AIzaSyCkfPOPZXDKNn8hhgu3JrA62wIgC93d44k"
export GOOGLE_DEFAULT_CLIENT_ID="811574891467.apps.googleusercontent.com"
export GOOGLE_DEFAULT_CLIENT_SECRET="kdloedMFGdGla2P1zacGjAQh"
Restart Chromium, and you are all set.

On macOS another (simpler) solution is:
/usr/bin/env GOOGLE_API_KEY="no" GOOGLE_DEFAULT_CLIENT_ID="no" GOOGLE_DEFAULT_CLIENT_SECRET="no" /usr/bin/open -a chromium
as open passed existing environment variable to the launched application (see man open).
PS: I would have preferred to add that as a comment... but I can't as stackoverflow told me that I don't have enough reputation.

For LINUX users, for some reason if you want to use the raw build straight out of a compile without packaging, add these lines (on top) to the chrome-wrapper file present in the directory.
export GOOGLE_API_KEY="no"
export GOOGLE_DEFAULT_CLIENT_ID="no"
export GOOGLE_DEFAULT_CLIENT_SECRET="no"
and execute chrome by cd to the directory and ./chrome-wrapper and not ./chrome
Make sure you make the necessary changes in the chromium-devel.desktop which maybe in ~/.local/share/applications/ so as to run from the bash script and not from the executable.

Related

How do you make .sh or .bash files open with Windows Terminal Ubuntu?

I really like coding in bash, but there used to be many limitations of bash functionality in Windows. Though now there are many benefits to the bash windows users now rather than how it was pre windows 10. However, with all of the improvements, there is one thing that I feel leaves to be desired for me. The default behavior of the double-click of .sh files never really was able to do anything in windows, the .sh file extension isn't even available in the "choose default apps by file type" section of the settings. I had a desire to be able to change the default action for .sh files but neglected it and shook it off for a while, but this link finally gave me hope.
Before Ubuntu terminal and the addition of Windows subsystem for Linux, there was really no way to access bash terminal on Windows without a VM. Now with the addition of Windows Terminal which combines Microsoft Azure Terminal, Command Prompt, Powershell, and Ubuntu, it is really awesome for people like me, but despite the new awesome additions to windows allowing further integration of Linux terminal into Windows, even being able to edit the C: drive with Ubuntu.
I am sure there is a way to allow double-click of .sh files to open in windows terminal Ubuntu, but I don't know how. This question helped me on my journey to figure out how to do it and helped me make the default .bat file behavior change to Windows terminal, but I still have come to an enpass where I truly believe that it is not possible. So here is where I go when I have given up, the magical land of Stack Overflow :)
Attempts
So far I have looked into the "Choose default apps by file extension" section of settings and could not find .sh in there nor could I find it in any of the default apps sections of normal settings.
After I couldn't find anything about .sh in settings, I looked into the registry and looked for HKEY_CLASSES_ROOT and looked for sh or anything bash file related in HCR alone, HCR\*\shell, HCR\*\shellx, and HCR\*\Openwithlist and could not find anything.
I then tried to do ftype, but I could not find how to use ftype with .sh. I tried doing ftype .sh="C:\Users\asian\AppData\Local\Microsoft\WindowsApps\wt.exe" -p "Ubuntu" "%1" %* but i got the error "File type '.sh' not found or no open command associated with it."
I Also tried just clicking the .sh file so it brings up the "How do you want to open this file" menu and went to Windows Terminal but it opened the bash file in powershell with the error [error 0x800700c1 when launching `C:\Users\asian\Desktop\test.sh']
These where everything I could think of and none of it was working. Help and pointers are appreciated. Thank you!
I suggest you install the Git for Windows package, as it comes with a light-weight bash environment. This is likely to be able to be in the list of available apps when right-click -> Properties on a .sh or .bash file and say Open With and click the Change button next to Open With.
Other options are Cygwin or WSL for a 95% pure Linux environment on Windows.

Run command to go to user's documents folder (similar to %appdata%)?

Putting %appdata% into the run window will open up the Appdata folder, but what is the command to open the User's Documents folder, even when someone else logs in? I thought it was something like %userdir%, but I can not find out what it is. Not sure what to search for in Google either so I am at a loss.
There is no environment variable for this. You'll need to set one. Here's a list of all Windows default environment variables:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true
*This is for XP, but should be the same for newer versions of Windows
For a single terminal session, you can just use
set USERDOCS=%USERPROFILE%\Documents
For all terminal sessions, you'll need to set a system environment variable. You can do this using the GUI or using setx -m USERDOCS %USERPROFILE\Documents, as described here.
The command to make this happen would be
explorer %USERDOCS%
But if you wanted to make an alias to that (i.e. a openuserdocs command), I can update and explain.

how do I run an msi with SEE_MASK_NOZONECHECKS without restart

I'm trying to install a driver with a remote framework that lets me run shell commands spawned as children of the remoting/monitoring app on the remote machine, run as cmd /c "command". But the driver refuses to install due to a security feature which thinks the driver may be unsafe.
The driver also has quotes(spaces in path) so its something like
Dim command: command = "\\\\server\\driver\\folder\\Autorun.exe" /passive /norestart";
Set retVal = remote.Shell(command)
which runs
cmd /c " "\\server\driver\folder\Autorun.exe" /passive /norestart"
on the remote machine
I've tried and have had trouble using setx SEE_MASK_NOZONECHECKS 1 /m in a previous statement, I'm guessing that the subprocess don't see new global enviromental variables that weren't around when it's parent started, and won't work without a restart. I'd like to avoid a restart.
I tried running
cmd /c " set SEE_MASK_NOZONECHECKS=1 & "\\server\driver\folder\Autorun.exe" /passive /norestart"
but it doesn't seem to work. Any ideas?
You got a bit lost on the way SEE_MASK_NOZONECHECKS is used. It is not an environment variable and cannot be tinkered with from the command prompt, it is an option for ShellExecuteEx(). A winapi function that you indeed use to start programs. It isn't very clear what programming tools you have access to, using it in a batch file or VBScript isn't going to work. You'd need at least, say, VB.NET and pinvoke the function. You can get the required declarations from the pinvoke.net web site.
Let's talk about what's really going on, you might find a simpler solution. When you download a file from an Internet web site, Windows adds an extra stream to the file that indicates where the file came from. Which basically states "this file did not come from a safe place" and makes the driver installer balky. Which is rather an important feature if you think about it, your user is going to install software that can do a lot, you pretty much have free reign of the machine if you can get a driver installed.
If you right-click the file in Explorer and click Properties then you'll see this at the bottom of the window:
All that's needed is to click that Unblock button. So this is a simple way for your user to solve the problem. You could document the extra step in the install instructions. Also with the advantage that it is now the user that took responsibility of allowing potentially unsafe code to be installed.
Other ways to get the file unblocked is with PowerShell's Unblock-File command and the SysInterals' streams utility, -d option.
And you probably ought to consider the option of writing your own installer. Which will keep the driver packaged in the setup file so it won't be tinkered with by Windows. And the user gets the warning when he starts the installer instead. And it can be signed so the user has some confidence in where the file came from and that it didn't get messed with on its way to his machine. There are many utilities that help you write an installer, like InstallAware, InstallShield, NSIS, etcetera.
I beg to differ to Hans' answer:
Of course, SEE_MASK_NOZONECHECKS is as well a predefined environment variable. Changing it in a process and then starting a child process (e.g. msiexec.exe) which by defaults inherits the environment, has just the same result as using ShellExecuteEx() and providing SEE_MASK_NOZONECHECKS as a parameter to the SHELLEXECUTEINFO structure. The first method is preferred by admins or quick hacks, e.g. if you work with batch or script files which set the environment variable- or when the final call to the .msi file lying on the unsafe network drive is not done by your own code.
For example:
#echo off
set SEE_MASK_NOZONECHECKS=1
call msiexec.exe /i "\\MY_UNC_DRIVE\installs\mysetup.msi /qb /L*v "c:\logs\mysetup.log"
call "\\MY_UNC_DRIVE\installs\Just_another_setup.exe"
If you already use a ShellExecuteEx() in your code, then of course, go with the parameter as Hans mentioned, because this implementation it is more closed. (If you use CreateProcess(), think about using ShellExecuteEx() instead.
Getting back to the environment variable(s). Generally you cannot influence the environment of already started processes. You can set the default environment used by NEW processes by the "setx" command used in the question. But with "setx" you don't change the environment for your current process.This was the problem in question. For this you have to use "set" as shown. So either use both commands after each other or don't use setx at all because for running a setup on foreign machines, it is not clean to make permanent security changes without asking.
For more details on permanent changes/admin point of view, see:
https://superuser.com/questions/595211/removing-the-open-file-security-warning-in-windows-8/934283#934283
Important: As mentioned, there is no general way in Windows to influence processes which already run (only own-defined inter-process-communication maybe), so it is important to set the environment variable before starting the setup to be influenced.
One more thing: Some people think, one must use "SETLOCAL" in a batch file. Normally this is not necessary. Environment changes with "set" are not permanent, and do not incluence "other" processes- they are only inherited to subprocesses and, partly, to superprocesses. But, when the caller on first level ends, the environment is reverted to original state again.
I ended up setting "Launch applications and unsafe files" to enabled for Internet zone in Internet Explorer options under security(custom level) and then exporting the changes from HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3 to a registry file and adding it with regedit /s.
After that I can run the installer of the shared drive.
One of these days I'll pare the registry file down to the minimum I guess.
P.S. I believe this causes IE to default to a warning page on startup.
I believe you need to put everything within the same quotation:
cmd /c "set SEE_MASK_NOZONECHECKS=1 & \\server\driver\folder\Autorun.exe /passive /norestart"
You can try these and see the difference in the output:
cmd /c "echo foo & echo bar"
cmd /c "echo foo" & "echo bar"

Set environment variables on Mac OS X Lion

When someone says "edit your .plist file" or "your .profile" or ".bash_profile" etc, this just confuses me. I have no idea where these files are, how to create them if I have to do that, etc, and also why there seem to be so many different ones (why? Do they do different things?)
So could someone please explain very patiently to a previous Windows user (wanting desperately to become more familiar with the pleasant if initially somewhat confusing OS X world) how to do this step by step?
I need the variables to be set both for GUI applications and command line applications, and at the moment it's for an ant script that needs the variables, but there will most likely be other needs as well.
Please note that I have Lion too, since many of the answers you get Googling seem to be outdated for Lion...
Also note that I have practically zero experience using the Terminal. I'm willing to learn, but please explain for a novice...
First, one thing to recognize about OS X is that it is built on Unix. This is where the .bash_profile comes in. When you start the Terminal app in OS X you get a bash shell by default. The bash shell comes from Unix and when it loads it runs the .bash_profile script. You can modify this script for your user to change your settings. This file is located at:
~/.bash_profile
Update for Mavericks
OS X Mavericks does not use the environment.plist - at least not for OS X windows applications. You can use the launchd configuration for windowed applications. The .bash_profile is still supported since that is part of the bash shell used in Terminal.
Lion and Mountain Lion Only
OS X windowed applications receive environment variables from the your environment.plist file. This is likely what you mean by the ".plist" file. This file is located at:
~/.MacOSX/environment.plist
If you make a change to your environment.plist file then OS X windows applications, including the Terminal app, will have those environment variables set. Any environment variable you set in your .bash_profile will only affect your bash shells.
Generally I only set variables in my .bash_profile file and don't change the .plist file (or launchd file on Mavericks). Most OS X windowed applications don't need any custom environment. Only when an application actually needs a specific environment variable do I change the environment.plist (or launchd file on Mavericks).
It sounds like what you want is to change the environment.plist file, rather than the .bash_profile.
One last thing, if you look for those files, I think you will not find them. If I recall correctly, they were not on my initial install of Lion.
Edit: Here are some instructions for creating a plist file.
Open Xcode
Select File -> New -> New File...
Under Mac OS X select Resources
Choose a plist file
Follow the rest of the prompts
To edit the file, you can Control-click to get a menu and select Add Row. You then can add a key value pair. For environment variables, the key is the environment variable name and the value is the actual value for that environment variable.
Once the plist file is created you can open it with Xcode to modify it anytime you wish.
Your .profile or .bash_profile are simply files that are present in your "home" folder. If you open a Finder window and click your account name in the Favorites pane, you won't see them. If you open a Terminal window and type ls to list files you still won't see them. However, you can find them by using ls -a in the terminal. Or if you open your favorite text editor (say TextEdit since it comes with OS X) and do File->Open and then press Command+Shift+. and click on your account name (home folder) you will see them as well. If you do not see them, then you can create one in your favorite text editor.
Now, adding environment variables is relatively straightforward and remarkably similar to windows conceptually. In your .profile just add, one per line, the variable name and its value as follows:
export JAVA_HOME=/Library/Java/Home
export JRE_HOME=/Library/Java/Home
etc.
If you are modifying your "PATH" variable, be sure to include the system's default PATH that was already set for you:
export PATH=$PATH:/path/to/my/stuff
Now here is the quirky part, you can either open a new Terminal window to have the new variables take effect, or you will need to type .profile or .bash_profile to reload the file and have the contents be applied to your current Terminal's environment.
You can check that your changes took effect using the "set" command in your Terminal. Just type set (or set | more if you prefer a paginated list) and be sure what you added to the file is there.
As for adding environment variables to GUI apps, that is normally not necessary and I'd like to hear more about what you are specifically trying to do to better give you an answer for it.
Here's a bit more information specifically regarding the PATH variable in Lion OS 10.7.x:
If you need to set the PATH globally, the PATH is built by the system in the following order:
Parsing the contents of the file /private/etc/paths, one path per line
Parsing the contents of the folder /private/etc/paths.d. Each file in that folder can contain multiple paths, one path per line. Load order is determined by the file name first, and then the order of the lines in the file.
A setenv PATH statement in /private/etc/launchd.conf, which will append that path to the path already built in #1 and #2 (you must not use $PATH to reference the PATH variable that has been built so far). But, setting the PATH here is completely unnecessary given the other two options, although this is the place where other global environment variables can be set for all users.
These paths and variables are inherited by all users and applications, so they are truly global -- logging out and in will not reset these paths -- they're built for the system and are created before any user is given the opportunity to login, so changes to these require a system restart to take effect.
BTW, a clean install of OS 10.7.x Lion doesn't have an environment.plist that I can find, so it may work but may also be deprecated.
echo $PATH
it prints current path value
Then do vim ~/.bash_profile and write
export PATH=$PATH:/new/path/to/be/added
here you are appending to the old path, so preserves the old path and adds your new path to it
then do
source ~/.bash_profile
this will execute it and add the path
then again check with
echo $PATH
Unfortunately none of these answers solved the specific problem I had.
Here's a simple solution without having to mess with bash. In my case, it was getting gradle to work (for Android Studio).
Btw, These steps relate to OSX (Mountain Lion 10.8.5)
Open up Terminal.
Run the following command:
sudo nano /etc/paths (or sudo vim /etc/paths for vim)
Go to the bottom of the file, and enter the path you wish to add.
Hit control-x to quit.
Enter 'Y' to save the modified buffer.
Open a new terminal window then type:
echo $PATH
You should see the new path appended to the end of the PATH
I got these details from this post:
http://architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/#.UkED3rxPp3Q
I hope that can help someone else
Simplified Explanation
This post/question is kind of old, so I will answer a simplified version for OS X Lion users.
By default, OSX Lion does not have any of the following files:
~/.bashrc
~/.bash_profile
~/.profile
At most, if you've done anything in the terminal you might see ~/.bash_history
What It Means
You must create the file to set your default bash commands (commonly in ~/.bashrc). To do this, use any sort of editor, though it's more simple to do it within the terminal:
%> emacs .profile
[from w/in emacs type:] source ~/.bashrc
[from w/in emacs type:] Ctrl + x Ctrl + s (to save the file)
[from w/in emacs type:] Ctrl + x Ctrl + c (to close emacs)
%> emacs .bashrc
[from w/in emacs type/paste all your bash commands, save, and exit]
The next time you quit and reload the terminal, it should load all your bash preferences. For good measure, it's usually a good idea to separate your commands into useful file names. For instance, from within ~/.bashrc, you should have a source ~/.bash_aliases and put all your alias commands in ~/.bash_aliases.
What worked for me is to create a .launchd.conf with the variables I needed:
setenv FOO barbaz
This file is read by launchd at login. You can add a variable 'on the fly' to the running launchd using:
launchctl setenv FOO barbaz`
In fact, .launchd.cond simply contains launchctl commands.
Variables set this way seem to be present in GUI applications properly.
If you happen to be trying to set your LANG or LC_ variables in this way, and you happen to be using iTerm2, make sure you disable the 'Set locale variables automatically' setting under the Terminal tab of the Profile you're using. That seems to override launchd's environment variables, and in my case was setting a broken LC_CTYPE causing issues on remote servers (which got passed the variable).
(The environment.plist still seems to work on my Lion though. You can use the RCenvironment preference pane to maintain the file instead of manually editing it or required Xcode. Still seems to work on Lion, though it's last update is from the Snow Leopard era. Makes it my personally preferred method.)
Setup your PATH environment variable on Mac OS
Open the Terminal program (this is in your Applications/Utilites folder by default).
Run the following command
touch ~/.bash_profile; open ~/.bash_profile
This will open the file in the your default text editor.
For ANDROID SDK as example :
You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use "/Development/android-sdk-macosx" as the directory the SDK is installed in. Add the following line:
export PATH=${PATH}:/Development/android-sdk-macosx/platform-tools:/Development/android-sdk-macosx/tools
Save the file and quit the text editor.
Execute your .bash_profile to update your PATH.
source ~/.bash_profile
Now everytime you open the Terminal program you PATH will included the Android SDK.
Adding Path Variables to OS X Lion
This was pretty straight forward and worked for me, in terminal:
$echo "export PATH=$PATH:/path/to/whatever" >> .bash_profile #replace "/path/to/whatever" with the location of what you want to add to your bash profile, i.e: $ echo "export PATH=$PATH:/usr/local/Cellar/nginx/1.0.12/sbin" >> .bash_profile
$. .bash_profile #restart your bash shell
A similar response was here: http://www.mac-forums.com/forums/os-x-operating-system/255324-problems-setting-path-variable-lion.html#post1317516
Open Terminal:
vi ~/.bash_profile
Apply changing to system (no need restart computer):
source ~/.bash_profile
(Also work with macOS Sierra 10.12.1)
I had problem with Eclipse (started as GUI, not from script) on Maverics that it did not take custom PATH. I tried all the methods mentioned above to no avail. Finally I found the simplest working answer based on hints from here:
Go to /Applications/eclipse/Eclipse.app/Contents folder
Edit Info.plist file with text editor (or XCode), add LSEnvironment dictionary for environment variable with full path. Note that it includes also /usr/bin etc:
<dict>
<key>LSEnvironment</key>
<dict>
<key>PATH</key>
<string>/usr/bin:/bin:/usr/sbin:/sbin:/dev/android-ndk-r9b</string>
</dict>
<key>CFBundleDisplayName</key>
<string>Eclipse</string>
...
Reload parameters for app with
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.fra‌​mework/Support/lsregister -v -f /Applications/eclipse/Eclipse.app
Restart Eclipse
Let me illustrate you from my personal example in a very redundant way.
First after installing JDK, make sure it's installed.
Sometimes macOS or Linux automatically sets up environment variable for you unlike Windows. But that's not the case always. So let's check it.
The line immediately after echo $JAVA_HOME would be empty if the environment variable is not set. It must be empty in your case.
Now we need to check if we have bash_profile file.
You saw that in my case we already have bash_profile. If not we have to create a bash_profile file.
Create a bash_profile file.
Check again to make sure bash_profile file is there.
Now let's open bash_profile file. macOS opens it using it's default TextEdit program.
This is the file where environment variables are kept. If you have opened a new bash_profile file, it must be empty. In my case, it was already set for python programming language and Anaconda distribution. Now, i need to add environment variable for Java which is just adding the first line. YOU MUST TYPE the first line VERBATIM. JUST the first line. Save and close the TextEdit. Then close the terminal.
Open the terminal again. Let's check if the environment variable is set up.
I took the idiot route.
Added these to the end of /etc/profile
for environment in `find /etc/environments.d -type f`
do
. $environment
done
created a folder /etc/environments
create a file in it called "oracle" or "whatever" and added the stuff I needed set globally to it.
/etc$ cat /etc/environments.d/Oracle
export PATH=$PATH:/Library/Oracle/instantclient_11_2
export DYLD_LIBRARY_PATH=/Library/Oracle/instantclient_11_2
export SQLPATH=/Library/Oracle/instantclient_11_2
export PATH=$PATH:/Library/Oracle/instantclient_11_2
export TNS_ADMIN=/Library/Oracle/instantclient_11_2/network/admin
It is recommended to check default terminal shell before setting any environment variables, via following commands:
$ echo $SHELL
/bin/zsh
If your default terminal is /bin/zsh (Z Shell) like in my case (Personally prefer Z Shell), then you should set these environment variable in ~/.zshenv file with following contents (In this example, setting JAVA_HOME environment variable, but same applies to others):
export JAVA_HOME="$(/usr/libexec/java_home)"
Similarly, any other terminal type not mentioned above, you should set environment variable in its respective terminal env file.
More detail, which may perhaps be helpful to someone:
Due to my own explorations, I now know how to set environment variables in 7 of 8 different ways. I was trying to get an envar through to an application I'm developing under Xcode. I set "tracer" envars using these different methods to tell me which ones get it into the scope of my application. From the below, you can see that editing the "scheme" in Xcode to add arguments works, as does "putenv". What didn't set it in that scope: ~/.MACOS/environment.plist, app-specific plist, .profile, and adding a build phase to run a custom script (I found another way in Xcode [at least] to set one but forgot what I called the tracer and can't find it now; maybe it's on another machine....)
GPU_DUMP_DEVICE_KERNEL is 3
GPU_DUMP_TRK_ENVPLIST is (null)
GPU_DUMP_TRK_APPPLIST is (null)
GPU_DUMP_TRK_DOTPROFILE is (null)
GPU_DUMP_TRK_RUNSCRIPT is (null)
GPU_DUMP_TRK_SCHARGS is 1
GPU_DUMP_TRK_PUTENV is 1
... on the other hand, if I go into Terminal and say "set", it seems the only one it gets is the one from .profile (I would have thought it would pick up environment.plist also, and I'm sure once I did see a second tracer envar in Terminal, so something's probably gone wonky since then. Long day....)
Step1: open ~/.bash_profile
Now a text editor opens:
Step2: variable name should be in capitals. in this example variable is NODE_ENV
Step3: export NODE_ENV=development
Save it and close.
Restart your system.
Done.
To check env variable: open terminal and type
echo $NODE_ENV

Delete gnome terminal configuration

I made a mistake in my gnome terminal configuration. I entered a command to start with in the preferences, but that command fails, and now all I get is a window that opens and closes right away, and I basically can't use gnome terminal anymore :-( Is there any way I can remove the configuration file and restart fresh??
Thanks!
Open the XTerm (Standard terminal for linux) and enter this command
gnome-terminal -e bash
It opens the gnome-terminal. Open profile preferences and configure your terminal to "Hold the terminal open".
Editing preferences
$HOME/.gconfd/saved_state
the above file might be of interest depending on exactly what configuration you changed. Of course, it holds configuration from other programs as well.
If you are on the newer gnome terminal that uses dconf, it's a little trickier, but still doable:
Profiles are stored with a UUID, you need to find the UUID of the profile to remove:
dconf dump /org/gnome/terminal/ | less
Search for a visible-name='...' entry matching the profile you want to remove. Look above that for the section header like [legacy/profiles:/:...]. The full name of the item you want to delete is thus /org/gnome/terminal/legacy/profiles:/:.... Delete it thus:
dconf reset -f /org/gnome/terminal/legacy/profiles:/:...
Side note: This Q&A probably should be moved to unix.stackexchange.com.

Resources