Skip to content

Instantly share code, notes, and snippets.

View brock's full-sized avatar
😎

Brock Angelo brock

😎
View GitHub Profile
@brock
brock / README.md
Last active December 24, 2015 01:29
boom gui.

Boom GUI

An AngularJS view of your items stored in boom.

Now with Lazy-Loading of images, thanks to Filip.

This assumes everything you store in boom is an image. One of these days I'll submit a proper pull-request to the boom repo, but not today.

  1. Copy boom.html to your home directory.
  2. Copy the contents of function.sh into your dotfiles, or move to your ~/bin as ~/bin/boomgui and make executable (chmod +x ~/bin/boomgui).
  3. Run boomgui from the command line.
@brock
brock / open-starred-urls.sh
Last active December 21, 2015 15:59
Two files: an applescript that runs a bash script when items are added to a folder. http://wp.me/p2mniA-3Q
#!/bin/bash
# copy this to ~/bin: cp open-starred-urls.sh ~/bin
# make executable: chmod +x ~/bin/open-starred-urls.sh
# http://wp.me/p2mniA-3Q
cd ~/Dropbox/IFTTT/Desktop
for file in *.txt; do
cat $file | xargs open
mv $file archive
done
@brock
brock / README.md
Created August 9, 2013 01:08 — forked from mbbx6spp/README.md

Distributed or Dancer Shell

Similar to ansible command but allows you to use any command that will work in your shell. Not tied to specific configuration management tooling, just SSH and your default shell on remote systems. Just works. I <3 it :)

What does it do?

Runs commands across potentially many machines. Allows you to organize your servers/VMs/instances into groups very easily.

Getting Started

#!/usr/bin/env ruby
#
# [email protected] July 2012
#
# I'm playing around with APIs, and sharing my learnings
# You can follow my trials and tribulations at http://viewyonder.com/apis
#
# This is a simple Ruby script to show how a simple API might work.
# The resource model is just a simple array of a single class - no back-end store (yet)
#
@brock
brock / read_one_bucket.json
Last active December 18, 2015 04:39
Simple AWS IAM Group policy to limit a client to read-only access to a single bucket. They'll be able to see the names of all other buckets, but won't be able to get into them. They will be able to see all folders and files in the bucket.
{
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:ListBucket", "s3:ListAllMyBuckets" ],
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Deny",
"Action": ["s3:ListBucket"],
@brock
brock / restore-java.sh
Created April 25, 2013 17:59
restore java in osx 10.8
#!/bin/bash
sudo mkdir -p /Library/Internet\ Plug-Ins/disabled
sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled
sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws
@brock
brock / rvm-sudo.md
Created March 8, 2013 20:42
What to do when RVM fucks with your sudo PATH

##What to do when RVM fucks with your sudo PATH

echo 'echo $PATH' > path.sh   
bash path.sh
sudo bash path.sh

If you see a difference, look in /etc/sudoers or /etc/sudoers.d/

@brock
brock / vpn.sh
Last active December 10, 2015 14:18
A function to start the OSX VPN from the command line. Just modify "My VPN Name" to the name you have in Network Preferences. Then from the command line run: vpn.
# place this with other bash functions in either ~/.bash_profile or a similar location
vpn () {
/usr/bin/env osascript <<EOF
tell application "System Events"
tell current location of network preferences
set VPN to service "My VPN Name"
if exists VPN then connect VPN
end tell
end tell
@brock
brock / caveatPatchor.js
Created December 9, 2012 18:21
Propane Avatars and HTML5 Audio Support
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@brock
brock / caveatPatchor.js
Created December 9, 2012 18:13
Propane Avatars
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.