LibreNMS dump devices in MySQL database

All the devices are stored in the librenms datebase devices table.

You can dump all of them with the following command from a shell prompt.

sudo mysql -u librenms  -p librenms -e "select hostname,sysName from devices"

Example output

[jim@localhost ~]$ sudo mysql -p librenms -e "select hostname,sysName from devices"
 Enter password:
 +----------------------------------------+--------------------------------+
 | hostname                               | sysName                        |
 +----------------------------------------+--------------------------------+
 | 192.168.1.1                            | linksys                        |
 | 192.168.1.9                            | wifi-unifi                     |
 +----------------------------------------+--------------------------------+

Unity not loading scene levels

Problem: Game would finish level, but would not load next one.

The issue was that all the levels were not included in the build scene, (File -> Build Settings -> Scenes In Build) so even though the level was correct in PlayMaker, it would not load the level in the Game window while testing.

To add scene to build, open the scene up in the editor, then open the Build Settings from File -> Build Settings… or Ctrl+Shift+B and Add Open Scenes

CHIPSEC notes

The following is some quick notes on using CHIPSEC to compare the EFI whitelist on your current machine with the BIOS Dell provides

Quick notes.

  1. Install prerequisites (Uses python 2)
  2. Git clone Chipsec
  3. Install (Had to use a -i option, is in the manual)
  4. Run (Use spaces like below)

Extract Bios ROM from Dell EXE
Use the BIOS exe to output a .rom file that you can use in Linux. Run the following command from Windows command prompt, accept the security request. Change the EXE to the BIOS you downloaded.

Alienware_17_R2_1.5.0.EXE /writeromfile

The BIOS rom is named dell.rom in the following commands

Get list of Computer ROM

Should create fw.bin file and efilist.json file from local machine

sudo python chipsec_main.py -m tools.uefi.whitelist

Get list from Dell rom

sudo python chipsec_main.py -m tools.uefi.whitelist -a generate efilist.json dell.rom

Compare the current ROM against the one downloaded from Dell

sudo python chipsec_main.py -m tools.uefi.whitelist -a check efilist.json fw.bin

For some reason Ubuntu was not recognizing the last three options after the -a as individual options unless there was a space in between them.  All the examples online show that they had commas between them.  Which should work, so wonder if it was an environment variable problem or something.

The tell tell sign was the [*] Module arguments Line only shows 1 argument, needs 3.

Other links

Install instructions here.
https://github.com/chipsec/chipsec/wiki/Installing-CHIPSEC-in-Linux

LUV Linux download
https://01.org/linux-uefi-validation

Manual
https://github.com/chipsec/chipsec/blob/master/chipsec-manual.pdf

Unity Button can’t access script functions

When you have a button object there is the On Click () area that can execute different actions like a PlayMaker script or a function in a C# script.

Issue with the C# script. You can’t drag and drop the script from the Assets Panel. The script needs to be assigned to an object, then drag and drop that object on the On Click () object. Then select the script and then the function from the drop down there.

Example:

Code snippet below is the EnableDisableAudio function that gets executed by the On Click () function above. Note that the script has to be assigned to an object, in this case the button.

    public void EnableDisableAudio()
    {
        counter++;
        if (counter % 2 == 1)
        {
            Debug.Log("ButtonToggled - On");

        }
        else
        {
            Debug.Log("ButtonToggled - Off");
        }
    }

More info

https://gamedev.stackexchange.com/questions/100995/why-is-c-method-not-showing-up-for-buttons-on-click

PlayMaker camera fade in/out blinks after fade is complete – Unity

Looks that the issue has something to do with the fade event not being on the camera directly. Work around is to create a FSM on the main camera to fade in when the scene starts, have a bool that gets turned to true when the scene ends. Then the FSM on the camera fades out.

Example FSM on the main player camera

Unity script for enemy to follow player

The following script will let an object follow a player when it is within a certain range and will stop following it once it is out of a certain range

The following variables can be adjusted from the Inspector.

Attack Speed = How fast the game object moves
Attack Distance = How close does the player need to be to start moving
Buffer Distance = How far away from the player should the game object stop
Player = Game player to target

To use script, create a new C# script named FollowPlayer and paste in the following.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FollowPlayer : MonoBehaviour
{

    public float attackSpeed = 4;
    public float attackDistance;
    public float bufferDistance;
    public GameObject player;

    Transform playerTransform;

    void GetPlayerTransform()
    {
        if (player != null)
        {
            playerTransform = player.transform;
        }
        else
        {
            Debug.Log("Player not specified in Inspector");
        }
    }

    // Start is called before the first frame update
    void Start()
    {
        GetPlayerTransform();
    }

    // Update is called once per frame
    void Update()
    {
        var distance = Vector3.Distance(playerTransform.position, transform.position);
        // Debug.Log("Distance to Player" + distance);
        if (distance <= attackDistance)
        {
            if (distance >= bufferDistance)
            {
                transform.position += transform.forward * attackSpeed * Time.deltaTime;
            }
        }
    }
}

Helpful Links

https://forum.unity.com/threads/c-get-transform-of-another-gameobject.177216/
https://docs.unity3d.com/ScriptReference/Vector3.Distance.html

Configure AirOS SNMP settings over ssh

In this post we’ll see how we can configure AirOS SNMP settings from the command line.

ubntmod command with save without rebooting.

./ubntmod.sh -i 192.168.1.20 -s "private;monitor@incredigeek.com;[30.69636, -88.04811]" -X '/usr/etc/rc.d/rc.softrestart save'

Alternative manual method.

ssh ubnt@192.168.1.20

Open config file

vi /tmp/system.cfg

Find the SNMP settings and modify as needed. Example below

snmp.community=private
snmp.contact=monitor@incredigeek.com
snmp.location=[30.69636, -88.04811]

Save and exit file with :x

Apply settings

/usr/etc/rc.d/rc.softrestart save

Setting up Proxy over SSH on Linux

Initiate a ssh connection to the server or device you want to use as a proxy. You can change the port to something else if so desired.

ssh username@ipaddress -D 1880

Log in and leave the session running

You can now setup your computer or browser to use the Proxy.
Specify SOCKS Host, hostname is either localhost or 127.0.0.1, the port is 1880.

Firefox example below.