Skip to content

Instantly share code, notes, and snippets.

Avatar
👀
🤘

Brad Janke bradj

👀
🤘
View GitHub Profile
View gist:129e0671c4a1c94e957313501d7e6072
###
### All VLANs
###
Cisco24#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Gi3/0/3, Gi3/0/4, Gi3/0/5
Gi3/0/6, Gi3/0/7, Gi3/0/8
Gi3/0/9, Gi3/0/10, Gi3/0/11
@bradj
bradj / webserver.py
Last active Oct 25, 2018
Simple test stdlib webserver in py3.6
View webserver.py
import time
from http.server import HTTPServer, BaseHTTPRequestHandler
HOST_NAME = ''
PORT_NUMBER = 8000
HTML_CONTENT = '''
<html><head><title>Title goes here.</title></head>
<body><p>This is a test.</p>
<p>You accessed path: %s</p>
View keybase.md

Keybase proof

I hereby claim:

  • I am bradj on github.
  • I am bradj (https://keybase.io/bradj) on keybase.
  • I have a public key whose fingerprint is E2C4 9CF4 3939 F853 8275 A042 F8E3 C606 D3D1 D359

To claim this, I am signing this object:

@bradj
bradj / base64_encode.js
Created Jul 19, 2016
Encode file to base64 and outputs in console.
View base64_encode.js
const fs = require('fs');
const f = process.argv[2];
fs.access(f, fs.R_OK, (err) => {
if (err) {
kill(`Cannot acces ${f}`);
}
readFile();
@bradj
bradj / Irssi SNS
Created Oct 22, 2013
Publishes to SNS topic with associated message on regex match.
View Irssi SNS
use strict;
use vars qw($VERSION %IRSSI);
use Irssi;
$VERSION = '1.00';
%IRSSI = (
authors => 'Brad Janke',
contact => 'brad.janke@gmail.com',
name => 'Irssns',
description => 'Sends SNS On Regex',
@bradj
bradj / Haar1d
Created Oct 22, 2013
Haar Wavelet Transform
View Haar1d
class Haar1D(object):
def transform(self, data, L):
ls = []
level = 0
length = len(data)
while level < L:
elements = length * pow(2, -level)
data = self.getsequence(data, elements)
@bradj
bradj / node-aws-dynamodb
Created Dec 19, 2012
Node.js AWS DynamoDB scan example
View node-aws-dynamodb
var express = require('express');
var aws = require('aws-sdk');
var config = require('./config.js');
aws.config.update({accessKeyId: config.key, secretAccessKey: config.secret});
aws.config.update({region: 'us-east-1'});
var app = express();
app.configure(function(){
View gist:4179157
$.ajax({
url: that.config.mapserver + '?f=json',
dataType: 'jsonp',
}).done(function(evt, status) {
console.log(evt);
console.log(status);
}).error(function(evt) {
console.log(evt);
});