Non local IP-ADDRESS in izpack - izpack

I'm trying get the IP address in my izpack installer. I have used the ${IP_ADDRESS} variable, but I get the local "127.0.0.1" address instead of the public IP of the computer. Is it the expected functioning? It seems quite useless to me, but I must have missed something. How can I get the public IP?
izpack: v5.0.3
java: 1.7.0_79
Ubuntu: 15.04
Thanks.

It looks like, ${IP_ADDRESS} is taken as (part from IzPack installer sources):
InetAddress localHost = InetAddress.getLocalHost();
IPAddress = localHost.getHostAddress();
hostname = localHost.getHostName();
So, the problem is, that InetAddress.getLocalHost() in most cases returns localhost addresses.
If you need to determine your public ip, it's not as easy, as just to take your localhost's address. You have to iterate over your network interfaces, getting their addresses and determine, which one you need. It's quite a common case if you need to do it not in your business code, but you need it inside the installer.
As I know, it's possible to make your own jar-file and to use it inside your installer, may be you should try to make your own ligic, that determine this public ip and is called from your IzPack installer.

Related

How to connect to wifi raspberry pi headless?

I know there are a bunch of blogs explaining how to set up the wifi headless on the raspberry pi. I have followed them and they worked, once. But I had to format the sd card, and re-do it and it doesn't connect to the WiFi anymore.
I use the RPI Imager to write the OS. (Note I've also tried with the advanced option pressing Ctrl + Shift + 10, and set up the wifi, ssh over like this. After writing it, the verification returned an error that couldn't create a FAT32 partition).
Then I created a blank ssh file inside the sd card (boot) to allow the ssh connection.
Then I created the wpa_supplicant.conf file containing this:
country=CZ
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NETWORK-NAME"
psk="NETWORK-PASSWORD"
}
Then I eject the sd card, insert it in the raspberry pi and it doesn't connect to the wifi.
I know that the Raspberry pi, and the wifi connector work well. So it must be something that I'm misssing.
I'm honestly desperate at this point since I have spent more than 10 hours just trying to connect to the WiFi. I have formated and re-installed the Raspberri-OS a bunch of times already, and tried as many tutorials as I could find.
There's not really a single universal answer to your question, so at the risk of telling you a bunch of things you already tried, here's my exhaustive list of stuff to try/consider:
If you're using Ubuntu you probably have to use netplan - see here for some instructions https://askubuntu.com/questions/1143287/how-to-setup-of-raspberry-pi-3-onboard-wifi-for-ubuntu-server-with-netplan
Don't forget your key_mgmt field (use the value relevant to your wifi):
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=CA
network={
ssid="NETWORK_SSID"
psk="PSWD"
key_mgmt=WPA-PSK
}
If you can ssh into with a wired connection, and are using Raspian, you may find using raspi-config easier (sudo raspi-config, then System Options > S1 Wireless LAN).
Now we get into the "I already checked that five times" part of the list:
a)if you're using Ubuntu/netplan, ensure you're using the correct interface id by doing ifconfig - should be wlan0, but you never know
b)ensure you have your SSID correct - you can do sudo iw wlan0 scan to find all the networks in reach and double check the SSID. Watch out for weird quotation marks (e.g. 'smart' quotes), elongated dashes and stray spaces - in particular if you have pasted the SSID and password from elsewhere
c) ensure your SSID, password and key setting is correct by checking a different device
d) ensure you are looking for the right IP address on your LAN - you can do a sudo nmap -sn 192.168.1.0/24 and your Pi devices should show up looking like:
Nmap scan report for 192.168.1.68
Host is up (0.00044s latency).
MAC Address: B8:27:EB:8B:73:AD (Raspberry Pi Foundation)
Remember that if using DHCP, your Wifi and Wired connections will get different IP addresses - if using static for Wired, you'll also likely get a DHCP address for your wireless interface.
If you keep failing using the same Raspian image, try something different, just to isolate the problem - e.g. try Ubuntu if you keep failing with Buster (or vice versa)
Finally, some more general advice about what to do when you're just so frustrated with a problem that you've spent way too much time on - write out a 'proof' of why what you're trying to do is impossible, explaining line by line how you've done exactly the steps that are supposed to work. This is my method of last resort, and currently has a 100% success rate - when I try to explain why the thing is impossible, I realize what I didn't do, overlooked, or did wrong.
Actually, I solved this by following this blog https://weworkweplay.com/play/automatically-connect-a-raspberry-pi-to-a-wifi-network/?fbclid=IwAR2QckXB5XMPLCttnyBDUWv-MgxFsk0utfih4FHpF1za4OzH-9h-SKgR0GM and adding some stuff to the /etc/network/interfaces/

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.

Authentication on CRM 2013 with NLB

I have a problem of authentication on a vanilla CRM2013 installed on a NLB. The crm 2013 is working correctly if i use the ip address of the NLB, but if i try to access the NLB using is unique name, it's prompting for credentials and is not authenticating the user (the user is the one that i used for the setup process). Anyone has ever seen something like this? I try to fiddler the request and beside a small difference in a cookie request in the header to me they look the same. Also if i ping the unique name of the NLB it responds with the correct ip address.
The last test that i did was add the name in the host file, and i had the same problem (no authentication), looks like is managing to get to the server but it fails to authenticate. I tried to use localhost address and it worked (on both the single servers), and it worked with the name of the 2 servers that are part of my cluster, it worked with the ip of those servers too. Anyone has any idea why with the ip address of the NLB everything is working as i expect and as soon as I use the name is not working?
Recap:
Address |Status
-------------------------
CRM1.com |working
192.168.1.CRM1 |working
CRM2.com |working
192.168.1.CRM2 |working
192.168.1.NLB |working
NLB.com |not working
Obviously this is sample data, and I know that with the single server i will not use the NLB, I was expecting to have issues with both the Ip and the servername, not with just one of them.
I found out the reason is not working. When you install behind a NLB you need to change some parameters in iss. Since I'm not very good at managing it in the config editor you need to change the section, and update 2 keyvalues from false to true. Step 2-10 of this guide http://blogs.msdn.com/b/niran_belliappa/archive/2014/02/17/network-load-balancing-microsoft-dynamics-crm-2013.aspx

Force Glassfish to bind to a network interface

We are using Glassfish on multi homed servers and I would like to force Glassfish just to use one interface.
I updated domain.xml by
substituting every occurrence of 0.0.0.0 by the IP address
everywhere a port was mentioned without an address address=<IP> was added
every host=localhost was substituted with host=<IP>
After starting Glassfish several listeners are still listening on every available IP address:
3820: I tried to specify an address but the option is ignored
<iiop-listener port="3820" id="SSL" address="<IP>" security-enabled="true">
3920: same as above
<iiop-listener port="3920" id="SSL_MUTUALAUTH" address="127.0.0.1" security-enabled="true">
has no effect
7776: no idea
The next listeners use some dynamically generated ports
53491
53495
53496
53497
Now my question:
is there a way to make sure Glassfish will be using one and just one network interface?
if this cannot be achieved with Glassfish is there a way on a Linux system to trick an application to see only one interface?

How to change DNS IP for programmatically on CF 2.0

I want to change the DNS IP Address programmatically to the Adapter on Compact Framework. I have checked in the NetworkInterface class of OpenNetCF 2.3 as well, but I do not want the device to be rebooted after setting.
Could somebody throw a light on the please?
The adapter's DNS server addresses are stored in the registry in a key like this:
[HKEY_LOCAL_MACHINE\Comm\<Adapter Name>\Parms\Tcpip]
"DNS"=REG_MULTI_SZ:<IP address of the DNS name server>.
Note that it is a multi_sz value.
Simply update the registry and rebind the adapter using the SDF's NetworkInterface.Rebind() method or by calling DeviceIoControl on the NDIS device with IOCTL_NDIS_REBIND_ADAPTER (which is what the SDF's call is doing).