Skip to content

Instantly share code, notes, and snippets.

@ergosteur
ergosteur / yamaha-scr0_unlocked.js
Created January 28, 2021 17:27
replacement scr0.js to unlock web UI controls on Yamaha receivers
var g_Backup_FileName="avr2012_backup.dat";var g_RecoveryStatus=false;function onControlMain(){g_Zone=0;changeDisplay();onBtnReload();}
function onControlZone2(){g_Zone=1;changeDisplay();onBtnReload();}
function onControlZone3(){g_Zone=2;changeDisplay();onBtnReload();}
function onControlZone4(){g_Zone=3;changeDisplay();onBtnReload();}
function onBtnPartyMode(){g_Info.m_partyMode=g_Info.m_partyMode?0:1;ajxSetPartyMode(g_Info.m_partyMode);}
function onBtnVolumeMute(zone,l_OnOff){ajxSetMute(zone,l_OnOff);}
function onBtnAllOn(){allpwronoff(1);ajxSetAllPower(1);}
function onBtnAllOff(){allpwronoff(0);ajxSetAllPower(0);}
function onZonePowerOnOff(zone,l_OnOff){g_Info.m_onZonePowerOnOff(zone,l_OnOff);ajxSetZonePower(zone,l_OnOff);}
function onSleep(time,zone){ajxSetSleep(zone,time);}
# Source: https://activedirectorypro.com/how-to-get-ad-users-password-expiration-date/
$cred = Get-Credential
Get-ADUser -server domaincontroller.domain -credential $cred -filter {Description -like "SRI*" -and Enabled -eq $True -and PasswordNeverExpires -eq $False} -Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed" |
Select-Object -Property "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}
@ergosteur
ergosteur / btrfs-create-subvol.sh
Created December 10, 2019 17:29
script to create subvolumes for unraid shares to allow snapshotting
#!/bin/bash
# create subvolumes for shares on unraid to allow btrfs snapshots
# reference https://forums.unraid.net/topic/73439-btrfs-snapshots/
disknum="3"
sharename="atlantic"
newsubvolpath="/mnt/disk$disknum/$sharename"
# function to check if path is subvol
# ref: https://stackoverflow.com/questions/25908149/how-to-test-if-location-is-a-btrfs-subvolume
is_btrfs_subvolume() {
@ergosteur
ergosteur / twitch-followingsize-userstyle.css
Created September 27, 2019 19:31
shrink the Follow header on new Twitch redesign
@-moz-document url-prefix("https://www.twitch.tv/directory/following") {
h1 {
animation-name: example;
animation-delay: 3s;
animation-duration: 3s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
}
@keyframes example {
@ergosteur
ergosteur / prepare_ubuntu_template.sh
Last active October 16, 2018 20:43
Prepare Ubuntu teplate for VMware
#!/bin/bash
#add VMware package keys
#wget http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub -O - | apt-key add -
#wget http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub -O - | apt-key add -
#grab Ubuntu Codename
codename="$(lsb_release -c | awk {'print $2}')"
#add VMware repository to install open-vm-tools-deploypkg
@ergosteur
ergosteur / hotaddcpuram.sh
Created October 16, 2018 18:26
Script to detect hot-plugged CPU and RAM in VM. Tested on Ubuntu 16.04
#!/bin/bash
# Based on script by William Lam - http://engineering.ucsb.edu/~duonglt/vmware/
# Found at http://askubuntu.com/questions/764620/how-do-you-hotplug-enable-new-cpu-and-ram-in-a-virtual-machine
# Bring CPUs online
for CPU in $(ls /sys/devices/system/cpu/ |grep -E '(cpu[0-9])')
do
CPU_DIR="/sys/devices/system/cpu/${CPU}"
echo "Found cpu: \"${CPU_DIR}\" ..."
CPU_STATE_FILE="${CPU_DIR}/online"
@ergosteur
ergosteur / Chromebook-OQRE.ps1
Last active October 11, 2016 16:13
Script to move Chromebooks according to CSV file. Depends on gam.py.
#!/usr/bin/powershell
<#
.SYNOPSIS
.
.DESCRIPTION
.
.PARAMETER FullInventoryCSV
The path to the fully inventory CSV output from GAM.py print cros allfields. CSV must be comma-separated.
.PARAMETER LocalInventoryCSV
The path to the local school inventory CSV as prepared by the tech.