If you are like me once you entered a Wi-fi password, literally 2 seconds after it's forgotten, so what happens when your colleague asks you for the password? Well it turns out it's quite easy to accomplish on OSX (as long as you have an administrator account, below you will find the required steps
Mainly Spring/Java and Java JEE tips and tutorials based on what i'm working on, usually (Spring, MongoDB, Spring boot, Big Data, Cassandra etc.) or what interests me. Occasionally some gadget tips.
OSX find and display saved wifi password
OSX Wi-fi and Ethernet network simultaneously connected and static routing
So recently I had a situation where I had my Ethernet and Wifi connected to 2 different networks in my MAC OS X, and I had a very specific use case for this
I needed to use the Ethernet connection to access 1 specific host (an internal web service), the connection through the ethernet cable allowed this but did not allow internet access, the Wifi connection allowed internet access but will not allow access to the internal web service, so basically what I needed was :
- Have both connections active
- Access the internal web service through the Ethernet connection
- Access all the other hosts through the Wi-fi connection
Just connecting both interfaces does not work I was either getting access to the internet or either access to the internal WebService; if you check this article over at apple OS X network interfaces priority you can see that you can change the priority used by the system to route the requests; so if you change the priority of the Wi-fi to be on top you get internet access but not access to the internal network, and vice-versa
Sure you can make it work this way but it's really painful to have to manually change the interfaces priority to accommodate what you are trying to do at that moment
The solution that I found is to add a static route to that host; this can be easily done in a few steps (you will need for this the IP of the internal host you are trying to access)
- Give your Wi-fi interface the highest priority (put it on top), for this you can refer to the apple link cited above
- Identify the interface names, for that execute the following command on the terminal netstat -nr (in my case en0 is the ethernet interface whereas the Wi-fi is the en1)
sudo route add -host 10.120.136.57 10.247.131.1
And that should be it, please note that restarting the PC will probably remove the static route from the routing table so you will have to re-add it
OSX show used ports or listening applications with their PID
On OSX you can display applications listening on a given port using the lsof the commands described below will show listening application...
-
How to create a multi-hop ssh tunnel or how to chain multiple ssh tunnels. (or SSH inception) For security reasons sometimes you need to ju...
-
To give you some context recently while working on a new small project I needed to include a few Jasper Reports that where hosted in a Jas...
-
This is the second part of the Spring boot and spring data jpa tutorial - A sample application using spring 4.0 spring boot and JPA At th...


