Skip to content

Instantly share code, notes, and snippets.

Avatar
🏜️
🚙🛸🌵🛰

Bret bcomnes

🏜️
🚙🛸🌵🛰
View GitHub Profile
@bcomnes
bcomnes / idb-dat-storage.js
Created Jan 18, 2018 — forked from creationix/idb-dat-storage.js
A simple abstract-random-access implementation using indexed DB that takes advantage of hypercore's behavior or consistent boundaries/offsets.
View idb-dat-storage.js
/* eslint-env browser */
var Buffer = require('buffer').Buffer
var name = 'dat'
function withStore (type, block, callback) {
var req = indexedDB.open(name + '-db', 1)
req.onerror = () => callback(req.error)
req.onupgradeneeded = () => req.result.createObjectStore(name)
req.onsuccess = () => {
View baseline.sh
#!/bin/bash
# assumes a fairly recent Ubuntu - may work on Debian or others but needs testing
# assumes you have your .ssh/config setup to specify a user and key for the host
HOST=$1
ssh root@${HOST} "sed -i .backup -e 's/PermitRootLogin\syes/PermitRootLogin no/' /etc/ssh/sshd_config"
ssh root@${HOST} "sed -i .backup -e 's/#PasswordAuthentication\syes/PasswordAuthentication no/' /etc/ssh/sshd_config"
ssh root@${HOST} "sed -i .backup -e 's/X11Forwarding\syes/X11Forwarding no/' /etc/ssh/sshd_config"
View Folder Preferences
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
View jhwhw.cls
%=====================================================================
% jhwhw.cls
% Provide jhwhw.cls class
%=====================================================================
%=====================================================================
% Identification
%=====================================================================
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{jhwhw}[2009/02/11 Justin Wilson's Homework Class]