zc.buildout: Script Recipe With Access to Buildout Configuration - buildout

I want to write a script in a zc.buildout recipe, but the script needs to have access to buildout.cfg.
I know how to create a buildout recipe (which has access to its configuration) and how to create a buildout script, but I don't know how the script could read the config.
Is there a way that the script receive the configuration from buildout.cfg?
Or should it open the file by itself and parse the config?
In the last case, what is the best way to get the path? what's the best way to parse it?
Thanks in advance.

Related

snakemake config PATH ENVIRONMENT

I try to write a workflow using snakemake, but do not know how to configure PATH environment for all rules in the configure file, and did not find relational questions. Anyone can give a help?
Have a look at this FAQ entry. However, please also consider to simply use Conda integration instead of manupulating PATH yourself.

How to get the working directory path?

I'm wondering how to manage paths in my Snakefiles. Say I have this configuration:
current_dir
current_dir/snakefiles
current_dir/configfiles
and I execute my workflows this way:
current_dir$ snakemake -s snakefiles/my_snakefile --configfile configfiles/my_config.yml
I know I can get the path to my Snakefile using the global variable workflow.snakefile, but I would like to get also:
the path to my configfile
the path where I'm executing my snakefile, e.g. current_dir
How to achieve this? Are there other global variables in Snakemake, that I'm not aware of?
Thank you
The working directory is set via Python. You can get it with os.getcwd(). Also please note that there is a canonical way to organize Snakemake workflows: http://snakemake.readthedocs.io/en/latest/project_info/faq.html#what-is-the-recommended-way-to-distribute-a-snakemake-workflow.
While you can of course use something else, following this scheme helps others to understand your workflow. There might of course be cases where this does not fit.

Jailshell on cpanel - Allow access to additional folders

I've not been able to find a solution to this problem.
I'd like clients I give jail-shell access to (rather than normal shell access) the ability to run commands I allow access too, such as Git.
Git requires you include the folder /usr/local/libexec/git-core but I can't work out a way of including the folder for jail-shell access ?
Perhaps it's not even possible, but I'm keen to find out.
You can mount additional directories in /var/cpanel/jailshell-additional-mounts
If the file doesn't exist create it and put the directories which you want to allow into it, one directory name per line:
/usr/local/libexec/git-core
/usr/local/lib
...

Nuget: Is there a transformation token available to get the location of the package tools folder?

I am trying to use Nuget to distribute a ms build .targets file. I need to modify some elements of the file to include the installed path of a few assemblies. For that I would like to use the tools folder. I am having a hard time finding the token (if it exists) to do the replacement. Has anyone encountered this problem or know of a workaround?
http://docs.nuget.org/docs/creating-packages/configuration-file-and-source-code-transformations
You'll have to go the PowerShell route to get this done, as no transform exists AFAIK. The init.ps1 file can process some parameters provided by the NuGet VSIX.
Simply add the following to the top of the init.ps1 file and use the $installPath variable in your scripts that modify the file content.
param($installPath, $toolsPath, $package, $project)
Check here for an example usage.

Changing multiple SSIS Packages in an Automated way

Background:
I have about 170 SSIS packages. A new requirement is that users from other workstations can run them from their command lines using dtexec.
Question:
To make this possible I'd like to set change the protection level to encrypt sensitive with password, and change the password in each package.
Is there a way to automate this?
It's not something I've tried personally, but you could potentially amend or add the property in the XML source of the packages using a global search and replace.
A much easier method is to use the built in package configuration functionality. Configure your package to look to load its configuration from a config file. Distribute the config file with the package(s). You'll have to decide on what technique to use for the package to find it's config file (this technique will be used on all dev workstations). I've typically used registry entry. You can also use system variables. From an execution stand point, you can pass in the name and location of the config file to dtexec.