Skip to content

Instantly share code, notes, and snippets.

@jajp777
jajp777 / wsClient.html
Created July 10, 2024 13:23 — forked from Tim-S/wsClient.html
Simple PowerShell Websocket server
<!DOCTYPE html>
<meta charset="utf-8" />
<title>WebSocket Test</title>
<script language="javascript" type="text/javascript">
var wsUri = "ws://localhost:5001/";
var output;
function init() {
output = document.getElementById("output");
function Start-ConnectionMonitoring
{
param($isp, $gateway, $Logfile,[int]$Delay = 10,[Ipaddress] $adapter, [switch]$ispPopup, [switch]$gateWayPopup)
$spacer = '--------------------------'
while($true)
{
if(!(Test-Connection $gateway -source $adapter -count 1 -ea Ignore))
{
get-date | Add-Content -path $Logfile
"$gateWay Connection Failure" |add-content -Path $Logfile
@jajp777
jajp777 / AskPasswordMine.bat
Created July 29, 2022 10:37 — forked from juankb1024/AskPasswordMine.bat
Found cool batch script to ask user credentials masking the password
@echo off
:: This batch file will create an HTML Application (HTA).
:: Values entered in the HTA will be saved as %TEMP%\USERIN.BAT
:: After the USERIN.BAT is CALLed from the main batch
:: (and assuming there is enough room in the environment)
:: environmental variables USERNAME and PASSWORD will be set.
:: It is your responsibility to delete the USERIN.BAT
:: after you CALL it. Because this batch file needs to
:: find itself, you must be sure to call it from your
:: main batch file with a full path and file name.
@jajp777
jajp777 / file01.ps1
Created April 1, 2022 08:34 — forked from MyITGuy/Get-MsiProducts.ps1
PowerShell: Get-MsiProducts / Get Windows Installer Products
function Get-MsiProducts {
$Installer = New-Object -ComObject WindowsInstaller.Installer
$Type = $Installer.GetType()
$Products = $Type.InvokeMember('Products', [System.Reflection.BindingFlags]::GetProperty, $null, $Installer, $null)
foreach ($Product In $Products) {
$hash = @{}
$hash.ProductCode = $Product
$Attributes = @('Language', 'ProductName', 'PackageCode', 'Transforms', 'AssignmentType', 'PackageName', 'InstalledProductName', 'VersionString', 'RegCompany', 'RegOwner', 'ProductID', 'ProductIcon', 'InstallLocation', 'InstallSource', 'InstallDate', 'Publisher', 'LocalPackage', 'HelpLink', 'HelpTelephone', 'URLInfoAbout', 'URLUpdateInfo')
foreach ($Attribute In $Attributes) {
$hash."$($Attribute)" = $null
@jajp777
jajp777 / Set-WindowState.ps1
Created December 23, 2021 12:09 — forked from Nora-Ballard/Set-WindowState.ps1
Hide, Show, Minimize, Maximize, etc window from Powershell.
function Set-WindowState {
param(
[Parameter()]
[ValidateSet('FORCEMINIMIZE', 'HIDE', 'MAXIMIZE', 'MINIMIZE', 'RESTORE',
'SHOW', 'SHOWDEFAULT', 'SHOWMAXIMIZED', 'SHOWMINIMIZED',
'SHOWMINNOACTIVE', 'SHOWNA', 'SHOWNOACTIVATE', 'SHOWNORMAL')]
[Alias('Style')]
[String] $State = 'SHOW',
[Parameter(ValueFromPipelineByPropertyname='True')]
@jajp777
jajp777 / App.css
Created September 1, 2021 09:32 — forked from adrianhajdin/App.css
Build and Deploy a Full Stack Realtime Chat Messaging App with Authentication & SMS Notifications
:root {
--primary-color: #005fff;
--primary-color-alpha: #005fff1a;
}
html,
body {
margin: 0;
padding: 0;
height: 100%;
@jajp777
jajp777 / bling.js
Created August 17, 2021 06:53 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@jajp777
jajp777 / continous-qunit.ps1
Created June 22, 2021 11:22 — forked from jfromaniello/continous-qunit.ps1
The powershell continuously watch for file changes in a directory, then it executes PhantomJs with the Run-Qunit.js attached to your htm qunit test harness.
# watch a file changes in the current directory,
# execute all tests when a file is changed or renamed
$watcher = New-Object System.IO.FileSystemWatcher
$watcher.Path = get-location
$watcher.IncludeSubdirectories = $true
$watcher.EnableRaisingEvents = $false
$watcher.NotifyFilter = [System.IO.NotifyFilters]::LastWrite -bor [System.IO.NotifyFilters]::FileName
while($TRUE){
<manifest schemaversion="4.30" binaryversion="9.20">
<configuration>
<options>
<!-- Command-line only options -->
<option switch="i" name="Install" argument="optional" noconfig="true" exclusive="true" />
<option switch="c" name="Configuration" argument="optional" noconfig="true" exclusive="true" />
<option switch="u" name="UnInstall" argument="optional" noconfig="true" exclusive="true" />
<option switch="m" name="Manifest" argument="none" noconfig="true" exclusive="true" />
<option switch="t" name="DebugMode" argument="optional" noconfig="true" />
<option switch="s" name="PrintSchema" argument="optional" noconfig="true" exclusive="true" />
function ConvertTo-Digits {
<#
.SYNOPSIS
Convert an integer into an array of bytes of its individual digits.
.DESCRIPTION
Convert an integer into an array of bytes of its individual digits.
.EXAMPLE
ConvertTo-Digits 145
.INPUTS
System.UInt64