Codeception db credentials on bootstrap file - codeception

i need a dynamic option here. But everytime need to enable the db module with credentials in the yml file. How can i use there constants or move it to the _bootstrap.php?
See you and thx

So the solution was to use a sqlite db in the yml file and use a helper to reconfigure the db setting

Related

Apache log4J properties from another property file

I want to set the DB user name/password in Apache log4J properties file reading from another property file.
Can anyone help me on this.
Two different approaches comes to my mind about potential solution for your problem:
1) Use Programmatic configuration for Log4J.
In this case, you would read DB properties from your configuration file at the application startup and then build your Log4J with these values using programmatic configuration instead of configuration file.
2) Write your own custom appender by extending JDBCAppender. You can implement your own method to read data from the provided property file which will initialize other parameters, e.g. url, databasename, password, username...
Hope this helps.

how to change OpenLDAP configuration ( slapd.conf ) programmatically

I need to make some configuration changes to slapd.conf. Changes are related to enabling SSL, enabling synch-replication etc.
For example, i need to add following block of configuration in slapd.conf to enable synch-replication over SSL :
TLSCACertificateFile /etc/openldap/cacerts/cacert.pem
TLSCertificateFile /etc/openldap/certs/servercrt.pem
TLSCertificateKeyFile /etc/openldap/certs/serverkey.pem
TLSVerifyClient never
Right now, I am trying to do this with shell script. Script will edit text in slapd.conf using sed, awk commands and some logic to place the text correctly in slapd.conf.
I don't think this is the best way to make configuration changes in slapd.conf.
Is there an API/commands for shell to do the same.
Please also suggest any java api for the same ?
I am using OpenLDAP.
Thanks in Advance.
If you used online configuration with the -F slapd.d option you could do it via an LDAP API.

SQL database deployment for VB.NET app

I have read many articles here, but haven't quite found the solution. I have a SQL Server Express database that is used by my VB.NET application. I have packaged and deployed the application via an MSI file and everything works great except I cannot figure out how to include my database file with the package. I understand there are three general ways to do this (copy the files over manually, custom actions, and SQL scripts). I didn't need anything fancy here, just a quick way to put the DB on the client machine so my app can access it.
I decided copying over the DB manually was the quickest option. I tried putting it in the working directory and in the \DATA directory of the client's SQL Server Express install, but my app wouldn't connect. I also tried changing my connection in the project to .\SQLEXPRESS instead of [my_computer_name]\SQLEXPRESS followed by a rebuild of the deployment project and reinstall on the client machine, but no soup for me. Same issue. I tried changing the "UserInstance" property in the project to "True" but my project would not let me save that action.
Am I correct that a manual copy is the quickest and easiest way to get this done?
You should to attach your file to the Sql Server instance.
CREATE DATABASE YourDatabaseName
ON (FILENAME = 'C:\your\data\directory\your_file.mdf'),
(FILENAME = 'C:\your\data\directory\your_file_Log.ldf')
FOR ATTACH;
You need to attach your database file to the running SQL Server on the client machine.
This could be easily done using this variation on the connection string stored in your configuration file (app.config or web.config)
Server=.\SQLExpress;AttachDbFilename=where_you_have_stored_the_mdf_file;
Database=dbname; Trusted_Connection=Yes;
in alternative, you could use the |DataDirectory| substitution string.
This shortcut eliminates the need to hard-code the full path.
Using DataDirectory, you can have the following connection string:
Server=.\SQLExpress;AttachDbFilename=|DataDirectory|\yourfile.mdf”
Database=dbname; Trusted_Connection=Yes;

How get running squid3 with a local datase user?

I want get running squid3 and obligate users to authenticate again a local and simple database users-pass file. Can be user-pass file of the system or a simple .txt file, whatever is more easy.
Here is a more comprehensive guide to setting up a Squid 3 server with htdigest authentication: http://dabase.com/blog/Minimal_squid3_proxy_configuration/
Using
/usr/lib/squid3/digest_pw_auth
helper that come with squid installation works.
/usr/bin/htdigest
can be used to create the user-pass file.

Symfony 1.4 : How to generate .SQL from fixture files

I have my symfony project on my dev box machine and also on a hosted environment where i have only FTP and HTTP access (i have a phpmyadmin access to my prod DB). This hosted version is an alpha release that should be initialized with fixtures.
Problem is : to do that, i have to write/update .yml fixtures in local, insert them in local DB with the symfony task, go on my local PMA, generate a data export, go on prod PMA and import the data...
Is there any way to generate a .sql file from my local fixtures so that i can insert them directly through my prod PMA ?
Thanks
The easiest is probably for you to look at this website:
http://brentertainment.com/2010/02/15/run-a-symfony-task-from-your-model-or-action/
You may run tasks from the web, you might make it a bit smarter and allow to run tasks from the web. Also clearing the cache might be a useful thing to extend to your admin interface for example.
I think you can't "out of the box" in symfony.
BUT you may be able to use the Doctrine Profiler to log all the SQL requests done by the sfDoctrineDataLoadTask task class into a file.
Are you using the symfony doctrine:build --all command? When I do that, a schema.sql file is created within the data/sql directory.