Tuesday, August 6, 2024

Windows: Setting a shortcut to a launch a java jar file

Create a shortcut and edit the properties -> Target to; javaw.exe -jar yourjava.jar 

In the example below I'm using fakeSMTP , an smtp server emulator I've mentioned in a previous post.





Friday, August 2, 2024

A couple of PowerShell scripts for IIS I've found handy

 A couple of handy IIS Dumps of sites and virtual directories.

Sites

Import-Module Webadministration
Get-ChildItem -Path IIS:\Sites > d:\allsites.txt

 Virtual Directories

$SiteVirtualDirectories = @()
$Sites = gci IIS:\Sites
foreach($Site in $Sites)
    {
    $VirtualDirectories = gci "IIS:\Sites\$($Site.Name)" | ?{$_.NodeType -match "virtualDirectory"}
    foreach($VirtualDirectory in $VirtualDirectories)
        {
        $SiteVirtualDirectories += @([pscustomobject]@{Site=$Site.Name;VirtualDirectory=$VirtualDirectory.Name;PhysicalPath=$VirtualDirectory.PhysicalPath})
        }
    }

Out-File -FilePath D:\VirtualDirectories.txt -InputObject $SiteVirtualDirectories -Encoding ASCII


Monday, May 20, 2024

ColdFusion: List of common elements between two lists

 A udf for obtaining common list elements courtesy of  https://www.isummation.com/blog/list-common-and-list-compare-in-coldfusion/


<cffunction name="listCommon" output="false" returnType="string">
	<cfargument name="list1" type="string" required="true" />
	<cfargument name="list2" type="string" required="true" />

	<cfset var list1Array = ListToArray(arguments.List1) />
	<cfset var list2Array = ListToArray(arguments.List2) />

	<cfset list1Array.retainAll(list2Array) />

	<!— Return in list format —>
	<cfreturn ArrayToList(list1Array) />
</cffunction>