Skip to content

Instantly share code, notes, and snippets.

View gbrayut's full-sized avatar
👨‍💻
Living life one byte at a time

Greg Bray gbrayut

👨‍💻
Living life one byte at a time
View GitHub Profile
@gbrayut
gbrayut / ytc.js
Created June 13, 2010 23:14
Chrome Youtube Extension
//Modified version of Youtube Automatic Quality changer that supports:
// Wide-Mode with white background and reset to default when wide-mode is removed
// Full-screen resize with auto-resize on window change
// Quicklist detection and auto-resize using timer
// Disable annotations. Perform manually using: http://www.youtube.com/account#playback/annotations
//Original source: https://chrome.google.com/extensions/detail/hgijgnfdfpfnkfliikinfajhdmphahpj
//Apply changes to "C:\Users\<username>\AppData\Local\Google\Chrome\User Data\Default\Extensions\hgijgnfdfpfnkfliikinfajhdmphahpj\1.31_0\ytc.js"
//TODO:
// Add page action for max video size and channel->standard page link. (see comments page)
// Add support for detecting non-widescreen aspect ratio? (still works resonably well)
using System;
namespace WindowsGame1
{
#if WINDOWS || XBOX || WP7 || ZUNE
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
@gbrayut
gbrayut / Blogger_Mobile_Redirect.js
Created December 20, 2010 23:07
Script used to redirect mobile browsers to Blogger Mobile Template view
<script type='text/javascript'>
//<![CDATA[ Wrap in CDATA to prevent issues with < and & characters in Blogger xml template
//Function to replace or add a parameter to current URL. From: http://stackoverflow.com/questions/486896/
function insertParam(key, value) {
key = escape(key); value = escape(value);
var kvp = document.location.search.substr(1).split('&');
var i = kvp.length; var x; while (i--) {
x = kvp[i].split('=');
@gbrayut
gbrayut / batch.cmd
Created October 29, 2013 01:26 — forked from anonymous/batch.cmd
powershell -file c:\temp\script.ps1 -test:%1
echo %ERRORLEVEL%
@gbrayut
gbrayut / test.cs
Last active December 29, 2015 03:09
void Main()
{
var username = @"ad\u0861240";
var userNameNoDomain = username.Split('\\').Last();
var Context = new System.DirectoryServices.AccountManagement.PrincipalContext( System.DirectoryServices.AccountManagement.ContextType.Domain
,"ad.utah.edu","OU=People,DC=ad,DC=utah,DC=edu",@"","");
var directoryEntry = new DirectoryEntry("LDAP://DC=ad,DC=utah,DC=edu");
var directoryEntryBase = new DirectoryEntry("LDAP://DC=ad,DC=utah,DC=edu");
using (var directorySearcher = new DirectorySearcher(directoryEntry)
@gbrayut
gbrayut / cinst tomboy.log
Created November 26, 2013 05:00
Issue installing tomboy 1.14.0
Chocolatey (v0.9.8.23) is installing 'tomboy' and dependencies. By installing you accept the license for 'tomboy' and ea
ch dependency you are installing.
______ gtksharp v2.12.20.1 ______
Downloading gtksharp 32 bit (http://download.xamarin.com/Installer/gtk-sharp-2.12.20.msi) to C:\Users\a4hdszz\AppData\Lo
cal\Temp\chocolatey\gtksharp\gtksharpInstall.MSI
Installing gtksharp...
Elevating Permissions and running msiexec /i "C:\Users\a4hdszz\AppData\Local\Temp\chocolatey\gtksharp\gtksharpInstall.MS
I" /quiet . This may take awhile, depending on the statements.
gtksharp has been installed.
gtksharp has finished successfully! The chocolatey gods have answered your request!
@gbrayut
gbrayut / keybase.md
Created October 1, 2014 02:29
keybase.md

Keybase proof

I hereby claim:

  • I am gbrayut on github.
  • I am gbrayut (https://keybase.io/gbrayut) on keybase.
  • I have a public key whose fingerprint is A61D 298E 6CE1 3E92 BA44 8319 7044 E401 5F99 8507

To claim this, I am signing this object:

@gbrayut
gbrayut / Get-DscConfigurationStatus
Last active November 22, 2018 22:58
Issues with Missing DSC Schedules Tasks
#Status after configuring LCM and running Update-DscConfiguration
PS C:\windows\system32\Configuration> Get-DscConfigurationStatus
Status StartDate Type Mode RebootRequested NumberOfResources
------ --------- ---- ---- --------------- -----------------
Success 2015/04/17 19:40:47 Initial Pull False 19
#Status after restarting the server
PS C:\windows\system32> Get-DscConfigurationStatus
@gbrayut
gbrayut / hbase-site.xml
Last active August 26, 2015 17:41
HBase setup scripts using Cloudera CDH 5.4.4 on RHEL 6.x
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost/hbase</value>
@gbrayut
gbrayut / Systemd.service
Created December 8, 2015 18:14
Bosun Service files
#Bosun unit file at /etc/systemd/system/bosun.service
[Unit]
Description=Bosun Service
After=network.target
After=docker.service
After=rsyslog.service
[Service]
Type=simple
User=root