Binding to network interface/IP address on client machine - syslog-ng

I i'm trying to figure out how to force syslog-ng on clients to bind to a specified IP address. I have multiple interfaces, and need syslog-ng to send the logs through a specific one.

You can use the ip() option of network sources, or interface().
For example:
source { network(interface("wlp3s0")); };
source { network(ip("192.168.1.1")); };

Related

Is there a way to set JMS to use SSL/TLS connecting to IBM MQ?

We have a Java application that uses JMS to communicate with IBM MQ. A part of their requirement is now to use TLS. Is there a way to do this? The parameters they were expecting to add are:
sslCipherSuite
hostname
port
channel
Is there any system environment property that we can set to JMS for this parameters?
the current code uses
import javax.jms.ConnectionFactory;
and we use to a config file to set system env variables.
environment.setProperty("java.naming.factory.initial", this.config.get("JMS_JndiContextFactory"));
this.setJndiExtraParameters(environment, this.config.get("JMS_JndiExtraParameters"));
while (!this.state.atLeast(State.GOT_FACTORY) && iterator.hasNext()) {
environment.setProperty("java.naming.provider.url", this.urlUsed = iterator.next());
try {
JmsClient.LOGGER.debug("Looking up connection factory");
this.factory = (ConnectionFactory)new InitialContext(environment).lookup(this.config.get("JMS_FactoryName"));
this.state = State.GOT_FACTORY;
}
im thinking if there is a way to set only another set of system properties instead of using
MQConnectionFactory
so we don't have to change something in the code?
i posted a similar question , reposted it because of lack of clarity

Karate-gatling: set local addresses

I have simple karate feature file for testing an API, and I want to use this feature file for load testing. Thus I am using Gatling to execute the karate feature file: https://github.com/intuit/karate/tree/master/karate-gatling
However, when I fire up multiple users, I want to submit the requests with different ip alias that I have configured.
Using Gatling, I could use localAddress to bind to the socket
val protocol = http.localAddresses(ip)
But in Karate-Gatling, karateProtocol is used instead
val protocol = karateProtocol()
And the readme states that "Karate is responsible for making HTTP requests while Gatling is only measuring the timings and managing threads".
This means that the HTTP requests and localAddress bindings cannot be changed through Gatling, but I am wondering if there is a workaround through Karate so that different ip alias can be used for different requests.
This sounds like a feature request is needed to tell the HTTP client (Apache for e.g.) to use a local-address.
It would be great if you can help contribute and test, one way to set the localAddress would be in the code here:
RequestConfig.Builder configBuilder = RequestConfig.custom()
.setCookieSpec(LenientCookieSpec.KARATE)
.setConnectTimeout(config.getConnectTimeout())
.setSocketTimeout(config.getReadTimeout());
String localIp = "1.2.3.4";
try {
InetAddress localAddress = InetAddress.getByName(localIp);
configBuilder.setLocalAddress(localAddress);
} catch (Exception e) {
context.logger.error("failed to resolve local address: {}", localIp);
}

SUMO Address Error

I'm running multiple SUMO simulations in parallel using TraCI.
Every so often one will fail with the message
Error: tcpip::Socket::accept() Unable to create listening socket: Address already in use
Quitting (on error).
I haven't found anyway to set the address to use on the configuration list at http://sumo.dlr.de/wiki/SUMO
I figure if I can set each instances address manually I should be able to avoid this.
The answer is right on the page you mention. The option --remote-port specifies the port number, so something like
sumo --remote-port 54323 -c my.sumocfg
should do the trick. Of course you need to give the same port when connecting from your traci client.

How to retrieve and connect via public IP Addresses with wxWidgets

I'm trying to build a very simple chat application with wxWidgets. At the moment, I can open the software on my local machine and on a virtual machine with it's own LAN IP Address. I'm able to retrieve each machines local IP Address via wxGetFullHostName() function; which I then manually enter this value into the other instance so that they connect. Everything works well at this stage.
However, now I'd like to send the .exe to a friend somewhere else. How can I get the application to expose the machines public IP address so that I can provide it to my friend to connect to my instance? Are their any other requirements to have the two instances connect to each other?
I'm using C++, but I don't think it matters much to this question.
For a platform independent method that works behind NAT, I would suggest to use ipify (https://www.ipify.org/).
There are many ways of achieving this in C++ and wxWidgets. Possibly one of the best is to use curl (https://curl.haxx.se/libcurl/).
However, for a 'pure' wxWidgets implementation you can try the following modification to the minimal.cpp sample:
#include <wx/sstream.h>
#include <wx/protocol/http.h>
#include <wx/msgdlg.h>
MyFrame::MyFrame(const wxString& title)
: wxFrame(NULL, wxID_ANY, title)
{
wxHTTP http;
http.SetHeader("Content-type", "text/html; charset=utf-8");
http.SetTimeout(10);
http.Connect("api.ipify.org");
wxInputStream* httpStream = http.GetInputStream("/");
if (http.GetError() == wxPROTO_NOERR)
{
wxString result;
wxStringOutputStream out_stream(&result);
httpStream->Read(out_stream);
wxMessageBox(result);
}
else
{
wxMessageBox("Unable to connect!");
}
wxDELETE(httpStream);
}

OpenGTS platform

I have been currently working with OpenGTS platform, I would like to help me with something.
I want to connect a GPS to the platform is the "GPS TRACKER 103ab" this GPS works under the protocol "TK-103". To see if they could help me connect this device to the platform. I followed the documentation to activate the devicenter code heree through SMS to my cell with commands like:
Begin123456 = to start the device.
IMEI123456 = so that the device will return the 15 digits.
adminip123456 109.0.0.9 = 8080 to set the ip + port that I am using.
The problem is that still can not get connect with the platform, help me.
Facts:
Opengts
GPS TRACKER 103ab
Protocol "TK-103"
You can use Traccar GPS server to receive data from your device and integrate it with OpenGTS if you want to access the data from OpenGTS web interface. Traccar supports more communication protocols than OpenGTS.
The correct command to set ADMINIP is :
adminip123456 [xxx.xxx.xxx.xxx] [xxxx]
where the first field is the IP address of your server, must be an address public and accessible from the outside.
and the second field (note that they are only separated by a space) is the port where the server expects the connection , the default is 31272 for tk10x protocol. NEVER 8080 , this is the port where Tomcat listens.
After setting the ' adminp ' , use the command:
fix001m***123456
to start position reports every minute.
it is also necessary to set the APN,APNuser,APNpassword from the mobile service provider's of the device.
use the commands:
apn123456 datos.personal.com
apnuser123456 gprs
apnpasswd123456 gprs
(This is an example using the appropriate data to the service provider's Personal.ar)