Category Archives: Other

other

Adding MAC addresses to PHPIPAM using ARP

Posted on .

After finding this feature wasn’t implemented [1][2], I spent some time this evening learning phpIPAM‘s REST API and writing a short bash script to update phpIPAM’s mac field.

  • The script will need the username and password of a user that has write permission to the addresses you want to update.
  • You will need to create an api app, as described in the documentation.
  • The script gets info on a single interface and updates addresses in a single subnet.
  • The script will check that the mac needs updating and only update if necessery.
  • The script will ignore addresses tagged as (3) “reserved” or (4) “dhcp”.
  • The script won’t add new addresses, only update existing ones.
  • The script will check local interface ips as well (as these aren’t in ARP)
  • The script requires “iproute2”, “curl” and “jq” (Command-line JSON processor).

Code available at https://github.com/lazynooblet/scripts/tree/main/bash/phpipam-update-mac-from-arp

VBScript wrapper for PowerShell scripts to hide window

Posted on .

Even with PowerShell’s command-line argument “NoWindow”, a minimized powershell prompt is seen briefly by the user.

Using VBScripts ability to load console applications completely hidden, we can run PowerShell without interrupting the user.

The VBScript takes a single argument which is the filename of the powershell script. The VBScript needs to be in the same folder as the powershell script as it will work out its own scriptpath and use this to find the PowerShell script.

Minimize applications with PowerShell

Posted on .

I have adjusted the previous 3CX script from 2020 to simply minimize a list of applications. The script will search for matching processes for up to 30 seconds and minimize them. I have this script run on logon. It currently minimizes both 3CX and Voicemeeter Macro Button app.

Automatically minimize 3CX Phone for Windows

Posted on .

One of the popular requests from users over at the 3CX forum is how to load up the client minimized. See https://www.google.com/search?q=3cx+minimize+on+startup

Today I’ve written some powershell that when also run at startup will close the 3CX Phone for Windows application automatically. I run this as a scheduled task triggered on login.

The script first checks if 3CX is currently setup to start automatically, and if not, will start 3CX Phone for Windows.

The script then checks once a second for the app to load and will close to tray. The script will wait $wait seconds before closing if the app is not loaded.

Teamspeak 3 – Server Admin Query privilege key

Posted on .

In order to add a user as “Server Admin Query”, login via telnet as “serveradmin” and get a privilege token with the following command:

You will need to select which virtualserver the token should be generated with first with use sid=[server id].

Example: