Skip to content

Instantly share code, notes, and snippets.

View rdev5's full-sized avatar
💭
Note: This account has been moved to @mattborja

Matt Borja rdev5

💭
Note: This account has been moved to @mattborja
View GitHub Profile
@rdev5
rdev5 / CryptDemo.java
Last active December 28, 2015 22:19
Patch for EncryptedMapDecorator.java (cas-server-extension-clearpass). Returns IV (16 bytes) prepended to ciphertext on encrypt(); mandatory for proper decryption. Useful in clustered environments where IVs saved to thread-safe ConcurrentHashMaps are being stored locally in memory, thus rendering other systems in the cluster unable to decrypt a …
/*
* Licensed to Yavapai College under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Jasig licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a
* copy of the License at the following location:
*
* http://www.apache.org/licenses/LICENSE-2.0
<html>
<head>
<script src="//code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script>
function authenticated() {
var ajax_setup = $.ajaxSetup();
return ajax_setup.headers !== undefined && ajax_setup.headers.Authorization !== undefined && ajax_setup.headers.Authorization !== null;
}
#!/usr/bin/env node
var sys = require('sys');
var exec = require('child_process').exec;
const RSYNC = '/usr/bin/rsync';
const SSH = '/usr/bin/ssh';
const BANDWIDTH_LIMIT = 512; // Kbps
// Backup destinations
var stores = {
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
// See http://arduino.cc/en/Tutorial/CapacitanceMeter
#include <ShiftLCD.h>
#include <stdlib.h>
ShiftLCD lcd(4, 2, 3);
const int DISCHARGE_PIN = 5;
const int CHARGE_PIN = 6;
const int R_VALUE = 100;
void setup()
@rdev5
rdev5 / laravel-scaffolding.sh
Last active January 20, 2016 14:37
Scaffolding shortcuts for Laravel application outlined at https://laravel.com/docs/master/quickstart-intermediate
#!/bin/bash
# author: matt borja
cat "$0"
exit
# setup auth
php artisan migrate
php artisan make:auth
# cleanup "web" middleware
@rdev5
rdev5 / laravel-koding-setup.sh
Last active January 20, 2016 14:39
Laravel installer for Koding.io based on steps outlined at https://laravel.com/docs/5.2#installing-laravel
#!/bin/bash
# author: matt borja
SWAP_SIZE=256
APP_NAME="$1"
INSTALL_PATH="$2"
UPDATE_PACKAGES="$3"
INSTALL_WITH_COMPOSER="$4"
if [ -z "$APP_NAME" ]; then
@rdev5
rdev5 / results.md
Created February 9, 2016 06:55 — forked from endolith/results.md
Randomness testing of Arduino TrueRandom

I ran

cat /dev/urandom >> devurandom.bin

which produced 31 MB of data in a few seconds. To get numbers from the Arduino, I ran:

stty -F /dev/ttyUSB0 cs8 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts
cat /dev/ttyUSB0 >> TrueRandom.bin

which took several days to produce 93 MB of data (rate of about 3.2 kbit/s)

@rdev5
rdev5 / probably_random.ino
Created February 9, 2016 07:01 — forked from endolith/LICENSE.txt
Arduino hardware true random number generator
#include <stdint.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
byte sample = 0;
boolean sample_waiting = false;
byte current_bit = 0;
byte result = 0;
void setup() {
alias gs='git status '
alias gaa='git add --all :/'
alias gcam='git commit -a -m '
alias gl='git log'
alias gp='git push -u origin master'