Scripts to set up and use your Yubikey with PGP applet to authenticate to a SSH server.
Based on instructions from: http://forum.yubico.com/viewtopic.php?f=26&t=1171
Requires GPGTools on OSX (rather than the homebrew gpg) from: https://gpgtools.org/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Immutable Project-Local Toolchain Setup | |
# Inspired by Python's virtualenv and npm | |
# See http://wp.me/pZZvH-an for more | |
# Run with `source ./armenv.sh` | |
# TODOs: | |
# Add upgrade option | |
# Cleaner toolchain versioning | |
# Detect different toolchain versions and warn if installing new? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
if(!process.argv[3]) { | |
console.log("directory argument required"); | |
process.exit(0); | |
} | |
var dir = process.argv[3]; | |
var files = fs.readdirSync(dir); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Grabs the version from package.json to use in your application | |
var semver = require('semver'); | |
var pkg = require('../package.json'); | |
module.exports = { | |
string: pkg.version, | |
clean: semver.clean(pkg.version), | |
major: semver.major(pkg.version), | |
minor: semver.minor(pkg.version), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var winston = require('winston'); | |
var compressjs = require('compressjs'); | |
var algorithm = compressjs.Bzip2; | |
exports.compressString = function(string) { | |
var bufferedString = new Buffer(string, 'utf8'); | |
var compressedString = algorithm.compressFile(bufferedString); | |
var encodedString = new Buffer(compressedString).toString('base64'); | |
return encodedString; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.compareArrays = function(one, two) { | |
assert.equal(one.length, two.length); | |
for(var i in one) { | |
for(var j in one[i]) { | |
assert.equal(one[i][j], two[i][j]); | |
} | |
for(var j in two[i]) { | |
assert.equal(one[i][j], two[i][j]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var exec = require('child_process').exec; | |
var semver = require('semver'); | |
function update() { | |
var child = exec('git describe --dirty', function (error, stdout, stderr) { | |
exports.string = stdout.replace('\n', '').replace('\r', ''); | |
if(error) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0115", OWNER="USERNAME" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint8_t hex_to_int(uint8_t c) | |
{ | |
if ((c >= 48) && (c <= 57)) { | |
//Numeric data | |
return (c - 48); | |
} else if ((c >= 65) && (c <= 70)) { | |
//Lower case ASCII | |
return (c - 65 + 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v12D1p1F01*", SYMLINK+="hwcdrom", RUN+="/usr/bin/sg_raw /dev/hwcdrom 11 06 20 00 00 00 00 00 01 00" |