Skip to content

Instantly share code, notes, and snippets.

View mark05e's full-sized avatar

mark05E mark05e

View GitHub Profile
@mark05e
mark05e / Install-MicrosoftTeams.ps1
Created March 24, 2021 17:13
Installs the latest copy of Microsoft Teams.
<#
.Synopsis Downloads and installs the latest version of Microsoft Teams.
.NOTES
TODO: Prevent Teams Firewall Popup
https://thoor.tech/2018/11/microsoft-teams-firewall-prompt/
#>
$LogPath = "$env:WINDIR\Temp\Install-Teams.ps1.log"
Start-Transcript -Path $LogPath
$ec = 1
Windows Registry Editor Version 5.00
; Office 2013
[HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\Identity]
"Version"=dword:00000001
"EnableADAL"=dword:00000001
; Office 2016 and 365
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Identity]
"Version"=dword:00000001
# ██████╗ ███████╗███╗ ███╗ ██████╗ ██╗ ██╗███████╗ ██╗ ██╗██████╗
# ██╔══██╗██╔════╝████╗ ████║██╔═══██╗██║ ██║██╔════╝ ██║ ██║██╔══██╗
# ██████╔╝█████╗ ██╔████╔██║██║ ██║██║ ██║█████╗ ███████║██████╔╝
# ██╔══██╗██╔══╝ ██║╚██╔╝██║██║ ██║╚██╗ ██╔╝██╔══╝ ██╔══██║██╔═══╝
# ██║ ██║███████╗██║ ╚═╝ ██║╚██████╔╝ ╚████╔╝ ███████╗ ██║ ██║██║
# ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚══════╝ ╚═╝ ╚═╝╚═╝
#
# ██████╗ ██╗ ██████╗ █████╗ ████████╗██╗ ██╗ █████╗ ██████╗ ███████╗
# ██╔══██╗██║ ██╔═══██╗██╔══██╗╚══██╔══╝██║ ██║██╔══██╗██╔══██╗██╔════╝
# ██████╔╝██║ ██║ ██║███████║ ██║ ██║ █╗ ██║███████║██████╔╝█████╗
@mark05e
mark05e / scoop-firstsetup.md
Last active April 8, 2021 20:07
My Scoop first setup steps

$env:SCOOP='C:\Scoop'

[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')

Set-ExecutionPolicy RemoteSigned -scope CurrentUser

Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')

scoop install sudo

# Unattended Install of 7-Zip 64-bit
# ref: https://gmusumeci.medium.com/unattended-install-of-7-zip-using-powershell-1387ceb1e714
# ref: https://www.7-zip.org/download.html
$Installer7Zip = $env:TEMP + "\7z2107-x64.msi";
Invoke-WebRequest "https://www.7-zip.org/a/7z2107-x64.msi" -OutFile $Installer7Zip;
msiexec /i $Installer7Zip /qb;
sleep 10;
Remove-Item $Installer7Zip;
@mark05e
mark05e / List-InstalledDotNetFramework.ps1
Created April 6, 2021 20:52
Check .Net framework on the filesystem and registry
# Check installed .Net versions
# ref: https://gist.github.com/MyITGuy/b4497f042d59f1c7b91d
# Using filesystem
Write-Host "Checking Filesystem ..."
$x= Get-ChildItem -Path "$($env:WINDIR)\Microsoft.NET\Framework*" |
ForEach-Object { Get-ChildItem -Path "$($_.PSPath)" |
Where-Object {$_.Name.StartsWith('v') -and $_.PSIsContainer -eq $true -and ((Test-Path -Path "$($_.FullName)\mscorlib.dll" -PathType Leaf) -eq $true)}
} | Select-Object @{Name="Version";Expression={$_.Name.TrimStart('v')}},@{Name="Bitness";Expression={if (!$_.Parent.ToString().TrimStart('Framework')) {[int]32} else {[int]$_.Parent.ToString().TrimStart('Framework')}}} |
Sort-Object -Property Version;
#!/bin/bash
apt update
apt install -y vim mlocate wget curl net-tools zip
FILE=/usr/share/javascript/proxmox-backup/js/proxmox-backup-gui.js
cp $FILE $FILE.$(date +%d_%m_%Y_%Hhr_%Mm_%Ss).original
# Change Logo, Favicon, Bios Image
mkdir /usr/share/custom/backup
cp /usr/share/javascript/proxmox-backup/images/{logo-128.png,proxmox_logo.png} /usr/share/custom/backup/
@mark05e
mark05e / regex-comments.md
Created April 10, 2021 13:41
Regex to match comments

Regex Match Comments

`//

//.*?(?=\r?$)

`##

##.*?(?=\r?$)

Explanation:

::----------------------------------------------
:: Running Node-Red portable on windows
:: Dir structure
:: node-red
:: |-node
:: |-node_modules
:: |-userDir
::----------------------------------------------
set PATH=%PATH%;%CD%\node;%CD%\node_modules\.bin;
start /B "" "cmd /c timeout 5 > NUL && start http://127.0.0.1:1880/ "
@REM ref: https://superuser.com/questions/165986/windows-command-that-returns-external-ip
nslookup myip.opendns.com resolver1.opendns.com