PANOS CLI Commands to Debug Palo Alto Logging Service
The Palo Alto Networks Logging Service enables firewalls to push their logs to Cortex Data Lake (CDL). If a firewall is having issues connecting you can try the following. Check the logging service license is installed:
request license info You should at least see the logging service license among the returned licenses. If not then things are not going to work. If the license is there and you still have issues then try the following to refresh the key and the certificate.
Posting Images In Hugo From VS Code
Trying to remember something I previously knew; how to insert images into posts. Using VS Code on macOS and the Paste Image extension you can copy the image into the clipboard using cmd + ctrl + shift + 4
Once in the clipboard you can paste the image into VS Code using cmd + alt + v. See below:
Paste Image will copy the file into a folder and create the link in markup.
Installing RSAT on Windows 10
As of the Windows 10 October 2018 update, installing the Remote Server Administration Tools (RSAT) has changed:
Starting with Windows 10 October 2018 Update, RSAT is included as a set of “Features on Demand” in Windows 10 itself. See “Install Instructions”
So rather than a separate download RSAT has joined features on demand. This is an improvement in my opinion as the install is closer tied to the OS. Previously you would have to wait for the tools to be updated for newer versions of windows and that did not seem to happen very quickly.
Migrating Site… Again!
2019 and a brand new post. Things have moved on so it is time to move to something new. In this case out with Jekyll and in with Hugo! So this calls for a brand new page.
I guess I’m going to have to workout markup~~…~~
Quickly Remove Comments from Configuration Files
Configuration files can be long and complex and it is hard to see which values have been set. There are numerous ways to do this however, grep with -v (–invert-match) is a quick way to achieve this. The following example removes all the comments from an elasticsearch configuration file:
ed@es01:~$ sudo grep -v ‘#’ /etc/elasticsearch/elasticsearch.yml Which returns:
cluster.name: es node.name: es01 network.host: 10.1.10.187 discovery.zen.ping.unicast.hosts: ["10.1.10.187", "10.1.10.124"] discovery.zen.minimum_master_nodes: 2 Five lines where it is easy to see what has been configured.
Searching for a DHCP Lease by MAC Address
Update
Note, if you are looking to search for DHCP information across all or multiple DHCP servers in the forest then this is a quicker method. The below is still valid if you are searching a single server.
Sometimes in a large infrastructure it can be hard to find new devices added to the network. Being able to search on MAC address across all DHCP scopes comes in handy. With powershell and Windows DHCP server this is easy to do.
Reporting the Machine Hardware Model Number from Windows
You can pull this information from wmi. This method is useful when you are on the other side of the world to the machine you are working on. All you need is a local or remote shell via psexec or powershell, and type the following:
wmic csproduct get name Here are some sample results:
Name HP Z420 Workstation Name PRIMERGY BX924 S4 Name ProLiant DL380 G7
Batch Convert Images
The quickest way of converting image formats is to use ImageMagick. There are binary releases for most popular operating systems, however in my case I’m using it on OS X. So to install using brew from a terminal use:
brew install imagemagick Once that is installed then just move to the folder you are interested in and use the following:
mogrify -format png *.jpg Once that is completed the folder of jpegs should now have some png friends to play with.
Active Directory Forest Wide User Search
I always have to look this up, I’m not sure what is going on with my memory:
dsquery user forestroot -name search When you are working on large Active Directories this is somewhat handy. Just replace search with the name you are after, helpfully it supports wildcard.
Finding the Exchange Mail Pickup and Replay Directory Folder Location in Your Exchange Infrastructure
Use the following powershell command to return the mail pickup folder location from all your Edge and Hub Transport servers.
Get-TransportServer | Fl name, PickupDirectoryPath If you are interested in a single server add -Identity:
Get-TransportServer -Identity "Server Name" | Fl name, PickupDirectoryPath Where “Server Name” is the Exchange box you are interested in.