Skip to content

Instantly share code, notes, and snippets.


Gregory Brewster dot1q

View GitHub Profile
View react-sign-code
import React from 'react';
import { Link } from 'react-router-dom';
import { Button, Row, Col, Form, Card, Spinner, Container, Table } from 'react-bootstrap';
import AlarmAlert from '../common/alerts';
import { httpRequest } from '../../js/common';
class HomeSignUpdate extends React.Component {
constructor(props) {
this.mounted = false;
View sign-express-example
// include dependencies
import express from 'express';
import bodyParser from 'body-parser';
import fallback from 'express-history-api-fallback';
import path from 'path';
import Sign from './sign';
const app = express();
const sign = new Sign();
View screen-sign-class
import SerialPort from 'serialport';
class Sign {
static hexEncode(string) {
const result = [];
for (let i = 0; i < string.length; i++) {
const hex = string.charCodeAt(i).toString(16);
result.push(('00x' + hex).slice(-4));
return result;
View hurr durr powershell folder redirect no worky!
Script to reset user folder permissions.
Uses: icacls.exe and takeown.exe
Tested on Server 2008 R2 X64
For all folders in base folder:
1. Recursively resets owner to Administrators
2. Reset folder to inherit permissions and apply to subfolders/files, clearing any existing perms
3. Add user (based on folder name) with full control and apply to subfolders/files
4. Recursivley reset owener to user (based on folder name)
dot1q /
Last active February 22, 2019 12:48
Telnet into CMS, Connect to E7(or other device) stack and open the remote timer on an ONT
set ont [lindex $argv 0]
# Arg is the ONT Profile number
set timeout 20
spawn telnet 9199
#The script expects login
expect ">"
dot1q / gist:1d2df9750fb506844629
Last active September 29, 2015 18:37 — forked from johnmorris/gist:8135167
A simple database class using mysqli prepared statements in PHP.
View gist:1d2df9750fb506844629
* Make sure the class only exists once
if ( !class_exists( 'DB' ) ) {
* Class for mysql