Skip to content

Instantly share code, notes, and snippets.

View pcast01's full-sized avatar

Paul pcast01

View GitHub Profile
@pcast01
pcast01 / set-up-chromium-keys.md
Created February 20, 2019 15:22 — forked from cvan/set-up-chromium-keys.md
Launch Chromium with API Keys on Mac OS X and Windows

Sometimes you need to use API Keys to use things like the Speech API. And then you Google a bit and follow all the instructions. But the Chromium Project's API Keys page does a not-so-great of explaining how to do this, so I will.

  1. Download Chromium.
  2. You'll notice a yellow disclaimer message appear as a doorhanger: Google API Keys are missing. Some functionality of Chromium will be disabled. Learn More.
  3. Clicking on that link takes you to the confusing API Keys docs page.
  4. If you aren't already, subscribe to the chromium-dev@chromium.org mailing list. (You can just subscribe to the list and choose to not receive any mail. FYI: the Chromium project restricts the APIs to those subscribed to that group - that is, Chromium devs.)
  5. Make sur
@pcast01
pcast01 / bandPractice.md
Last active July 5, 2019 22:09 — forked from fpigeonjr/bandPractice.md
Band Practice
/* Popular Ice Cream Totals Quiz
*
* Using the data array and .reduce():
* - Return an object where each property is the name of an ice cream flavor
* and each value is an integer that's the total count of that flavor
* - Store the returned data in a new iceCreamTotals variable
*
* Notes:
* - Do not delete the data variable
* - Do not alter any of the data content
@pcast01
pcast01 / 0_reuse_code.js
Created September 2, 2017 16:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@pcast01
pcast01 / FindRegion.gs
Created August 31, 2017 00:23
Finds Region of county.
/**
* Finds the region where county belongs. Return Region number.
*
* @parm none.
* @return Region number.
* @customfunction
*/
function FindRegion(e){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Sheet1");
@pcast01
pcast01 / TestAD.ps1
Last active September 2, 2017 18:38
New AD User
Start-Transcript -Path "C:\bin\ps\Account_Automation\TestAD.txt"
# Import the Active Directory cmdlets
Import-Module ActiveDirectory
New-ADUser -EmployeeID '10551' -SamAccountName 'taylortobaben' -UserPrincipalName 'taylortobaben@samim.com'
-GivenName 'Taylor' -Surname 'Tobaben' -DisplayName 'Tobaben, Taylor' -path 'Immediadent'
-Company 'Immediadent' -Fax '' -OfficePhone '9132232051'
-Title 'Test Title' -EmailAddress 'taylortobaben@immediadent.com' -Enabled 1 -name 'Taylor Tobaben'
-AccountPassword (ConvertTo-SecureString -AsPlainText '1234!$SamsonDent' -Force) -ChangePasswordAtLogon 1
@pcast01
pcast01 / Set_usergroups.ps1
Last active September 2, 2017 18:38
Set User Group in AD
function Set-UserGroups($loginName, $employeeType, $dept, $state, $regionId, $pc)
{
# Load the groups from the external group_arrays file.
# Use this file to manage all groups and changes to groups
# Blocking out for now and loading the groups as part of this main script.
#. .\group_arrays.ps1
# THESE ARE SAMSON EMPLOYEE groups
$SAMSON_Array = @("!All_Samson_Employees", "!SamsonEmployees", "Domain Users", "Infosource", "Samson_Internet")
New-ADUser -EmployeeID $employeeId -SamAccountName $newLogin -UserPrincipalName $userPrincipalName
-GivenName $firstName -Surname $lastName -DisplayName $displayName -path $path
-Company $company -Fax $fax -OfficePhone $phone
-Title $title -EmailAddress $email -Enabled 1 -name $name
-AccountPassword (ConvertTo-SecureString -AsPlainText $password -Force) -ChangePasswordAtLogon 1
New-ADUser -EmployeeID '10551' -SamAccountName 'taylortobaben' -UserPrincipalName 'taylortobaben@samim.com'
-GivenName 'Taylor' -Surname 'Tobaben' -DisplayName 'Tobaben, Taylor' -path 'Immediadent'
-Company 'Immediadent' -Fax '' -OfficePhone '9132232051'
-Title 'Test Title'
@pcast01
pcast01 / Encrypt string.ps1
Last active September 2, 2017 18:39
Powershell Encrypt String
# Get Password into txt file
Read-Host "Enter Password" -AsSecureString | ConvertFrom-SecureString | Out-File "C:\Temp\Password.txt"
# Read it from text file.
$pass = Get-Content "C:\Temp\Password.txt" | ConvertTo-SecureString
$passwordplain = ConvertFrom-SecureToPlain $pass
$passwordplain
Import-Module C:\Users\USERPROFILE\Downloads\UIAutomation.0.8.7B3.NET40\UIAutomation.dll
[UIAutomation.Preferences]::Highlight = $false
[UIAutomation.Preferences]::Log = $false
[UIAutomation.Preferences]::AutoLog = $false
[UIAutomation.Preferences]::OnErrorScreenShot = $false
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::SilentlyContinue
function Connect-VPN() {
$vpnUI = Get-Process | Where-Object {$_.Name -like "vpnui"}
if($vpnUI){