Had an idea to extract all the unique words from my blog post titles and sort and rank them by frequency. I used MySQL, sed, tr, grep, cat and a little bash script hacked together to do this. Here's the top 10 unique words in my blog post titles. Here's how I got to this... SQL Query select id,post_title from wp_posts where post_type='post' and post_status='publish' Bash Script The script splits each word into a new line and also removes any non-alphanumeric characters sh Continue Reading...

Could not establish trust relationship for the SSL/TLS secure channel.

Working with some older Cisco ASA devices, I'm trying to access the ASDM interface. The browser isn't giving me luck, so I turned to PowerShell to help me, but I get the following error when trying an Invoke-WebRequest to grab the asdm.jnlp file I need. The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. Eh, ok. My first thought was to somehow avoid a certificate check but I did not see a native way of doing this with Invoke-WebRequest Continue Reading...

Setting Microsoft Edge Policies in the Registry: A Quick Guide

To set Microsoft Edge policies in the registry, you will need to add the policies to the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge. Here's a step-by-step guide to setting policies in the registry: Open the Registry Editor: Type regedit in the Start menu and press Enter. Go to the Microsoft Edge policies key: In the Registry Editor, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge. Create a new key: Right-click on the Continue Reading...

Get Enabled AD Users with Last Logon Time and Organizational Unit Information

This PowerShell script retrieves information about enabled Active Directory (AD) users, including their SAM account name, last logon time, and organizational unit (OU). The script makes use of several cmdlets and concepts that are common in PowerShell, including filtering, selecting, sorting, and transforming data. Get-ADUser -Filter * -Properties lastLogon | Where-Object { $_.Enabled -eq $True } | Select-Object samaccountname, @{ Name="lastLogon"; Expression={[datetime]::FromFileTime($_.lastLogon)} Continue Reading...

Writing a portscan utility in .NET

I'm working on a side project that is a portscan utility written in VB.net. Here's my progress so far, and it is working. portscan v0.9.2 scanning my server up to port 1024 with a 25ms timeout There's some way to go on this little project. I think I can optimize it further, clean up the code, and fix my logic for many of the options. See an earlier post about handling command line arguments I wrote which is what class I use for handling the arguments. Continue Reading...

Handling Commandline Arguments in VB.NET

Handling commandline arguments in VB.NET (or really anything) can be tricky. I came across the following class the other day while looking for a drop-in solution to a RAD I was developing. Here's what my usage shows for my application, thanks to the .NET class. portscan.exe portscan 0.9.2 by Rich Kreider Usage: portscan -h <host> -s <startport> -e <endport> -f -d -t <timeoutms> Options: -h Host. IP address or hostname. -s Start port. Continue Reading...

Prefer IPv4 over IPv6 on Windows

Use the following commands to change the preference on Windows to use IPv4 over IPv6. netsh interface ipv6 set prefix ::/96 60 3 netsh interface ipv6 set prefix ::ffff:0:0/96 55 4 Confirm the precedence has changed with the following command: netsh interface ipv6 show prefixpolicies To make this permanent across reboots, issue the following command: reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents /t REG_DWORD /d 0x20 Continue Reading...

Disable Simplified Account Creation in Office 2016+

To disable the Simplified Account Creation dialog box in Outlook 2016, Outlook 2019 or Outlook for Office 36 and use the traditional account dialog box instead, follow these steps. Important: Follow the steps in this section carefully. Serious problems might occur if you modify the registry incorrectly. Before you modify it, back up the registry for restoration in case problems occur. Exit Outlook. Start Registry Editor. To do this, use one of the following procedures, Continue Reading...

Find files modified in Windows command line

The forfiles command exists to facilitate finding files in a given path and can be used to also find files modified by date. forfiles /P c:\users\techish /S /D +11/01/2022 The above command would recursively (/S) search the path (/P) C:\users\techish for all files modified after the date (/D) of November 1, 2022. Continue Reading...

Backup VMware ESXi Host

Backup using vim-cmd To ensure that the configuration of the target ESXi host is synchronized with persistent storage, run the following command: vim-cmd hostsvc/firmware/sync_config To back up ESXi configuration, run this command: vim-cmd hostsvc/firmware/backup_config The command will produce a link for downloading the configBundle.tgz archive. Note that you have to replace the asterisk in the provided link with your IP/FQDN. Alternatively, access the backup file in the /scratch/downloads Continue Reading...