This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credits: https://squirrelistic.com/blog/how_to_download_older_version_of_google_chrome | |
$ChromeVersion = '123' | |
$requestId = ([String][Guid]::NewGuid()).ToUpper() | |
$sessionId = ([String][Guid]::NewGuid()).ToUpper() | |
$xml = @" | |
<?xml version="1.0" encoding="UTF-8"?> | |
<request protocol="3.0" updater="Omaha" sessionid="{$sessionId}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
temp_threshold_low=40 | |
temp_threshold_mid=50 | |
temp_threshold_high=60 | |
temp_threshold_max=70 | |
power_threshold_low=180 | |
power_threshold_mid=300 | |
power_threshold_high=500 | |
power_threshold_max=800 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
# The folder containing the images | |
[Parameter()][string]$imgPath = $env:imgPath, | |
[Parameter()][string]$bgiPath = $env:bgiPath | |
) | |
if ([string]::IsNullOrEmpty($imgPath) -or [string]::IsNullOrEmpty($bgiPath)) { | |
throw "You need to set imgPath and bgiPath environment variables or pass them in." | |
} | |
#region function definitions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//KeyedCollection keeps an internal lookup dictionary for better performance. | |
//With normal implementations of an observable KeyedCollection, when used for | |
//data bindings in WPF, once the key of the item is changed with bindings, the | |
//corresponding key internal dictionary is not changed, which leads to hidden | |
//problems when the dictionary is used. | |
//Below is a custom implementation of KeyedCollection to solve that problem. | |
using System; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[string]$Address, | |
[string]$Server | |
) | |
function FormatDnsRecords { | |
[CmdletBinding()] | |
param( | |
[parameter(ValueFromPipeline, Mandatory)] | |
[Microsoft.DnsClient.Commands.DnsRecord]$Record |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ipChangeHandler { | |
Write-Host "Detected an IP change..." | |
Write-Host "Collecting connections information..." | |
$connObjs = New-Object System.Collections.ArrayList | |
$ints = Get-NetIPAddress -AddressFamily IPv4 -PrefixOrigin Dhcp -AddressState Preferred | |
foreach ($int in $ints) { | |
$_alias = $int.InterfaceAlias | |
$_index = $int.InterfaceIndex | |
$_ipaddr = $int.IPAddress | |
$intCfg = $int | Get-NetIPConfiguration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
from pathlib import Path | |
import yt_dlp | |
url = sys.argv[1] if len(sys.argv) > 1 else None | |
download_root = sys.argv[2] if (len(sys.argv) > 2) else None | |
proxy = sys.argv[3] if (len(sys.argv) > 3) else None | |
if (None in [url, download_root, proxy]): | |
raise RuntimeError('Missing arguments.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Ryan Ries [MSFT] | |
# Origianl date: 15 Feb. 2014 | |
#Requires -Version 3 | |
Function Test-RPC { | |
[CmdletBinding(SupportsShouldProcess = $True)] | |
Param( | |
[Parameter(ValueFromPipeline = $True)][String[]]$ComputerName = 'localhost', | |
[int[]]$Ports = $null | |
) | |
BEGIN { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Instructions to Install OpenWRT or LEDE on WD MBL Western Digital MyBookLive (Tested on Single, but it should work on Duo too) | |
# Recommended to use a Linux / Debian box with wget, dd, gunzip, lsblk | |
# Using a Debian box (it could be a VM) with the harddrive connected (it could be a minimal net-install Debian) | |
See ip with: | |
ip addr show | |
# connect remotely using: | |
user@outside:~/# ssh user@10.211.55.6 | |
# We elevate permissions or even better install and config sudo | |
user@debian8vm:~/# su |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################ | |
# Script created by Carl Chang # | |
################################ | |
$devcon = 'path\to\devcon_x64.exe' | |
# uninstall dameware products | |
wmic product where "name like '%%dameware%%'" call uninstall | |
# remove left-over devices |
NewerOlder