Search This Blog

Monday, February 10, 2025

Powershell - A Simple Way to Create User Friendly Complex Passwords

Super simple.

I do a lot of password temporary resets. Some of the folks I work with prefer a default password, but I like to new passwords that translate easily when working with clients. 

So, at a minimum I like two words, a symbol, and a number. Something like: !TestPassword42

For my less savvy friends, I created the a code pile similar to the following password generator.


I'm hoping that the format is easy enough to follow. 

  • List blocks to work with.
  • Putting random list block elements together to create a password.
The list blocks are simple arrays, add, modify or delete elements as you need to each. I made a $Verbs, $Colors, $Nouns, and $Symbols for the basic parts. Then I also added a $Today and I demonstrate a number at the end.

This demonstration creates two outputs. 

  1. Creates passwords from $Symbols, $Verbs, $Colors, $Nouns, and a number from 1 to 99.
  2. Creates passwords from $Today, $Symbols, $Verbs, $Nouns, and a number from 1 to 99.

By this sample symbols, verbs, colors, nouns, and number you can support 9,022,860 a day.

Or, 3,293,343,900 a year.


You can get a copy of the code on GitHub.


Thursday, April 18, 2024

Powershell - Create New Rocky OS Workstation VM

 Cent OS is dead. moving on to Rocky OS.

The initial work was in my blog post Powershell - Create New CentOS Workstation VM

I put the pile of code: https://github.com/LesleyPhillips/New-RockyLinux-20240307.ps1


This time around I'm working on Windows 11 Pro Hyper-V Manager


Here you can see me working on Postgres DB...



Wednesday, November 29, 2023

Powerball Statistics

 I had just finished learning R but was annoyed by it. So, in  learning to do Python, and running into so many Python Matplotlab examples, I decided to do it like that. I put the code blob here in github:https://github.com/LesleyPhillips/Powerball.py/blob/main/Powerball-20231004.py

Some takeaways... apparently there are functions for standard deviations and averaging. : )

Here are the results...




This code... 
  • Gets it numbers from 'https://data.ny.gov/api/views/d6yy-54nr/rows.xml?accessType=DOWNLOAD' 
  • It then loops through the XML data into white balls and red balls.
  • Plots the white ball data
  • Plots the red ball data.

You're done!   : )



Friday, September 15, 2023

How to Compile .vb Code

Ever needed to compile some .vb code? Here's how I did it today.



Given a text file called Helloworld.vb with the following content...

Imports System
Module HelloWorld
    Sub Main(args As String())
        Console.WriteLine("Hello World!")
    End Sub
End Module

You can create this file on any path you see fit with any editor Notepad, Notepad++, Atom, VSCode, pick one.  : ) 

For this example I'm using Visual Studio 2022, which look like this...

Visual Studio defaults to creating content in your %userprofile%\source\repos dir. On creating the VB Console project HelloWorld, it saved the source as %userprofile%\source\repos\HelloWorld\HelloWorld\HelloWorld.vb. 

Make sure the latest vbc.exe is on the path.
On My Windows 11 PC it existed in...
C:\Windows\Microsoft.NET\Framework64\v4.0.30319.

With Visual Studio Community Edition 2022, I found it located in C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Roslyn.

Make sure to search and use the on you want to work with.


Start cmd

Issue commands to go to the directory with your source .vb file

>c:
>cd %userprofile%\source\repos\HelloWorld\HelloWorld
>dir

You directory may look like the following...
Visual Studio will also create other legacy elements for managing the code within its environment. For our purposes they are not needed and can be ignored.

Issue the follow commands

>vbc HelloWorld.vb

** Vbc (the older .Net version) will tell you that there is a better method to use called Roslyn which comes automatically with Visual Studio.   

 

If you are using the Roslyn vbc it will look like this...



 
 

>dir

There's our .exe file!   :)

Run HelloWorld

From the cmd prompt issue the command "helloworld"


It works!   : )

You now have a .exe you can use anywhere.
 





Friday, February 25, 2022

Sharepoint Redirect to Notes:// - Part II

 Back in Thursday, November 19, 2015, I showed a bit if html that can be used as a redirector for custom URL handlers. Since then Microsoft has hardened their products a bit and an extra step is needed.

Create the content as shown in Sharepoint Redirect to Notes://.

Save the file, with the content shown in the post, with the extension as .http

Test it by double click the file. IT should open a browser tab and automatically launch the application as expected.

Copy the .http file, then change the extension to .aspx.

You typically cannot test this until it's used from a Sharepoint site.

Save the file on your Sharepoint site.

Test this by clicking on the file you just saved, it should behave as the redirector and open your application.

Get the URL to the .aspx file.

Test this by trying the URL in the address bar of a new browser tab or window, it should behave as the redirector and open your application.

On the Sharepoint page, modify the link to use the working URL acquired in the last step.

Test this by lots of happy clicks!    : )




You're done! 



Saturday, January 15, 2022

MyCompany Certificate Organization

I use a fictitious company called MyCompany for use in some of the things I describe in my writing..

I had done this write up a long time ago and it's influence can be seen in many of my post. I had done this to describe the naming of elements in a Domino DB environment, but many of these ideas are transferable to other directory structures. I'm putting this here so that others can see it as a template for themselves and maybe build on it.

If you want to see where it's been used, search this blog on "MyCompany".


Naming Conventions

Site Names

As far as sites are concerned, admins and business leaders need to come to their own terms. Traditionally, we have stuck with three characters representing a local name, the business unit, and the larger geography they exist in. For example:

        BMO - Butler Manufacturing Ohio
        MRO – Marysville Research Ohio

 Servers Names

Roles

  • SuperHubs - manage the replication and mail transfer between regions.
  • Hubs - can replicate application and route mail.
  • Spokes - are typically more specialized and are broken down into Application, Mail, Dev, QA, and other..

 Naming

Regional admins work with sites admins to work out the names, but should be  named after their functions. The only part which there is a hard rule are for the first two parts of the name.

  • The first character describes the server as an H (hub) server or an S (spoke) server. Superhubs are designated by Z.
  • Next is the site name (like JMO, MMO, PMO).
  • Lastly, the site specific unique identifier.

 Here are a few examples:
        HRSM0001/SRV/NA/MyCompany    Hub for Rochester, MA
        SRSMM001/SRV/NA/MyCompany    Mail server for Rochester, MA
        SRSMA001/SRV/NA/MyCompany    Application server for Rochester, MA
        HAMA001/SRV/NA/MyCompany    Hub server for Aubrey, Arkansas
        STMTBS01/SRV/NA/MyCompany    BlackBerry server for Townsend, Tennessee
        HAMA003/SRV/AU/MyCompany    Hub server for Albany, Australia
        ZMMO003/SRV/NA/MyCompany    Superhub in Marysville, Ohio
        SMMOM023/SRV/NA/MyCompany    Mail server in Marysville, Ohio

 My Company in North America

         /MyCompany

A regional admin will be given the regional cert to manage the creation of sites, servers and people. Regional admins can give sites a cert to manage servers and people.

 This is how NA (North America) is set up...

         /NA/MyCompany

         People
                Sales
                        /RSM/NA/MyCompany (Rochester, MA)
                Manufacturing
                        /AMA/NA/MyCompany (Aubrey, Arkansas)
                        /TMT/NA/MyCompany (Townsend, Tennessee)
                        /BMO/NA/MyCompany (Butler, Ohio, USA)
                        /EMO/NA/MyCompany (Euclid, Ohio, USA)
                        /JMO/NA/MyCompany (Jamestown, Ohio, USA)
                        /MMO/NA/MyCompany (Marysville, Ohio, USA)
                        /PMO/NA/MyCompany (Paulding, Ohio, USA)
                        /YMO/NA/MyCompany (Youngstown, Ohio, USA)
                        /WMK/NA/MyCompany (Weskan, Kansas)
                        /UML/NA/MyCompany (Uncle Sam, Louisiana)
                R&D
                        /MRO/NA/MyCompany (Marysville, OH)
                Canada (Sales, Mfg.)
                        /CN/NA/MyCompany (York Point, Prince Edward Island)
                Mexico (Sales, Mfg.)
                        /MX/NA/MyCompany (Oaxaca, Oaxaca)
        Servers
                /SRV/NA/MyCompany

Other Certs

        AF (Africa)
                /KSS/AF/MyCompany (Koidu Town, Kono District, Sierra Leone)
        AN (Antartica)
                /HRS/AF/MyCompany (Husvik, South Georga Island)
        AS (Asia)
                /GMC/AF/MyCompany (Qingzhen, Guizhou, China)
                /HMC/AF/MyCompany (Dongfang, Hainan, China)
                /MMI/AF/MyCompany (Parbhani, Maharashtra, India)
        AU (Australia)
                /AMA/AF/MyCompany (Albany, Western Australia, Australia)
        EU (Europe)
                /BME/EU/MyCompany (Sutton , Central Bedfordshire, England)
        SA (South America)
                /AMA/EU/MyCompany (Albany, Western Australia, Australia)

Many of these sites also have Sales included on the same certs.
There are also research facilities in India (MRI) and in England (BRE).

 

You're done!






Monday, May 17, 2021

Powershell - Create New CentOS Workstation VM

 

I put this initial rundown together for further coding thingies, like state checking and condition handling. Simple enough, with room to grow.   : )

I did this using on Windows 10 pro, with Hyper-V, using Powershell 7 for a CentOS workstation.

The pile of code: https://github.com/LesleyPhillips/Build-CentOSWorkstation.ps1/blob/main/Build-CentOSWorkstation.ps1

Normally, I just throw up CentOS minimal builds. This time I thought I'd try something prettier.