Skip to content

Instantly share code, notes, and snippets.

View Aldaviva's full-sized avatar
🆒
This user is COOL

Ben Hutchison Aldaviva

🆒
This user is COOL
View GitHub Profile
@Aldaviva
Aldaviva / 1. instructions.md
Last active August 29, 2015 13:56
Flappy Space Program Launch Control
  1. Go to Flappy Space Program
  2. Open Developer Tools (F12)
  3. Paste the contents of launchcontrol.js, below, into the Console tab
  4. When you want to launch a bird, run liftoff() in the Console tab
@Aldaviva
Aldaviva / gitExtensionsToCodeCollaborator.sh
Last active August 29, 2015 14:18
Add a context menu to Git Extensions to create 1-click code reviews in Code Collaborator
#!/bin/bash
CCOLLAB='C:/Program Files/Collaborator Client/ccollab.exe'
COMMIT_HASH=$1
COMMIT_SUMMARY=$2
USERNAME=ben
"$CCOLLAB" --no-browser addgitdiffs new $COMMIT_HASH~1 $COMMIT_HASH
"$CCOLLAB" admin review edit "last" --title "$COMMIT_SUMMARY"
"$CCOLLAB" admin review set-participants "last" --participant author=$USERNAME
@Aldaviva
Aldaviva / createrooms.ps1
Last active August 29, 2015 14:22
Exchange bulk room creation with Blue Jeans Relay integration
$RoomCsv = Import-Csv .\rooms.csv
foreach ($room in $RoomCsv){
Write-Host "Adding $($room.id)..."
New-Mailbox -Name "$($room.name)" -Room -UserPrincipalName "$($room.id)"
Add-MailboxFolderPermission -Identity "$($room.id):\Calendar" -User relay -AccessRights Reviewer
Set-CalendarProcessing -Identity "$($room.id)" -DeleteComments $false -DeleteSubject $false -AddOrganizerToSubject $false -RemovePrivateProperty $false
}
@Aldaviva
Aldaviva / polycom-hdx-http-dial.http
Last active August 29, 2015 14:22
Polycom HDX HTTP dial command
POST http://10.4.9.106:80/a_manualdial.cgi HTTP/1.1
Authorization: Digest username="admin",realm="this web site",nonce="557229f05ac94a2b0",algorithm=MD5,qop=auth,uri="/a_manualdial.cgi",cnonce="bf452e7a",nc=00000001,response="3b496c17c02b965aefc0e874d35b9a17"
Content-Type: application/x-www-form-urlencoded
Connection: close
Content-Length: 50
Host: 10.4.9.106:80
dialnumber=10990.0000%40199.48.152.152&speeds=1472
@Aldaviva
Aldaviva / relay-client-example.py
Created September 30, 2015 22:24
Example of a simple Python client for the Blue Jeans Relay API, including authentication
import getpass
import base64
import requests
print "How Many Endpoints Are In Your Relay Enterprise?\n"
username = raw_input('username: ')
password = getpass.getpass('password: ')
basicAuthValue = base64.standard_b64encode(username + ":" + password)
@Aldaviva
Aldaviva / Description.md
Last active December 16, 2015 07:59
Film Quotation Completion

Given a film, an incomplete quotation from the film, and multiple-choice completions for the quotation, which completion is from the film?

Film: RoboCop
Question: Come quietly or there will be ______.
Possible answers: fisticuffs, a strongly worded letter, trouble, an altercation
Best answer: trouble

Letterboxd poses these questions as captchas for their sign-up flow.

This solution makes unauthenticated requests to Google's Ajax Search service, which is deprecated and throttled, so a real attack would require a different method of scoring results (like a paid API account, a different search engine, or a botnet).

@Aldaviva
Aldaviva / QuotesResource.java
Created September 8, 2013 17:11
JAX-RS API documentation generation from Javadoc using Aldaviva/harbor. Build with "mvn site"
package vc.bjn.quotes.api.resource;
import vc.bjn.quotes.data.entity.Quote;
import vc.bjn.quotes.data.repo.QuotesRepository;
import vc.bjn.quotes.data.repo.Repository;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
@Aldaviva
Aldaviva / Spring environment-aware configuration
Last active December 22, 2015 17:19
How to use environment-specific configuration in Spring, activated with a Java system property: -Denv=dev
As a Java developer, I want to be able to inject configuration properties into my application as simply
and easily as possible. I want these properties to be different depending on which environment (prod
vs. stage vs. dev) the system is running in. I don't want to generate separate, non-portable build
artifacts for each environment, because they will get confused. I don't want to redefine property values
that are the same across different environments (dev should inherit and override prod, not duplicate
prod). I want the default environment to be prod, so any operations person can be completely oblivious to
this system and still get the correct behavior.
In this example, a servlet application connects to a Mongo database. We want the database hostname to be
different depending on the environment; on prod, Mongo is hosted locally, but in dev, Mongo is on a VM
@Aldaviva
Aldaviva / 1.md
Last active July 9, 2016 00:50
Get the Title of a Blue Jeans Meeting

Get the Title of a Blue Jeans Meeting

Inputs

  • (required) Blue Jeans numeric Meeting ID, e.g. 494435558
  • (required for meetings with a passcode) Blue Jeans meeting passcode, can be either the participant passcode or the moderator passcode, e.g. 3691

Outputs

  • Title of the meeting (as set by the owner), e.g. Ben's Meeting
@Aldaviva
Aldaviva / joinmov.bat
Created January 10, 2015 08:21
Join multiple MOV files into a single MP4 without reencoding (useful for video cameras that split files every 4GB)
@echo off
if "%1"=="" (
echo usage example: join.bat video1.mov video2.mov video3.mov
echo this will create joined.mp4 in the same directory
exit /B 1
)
ffmpeg -version >nul 2>&1 || (
echo ffmpeg missing, install from http://ffmpeg.zeranoe.com/builds/