So if I want to continuously ping a website, say incredigeek.com, I can put in the following
ping -n 0 incredigeek.com
Hit return and we are off to the races. But wait. I can’t get it to stop. Ctrl + C, doesn’t do anything, Ctrl + D or Ctrl +Z don’t help either.
Okay well fine. We’ll launch another terminal and ssh into it again and see what we can do. Excellent, now we are in aaand… wait… why are the ping results showing up here too? Help!!!
Buried in the heart of the helpful help command are these lines.
ping -- Send ICMP ECHO_REQUEST packets to network hosts
pingend -- End ICMP ECHO_REQUEST packets to network hosts
You don’t say. Well lets try typing in pingend with all the commotion going on in the terminal.
SSH+> pingend
Ping statistics for 142.250.191.206:
Packets: Sent = 3, Received = 3, Lost = 0 (0% loss)
Well good to know. Saves having to reboot the device.
That should be everything that you need. Send a test email to an external email account to verify that it works.
Note that it looks like sending an email locally to email addresses on the same domain or to yourself bypass the filter and do not get the disclaimer added.
The following links were helpful for getting this set up.
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.
ssh user@mikrotik
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"
-bash: 08: value too great for base (error token is "08")
The better way
Fortunately there is an easier and more reliable way to do this. Using the date command, you can specify yesterday and it will print out yesterdays 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
WPAPSK1=[c760ba8ffe65c669]
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"
More info.
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&)”
LocationService class is used but Locations Usage Description is empty
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.
Ran into the above issue while trying to build a Unity project. Android studio had the correct version installed, why was it not able to use API level 30?
Ok So hit Update Android SDK. Unity Launches a PowerShell window and tries to upgrade the Android SDK level, but fails with
“Unable to install additional SDK platform. Please run the SDK Manager manually to make sure you have the latest set of tools and the required platforms installed.”
Looks like there was a bug with the space in the path to the command Unity was running.
Looks like there are a couple of work arounds for this. I had Android Studio installed so I opened up that folder and copied that platform version to my unity folder.
Copy Android platform from Android Studio to Unity Folder
Android Studio folder should be in AppData\Local\Android\Sdk\platforms
Unity Project folder should be “C:\Program Files\Unity\Hub\Editor\2020.3.19f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms”
You should now be able to build the project in Unity now with the appropriate API version.