Sometimes it is nice to have a list of just the IP addresses and the hostname or mac address. Can be especially helpful when you are trying to get a list of devices to do a bulk update in LibreNMS. Helpful LibreNMS links for renaming and showing down devices
we are going to run the command to pull the DHCP information and then use Unix utilities to parse the data out.
Replace dhcp8 with the correct dhcp server in the mikrotik.
First, SSH into your Mikrotik router.
Next we’ll want to go to the ip dhcp-server lease directory
/ip dhcp-server lease
Now we can run the following command to loop through and pull out all the info we need. You can change the info like “mac-address” for something like “status”. You can use Tab to see what options are available. Just delete mac-address and hit tab twice.
I had a command that was used to see if. It used some arithmetic operators to subtract 1 from the current day. That would give us yesterdays day which we could then use to check if a backup was created then.
day=$(date +%d) ; date=$(($day - 1)) ; echo "yesterday date is $date"
In the cambium cloud you can retrieve a config from a router, modify it and reapply it or make a template from it. All the passwords are “encrypted” so you can’t read what the WiFi password is for example.
Example config line looks like
Looks like it uses some sort of des3 hex encryption.
Fortunately there is a utility on the routers we can use to decrypt the encrypted string.
First we need a router that we can SSH into.
Info on the encryption
The Cambium router uses the 3des_hex utility to decrypt and encrypt strings
It is located /sbin/3des_hex
Decrypting a password
Decrypting is super easy.
3des_hex -d "c760ba8ffe65c669"
Replace the key with the key you want to decrypt.
Encrypting a password
Not really sure if this would ever be needed, but you can use the -e option to encrypt a string
3des_hex -e "12345678"
It looks like it needs the lib file “/lib/libuClibc-0.9.33.2.so”
/sbin/3des_hex is where the main file is stored though.
The config_manager.sh script in /sbin has the functions that encrypt and decrypt the config lines.
Ran into an interesting problem while trying to compile a Unity project for iOS. It failed to build because
“LocationService class is used but Locations Usage Description is empty. App will not work on iOS 10+. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)”
Well as far as I know there is not anything calling or requesting location services. I probably could have just put a reason for requesting the service under the build options in Project Settings. But why “use” something we don’t need?
Using the handy grep tool from a terminal, I was able to search through the project for “LocationService” and that returned a couple hits for files in the PlayMaker folder.
Looks like PlayMaker has a couple preconfigured “scripts” for Starting, Stopping, and Requesting Location.
Deleting the following four C# files resolved the error and it built fine afterwards.