Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Sytone sytone

🎯
Focusing
Block or report user

Report or block sytone

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
@sytone
sytone / .gitconfig
Last active Mar 23, 2020
Aliases I have in my global git config
View .gitconfig
[alias]
# standard checkout
co = checkout
# edit the global configuration
ec = config --global -e
# edit the local repo configuration
ecl = config -e
@sytone
sytone / Get-AdUserAllDomains.ps1
Created Sep 24, 2018
Get user in AD from all domains in the forest
View Get-AdUserAllDomains.ps1
param (
$Filter
)
$arrayOfFQDNs = ([System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest() | select domains).Domains | select Name | % { $_.Name }
foreach ($FQDN in $arrayOfFQDNs) {
$adUser = get-aduser -Filter $Filter -properties * -server $FQDN -ErrorAction SilentlyContinue
if ($adUser -ne $null) {
break
@sytone
sytone / FillCalendarForPeriod.ps1
Last active Sep 13, 2018
Fill empty blocks in your outlook calendar for the next week
View FillCalendarForPeriod.ps1
param (
[int] $DaysForward = 7,
# What hour of the day do you start?
[int] $DayStart = 8,
# How many hours after that are work hours?
[int] $DayLength = 10
)
function Get-OutlookCalendar {
param (
@sytone
sytone / HomeAssistantWinDev.md
Last active Nov 6, 2016
Developing Home Asisstant in Windows on the Windows Subsystem for Linux
View HomeAssistantWinDev.md

Setup

Enable the Windows feature for the subsystem. Either do this via Add Remove Programs or open a PowerShell instance as a Administrator.

Run the following command to see if it is already enabled:

Get-WindowsOptionalFeature -online -FeatureName Microsoft-Windows-Subsystem-Linux

If it is not enabled then run the following to enable and reboot your computer.

@sytone
sytone / updatehs.sh
Last active May 2, 2018
Home Assistant Updater Script
View updatehs.sh
#!/bin/bash
## DESCRIPTION: Updates HA in a virtual environment
## AUTHOR: Jon Bullen
declare -r SCRIPT_NAME=$(basename "$BASH_SOURCE" .sh)
## exit the shell(default status code: 1) after printing the message to stderr
bail() {
echo -ne "$1" >&2
@sytone
sytone / BackfillEmbyFromNPvr.ps1
Last active Jul 30, 2016
Used to schedule recordings in Next PVR to fill missing items in EMBY.
View BackfillEmbyFromNPvr.ps1
<#
Set these values and uncomment.
$embyServerUrl = "http://localhost:8096"
$embyUsername = "user"
$embyPassword = "password"
$npvrServerUrl = "http://localhost:8866"
#>
@sytone
sytone / JasperOnPiNotes.txt
Last active Mar 3, 2016
Get Jasper running on PI
View JasperOnPiNotes.txt
#Set sound card to my USB one by default.
sudo nano /etc/modprobe.d/alsa-base.conf
:: ADD to FILE
options snd-usb-audio index=0
options snd_bcm2835 index=1
# Audio record test.
arecord --vumeter=stereo test2.wav --device=sysdefault:CARD=HD5000
@sytone
sytone / LinuxOnPiNotes.txt
Created Feb 27, 2016
Generic Linux on Pi things
View LinuxOnPiNotes.txt
Using Putty or Kitty and getting lines to draw.
The problem is that PuTTY in UTF-8 mode ignores1 VT100 "Alternate character set" commands, and ncurses attempts to use the "graphical" character set for drawing the GUI. (The box drawing characters are in the same positions as klmqx would normally be.)
export NCURSES_NO_UTF8_ACS=1
to your environment, it should fix the problem by telling ncurses to always use Unicode box drawing characters when a UTF-8 locale is selected.
@sytone
sytone / SqueezeboxPlayerNotes.txt
Last active May 24, 2016
Raspberry Pi as a Squeezebox Player
View SqueezeboxPlayerNotes.txt
# Sound test setup
aplay -L
speaker-test -D sysdefault:CARD=Device
amixer
# Get out of jail free card
# sudo /etc/init.d/alsa-utils reset
# alsa configuration
sudo nano /usr/share/alsa/alsa.conf
/lib/modprobe.d/aliases.conf
@sytone
sytone / Get-DhcpLog.ps1
Last active Dec 27, 2015
Returns the DHCP list for a ASUS router.
View Get-DhcpLog.ps1
$username = "admin"
# read-host -assecurestring | convertfrom-securestring | out-file .\securestring.txt
$password = cat .\securestring.txt | convertto-securestring
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
$page = Invoke-WebRequest -Uri "http://192.168.0.1/Main_DHCPStatus_Content.asp" -Credential $cred
$dhcpList = $page.AllElements | where tagName -eq "textarea" | Select -First 1 -ExpandProperty innerText
$rows = @()
$dhcpList.split("`n")[(1..($dhcpList.split("`n").Length-1))] | % {
$row = $_.split(" ",[StringSplitOptions]'RemoveEmptyEntries')
[PSCustomObject]@{
You can’t perform that action at this time.