Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Nick Shores nshores

🏠
Working from home
Block or report user

Report or block nshores

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Dapacruz
Dapacruz / Redirect-VMHostLogs.ps1
Last active Oct 16, 2018
Redirect VMware ESXi Host Logs
View Redirect-VMHostLogs.ps1
$hosts = '*'
$datastore_name = 'NS-VMFS-01'
$datastore = Get-Datastore -Name $datastore_name | Select-Object -First 1
$log_dir = '[{0}] Logs' -f $datastore.Name
$scratch_location = '{0}/Logs' -f $datastore.ExtensionData.Info.Url -replace 'ds://'
foreach ($h in (Get-VMHost $hosts | Sort-Object -Property Name)) {
Write-Host "$($h.Name): Redirecting log files ..."
$result = Get-AdvancedSetting -Entity $h -Name Syslog.global.logDir | Set-AdvancedSetting -Value "$log_dir/$h" -Confirm:$false
Write-Host "New syslog location: $($result.Value)"
@Dapacruz
Dapacruz / Configure-Ntp.ps1
Created Dec 7, 2017
Configure/Enable NTP on a VMware ESXi Host
View Configure-Ntp.ps1
$hosts = '*'
$ntp_servers = '10.10.1.10', '10.10.1.5'
Get-VMHostService -VMHost $hosts | Where-Object {$_.key -eq 'ntpd'}
Get-VMHostNtpServer -VMHost $hosts
Add-VMHostNtpServer -VMHost $hosts -NtpServer $ntp_servers
Get-VMHostService -VMHost $hosts | Where-Object {$_.key -eq 'ntpd'} | Start-VMHostService | Set-VMHostService -Policy 'automatic'
@prasanthj
prasanthj / lirc-pi3.txt
Last active Nov 16, 2019
Getting lirc to work with Raspberry Pi 3 (Raspbian Stretch)
View lirc-pi3.txt
Notes to make IR shield (made by LinkSprite) work in Raspberry Pi 3 (bought from Amazon [1]).
The vendor has some documentation [2] but that is not complete and sufficient for Raspbian Stretch.
Following are the changes that I made to make it work.
$ sudo apt-get update
$ sudo apt-get install lirc
# Add the following lines to /etc/modules file
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
@mobzystems
mobzystems / Start-FileSystemWatcher.ps1
Last active May 17, 2019
Using a FileSystemWatcher from PowerShell
View Start-FileSystemWatcher.ps1
# Start-FileSystemWatcher.ps1 - File System Watcher in Powershell.
# Brought to you by MOBZystems, Home of Tools
# https://www.mobzystems.com/code/using-a-filesystemwatcher-from-powershell/
[CmdletBinding()]
Param(
# The path to monitor
[Parameter(Mandatory=$true, Position=0)]
[string]$Path,
# Monitor these files (a wildcard)
@morisy
morisy / Reset-LocalAccountPassword.ps1
Created Mar 8, 2017
This article presents a new script, Reset-LocalAccountPassword.ps1, which makes it easier and more secure to reset local account passwords on computers.
View Reset-LocalAccountPassword.ps1
# Reset-LocalAccountPassword.ps1
# Written by Bill Stewart (bstewart@iname.com)
#requires -version 2
<#
.SYNOPSIS
Resets the built-in Administrator account or a named local account password on one or more computers.
.DESCRIPTION
@savetheclocktower
savetheclocktower / README.md
Last active Oct 25, 2019
Poor-man's LEDBlinky with RetroPie and Pac-Drive
View README.md

NOTE: This Gist was an early write-up of this blog post, part of what became an eleven-part series on my arcade cabinet. I'd suggest you read that post instead of this, but some of the comments on this Gist contain updates and field reports that you might find useful.

RetroPie, LED control, and you

I wanted LEDBlinky-style functionality out of my RetroPie cabinet. But I didn't need RGB control or magical frontend integration or anything like that. I had buttons with simple single-color LEDs.

I've got a simple control panel with six buttons per player. All I wanted was this:

  • When I launch Street Fighter 2, all twelve buttons should light up.
  • When I launch The Simpsons, only the first two buttons for each player should light up.
@jsanz
jsanz / ovafix.md
Last active Jan 10, 2019
Making a OVA file compatible with VMWare
View ovafix.md

This is a recipe to fix this error when importing to VMWare an OVA file:

Download and install OVFTool (https://www.vmware.com/support/developer/ovf/)

Convert OVA to VMX using the command below (this will create example.vmx)

$ ovftool example.ova example.vmx
@Jaykul
Jaykul / Get-MsdnKeys.ps1
Last active Aug 28, 2019
PowerShell + Selenium Demo: Getting Started, and reusing cookies with Invoke-Request
View Get-MsdnKeys.ps1
# It might work in 4, but I'm not testing there. Lower you'll have to tweak code
#requires -Version 5.0
param(
# Your Live ID for MSDN login
[Parameter(Mandatory)]
[PSCredential]
[System.Management.Automation.CredentialAttribute()]
$Credential,
# Pick a browser to use. Defaults to Firefox (which doesn't seem to require an external Driver file)
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active Dec 8, 2019
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64
View clean-up-boot-partition-ubuntu.md

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@alirobe
alirobe / reclaimWindows10.ps1
Last active Dec 9, 2019
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
View reclaimWindows10.ps1
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.20.2, 2018-09-14
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
You can’t perform that action at this time.