Skip to content

Instantly share code, notes, and snippets.

View dot1q's full-sized avatar

Gregory Brewster dot1q

View GitHub Profile
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) {
super(props);
this.mounted = false;
// 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();
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;
<#
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
dot1q / telnet-cms-e7-remote-timer.sh
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
#!/usr/bin/expect
set ont [lindex $argv 0]
# Arg is the ONT Profile number
set timeout 20
spawn telnet 10.10.10.10 9199
#The script expects login
expect ">"
@dot1q
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.
<?php
/*
* Make sure the class only exists once
*/
if ( !class_exists( 'DB' ) ) {
/**
* Class for mysql
*/