Kubernetes equivalent of env-file in Docker

You can populate a container’s environment variables through the use of Secrets or ConfigMaps. Use Secrets when the data you are working with is sensitive (e.g. passwords), and ConfigMaps when it is not. In your Pod definition specify that the container should pull values from a Secret: apiVersion: v1 kind: Pod metadata: labels: context: docker-k8s-lab … Read more

Parse config files, environment, and command-line arguments, to get a single collection of options

UPDATE: I finally got around to putting this on pypi. Install latest version via: pip install configargparser Full help and instructions are here. Original post Here’s a little something that I hacked together. Feel free suggest improvements/bug-reports in the comments: import argparse import ConfigParser import os def _identity(x): return x _SENTINEL = object() class AddConfigFile(argparse.Action): … Read more

How do I find out which settings.xml file maven is using

Use the Maven debug option, ie mvn -X : Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100) Maven home: /usr/java/apache-maven-3.0.3 Java version: 1.6.0_12, vendor: Sun Microsystems Inc. Java home: /usr/java/jdk1.6.0_12/jre Default locale: en_US, platform encoding: UTF-8 OS name: “linux”, version: “2.6.32-32-generic”, arch: “i386”, family: “unix” [INFO] Error stacktraces are turned on. [DEBUG] Reading global settings from /usr/java/apache-maven-3.0.3/conf/settings.xml … Read more

What’s in an Eclipse .classpath/.project file?

Eclipse is a runtime environment for plugins. Virtually everything you see in Eclipse is the result of plugins installed on Eclipse, rather than Eclipse itself. The .project file is maintained by the core Eclipse platform, and its goal is to describe the project from a generic, plugin-independent Eclipse view. What’s the project’s name? what other … Read more

How to locate the vimrc file used by Vim?

Just try doing the following: :version You will get an output which includes something like: system vimrc file: “$VIM/vimrc” user vimrc file: “$HOME/.vimrc” user exrc file: “$HOME/.exrc” system gvimrc file: “$VIM/gvimrc” user gvimrc file: “$HOME/.gvimrc” system menu file: “$VIMRUNTIME/menu.vim” As noted by Herbert in comments, this is where vim looks for vimrcs, it doesn’t mean … Read more

How to implement a ConfigurationSection with a ConfigurationElementCollection

The previous answer is correct but I’ll give you all the code as well. Your app.config should look like this: <?xml version=”1.0″ encoding=”utf-8″ ?> <configuration> <configSections> <section name=”ServicesSection” type=”RT.Core.Config.ServiceConfigurationSection, RT.Core”/> </configSections> <ServicesSection> <Services> <add Port=”6996″ ReportType=”File” /> <add Port=”7001″ ReportType=”Other” /> </Services> </ServicesSection> </configuration> Your ServiceConfig and ServiceCollection classes remain unchanged. You need a new … Read more

How can I reference a file for variables using Bash?

The short answer Use the source command. An example using source For example: config.sh #!/usr/bin/env bash production=”liveschool_joe” playschool=”playschool_joe” echo $playschool script.sh #!/usr/bin/env bash source config.sh echo $production Note that the output from sh ./script.sh in this example is: ~$ sh ./script.sh playschool_joe liveschool_joe This is because the source command actually runs the program. Everything in … Read more

How to handle configuration in Go [closed]

The JSON format worked for me quite well. The standard library offers methods to write the data structure indented, so it is quite readable. See also this golang-nuts thread. The benefits of JSON are that it is fairly simple to parse and human readable/editable while offering semantics for lists and mappings (which can become quite … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)