how to change OpenLDAP configuration ( slapd.conf ) programmatically - api

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.

Related

RSA encryption in JMeter

I have the issue explained here:
javax.net.ssl.SSLException in jMeter
The server tham I am testing is using RSA keys, so I should try third option from answer given in above question. But I don't know how to do this "change your client to only negotiate that." I am not writing my own code, and have no idea how to force Java or JMeter to handle this. I wanted to add a comment on question but, I still have no rights to post a comment, so I am posting another question.
Why don't you like first option from the linked answer?
Upgrade your Java to version 8 (you can get Java 8 Server JRE from the Oracle website)
Add the following line to system.properties file (located in "bin" folder of your JMeter installation):
jdk.tls.ephemeralDHKeySize=2048
Referenced https.cipherSuites property can be set in the system.properties file as well, just in case you will go for lowering the security way.
Another option is passing the property via -D command line argument like:
jmeter -Djdk.tls.ephemeralDHKeySize=2048 -n -t yourtestplan.jmx -l results.jtl
See Apache JMeter Properties Customization Guide for more information on JMeter properties and ways of working with them.
Here is the link to very easy and complete solution.
http://docs.oracle.com/cd/E19830-01/819-4712/ablsc/index.html

Change Intellij HTTP proxy from command line

According to our company policy we need to change password regularly, which means I have to update the proxy authentication password.
I have a script that solves all of this, except for the Intellij proxy setting.
Therefor, my question is: Is it possible to change Intellij IDEA's HTTP proxy setting from the command line?
The setting I'm refering to is Appearance & Behavior > System Settings > HTTP Proxy in Intellij.
I'm using IntelliJ IDEA 2016.2.4
No there is not. The password value is stored in the file .IntelliJIdea/config/options/proxy.settings.pwd but it is encrypted. Otherwise your script could modify it. You might be able to dig through the source code and see how the encryption works to see if you can replicate it in your script.

Lynx file "/etc/lynx.lss" is not available

using cpanel server, setting a simple "lynx http://www.domain.com/script.php" command gives following error and I am unable to understand it.
Lynx file "/etc/lynx.lss" is not available.
the problem is the SHELL.
You can solve this problem via two ways:
1] I simply changed the sentence:
SHELL="/usr/local/cpanel/bin/jailshell"
in /var/spool/cron/account
to SHELL="/bin/bash"
2] You can copy file /etc/lynx.lss
to directory: /home/virtfs/account/etc
Both worked for me !
Wilhelm
You can create an empty (or not) style sheet file in a directory where you have write access, then explicitly point to that file on the lynx command-line:
lynx -lss=/path/to/my/lynx.lss ...
I enabled shell access for the account and it started working. The above answer seems to assume you have access to the entire server and can modify those files, if so then just enable shell access and you are set, but if you are on a shared hosting account basic cpanel and ftp access you may not be able to do it. Ask you hosting company if you can have shell access. Then decide what you can do depending on the answer they give you.
you can solve this issue by follow below process :-
Open this file
root#server [~]# vi /var/cpanel/exim.conf.deps
and append below entries and save it.
/etc/lynx.lss

How to use "htaccess" on synology system for website access control?

I am trying to set up the access control for my personal website on synology NAS. Right now I am using DS212J. I found the following article teaching how to use "htaccess" on apache to achieve that.
http://www.synology.com/support/faq_show.php?lang=enu&q_id=347
But I encountered 2 problem:
1) I don't have the command "htpasswd" after ssh to my DS212J.
2) After I manually create those files, I got the username and password prompting up on the website. However, the password in "admin.pw" and "normal.pw" doesn't work when I type in. I am not sure whether it is because I didn't use command "htpasswd".
What am I missing here?
Thanks.
The htpasswd executable is at /usr/syno/apache/bin/htpasswd. As that directory is not on the PATH, you have to explicitly use the whole path to use it:
Apache doesn't keep passwords in plain text, it uses a hash of them so that even if someone gets access to the password file they won't be able to log in. That's why you must use htpasswd to create the file.
For anyone who comes across this, I couldn't get that synology support tutorial to work either. I am running DSM 5.1-5022 Update 4 on my own domain with ssl. Here's how it got it working:
Follow the steps in the following wiki: Synology Wiki
In the control panel, go to "Web Services" and disable SPDY for secure connections. (Gleaned from this article.)
Good luck.

How do I use Bazaar with a HTTP proxy?

How do I use Bazaar with a HTTP proxy? I can't find anything in their documentation.
Set the http_proxy environment variable to point to your proxy, eg. (on Windows):
set http_proxy=http://webcache.mycompany.com:3128/
See the "Environment variables" section of http://bazaar-vcs.org/ConfiguringBzr
Also do not forget to set HTTPS_PROXY environment variable.
set https_proxy=http://my.proxy.com:3128/
I post this answer as a reference for those who may later visit this page.
If you still have trouble with proxy connection after trying all the other methods, try setting your proxy settings using dconf and gconf editors.
Note:
The settings that the latest programs are expected to use are the DConf settings but some old programs might still use GConf settings, so it is wise to set your proxy settings in both.
If not already installed, you can easily install dconf and gconf editors from synaptic or the package manager of your distribution.
Proxy Settings:
In your Conf dconf editor traverse to
system > proxy
There you should see the options for setting your ftp, http, https, socks proxy settings.
Note:
In case your proxy needs authentication, and your password contains special characters like# you would know by now (after painstaking searches), that you should replace your # with %40 (the HTML character encoding for #) while configuring your proxy settings, eg. in ~/.bashrc.
Do not follow this practice in the configuration editor. Type your password as it is.
Now, in case of gconf editor, the path to the proxy settings is same, but the options might be a bit different. But, I am sure you can make it out.