Skip to content

Instantly share code, notes, and snippets.

View beeradmoore's full-sized avatar

Brad beeradmoore

View GitHub Profile
@beeradmoore
beeradmoore / murmur
Last active December 19, 2015 17:38
Murmur static script to be in /etc/init.d/murmur
#!/bin/bash
#
# description: Murmur Service Start Script
# Ronny Chilinski (its-rc.de), Mai 2008
# Start the service Murmur
start() {
echo -n $"Starting Murmur server "
/home/murmur/murmur-static_x86-1.2.4/murmur.x86 -ini /home/murmur/murmur-static_x86-1.2.4/murmur.ini
@beeradmoore
beeradmoore / gist:11142147
Created April 21, 2014 13:04
Sample of UIPickerController and ALAssetsLibrary
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.AssetsLibrary;
namespace ImagePickerSample
{
[Register("AppDelegate")]
@beeradmoore
beeradmoore / gist:bf43c95e81686e36c7a1
Created May 28, 2014 10:26
General use function to detect flash with Xamarin.Android
public bool HasFlash()
{
if (_camera == null)
{
return false;
}
bool hasFlash = MyMainActivity.PackageManager.HasSystemFeature(Android.Content.PM.PackageManager.FeatureCameraFlash);
if (hasFlash)
return true;
@beeradmoore
beeradmoore / gist:c49584a1ea45ad2583d5
Created May 29, 2014 07:25
Facebook - Invite all (for Pages)
// 1. Bookmark whatever page you are currently on. Best to bookmark it into your bookmark toolbar below your address bar.
// 2. Right mouse click and click edit on your new bookmark.
// 3. For name, enter something like, invite all
// 4. For URL input the following code. (will explain lower what it actually does if you want)
javascript:var inputs = document.getElementsByClassName('uiButton _1sm');for(var i=0; i<inputs.length;i++) {inputs[i].click();}
// 5. Go to your page you want to invite people to.
// 6. On the right where you can invite people click the "See All" button.
// 7. In the popup that comes up, scroll to the bottom. More contacts will load. Keep scrolling until it wont load any more.
// 8. Click your saved bookmark and wait. As you scroll the page you can see loading wheels on the right, and then when invites are sent it'll say "invite sent" below their name.
#!/bin/sh
CORES=$1
HT=""
if [ -n "$2" ]; then
HT="ht"
else
HT=""
fi
@beeradmoore
beeradmoore / install-ffmpeg-amazon-linux.sh
Last active February 7, 2017 20:36 — forked from prashantmaurice/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on gist.github.com/gboudreau/install-ffmpeg-amazon-linux.sh
# and https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@beeradmoore
beeradmoore / web_dev.sh
Created March 28, 2017 22:46
Uses fswatch to watch director for changes, and on change upload files with rsync.
#!/bin/sh
USER="someuser"
SERVER="example.com"
LOCAL_DIR="/Users/ytn3rd/somedir/"
REMOTE_DIR="/var/www/htdocs"
PEM_LOCATION="~/.ssh/some_key.pem"
code $LOCAL_DIR
@beeradmoore
beeradmoore / ec2_availability_zones.json
Created November 1, 2017 11:29
List of all current availability zones.
{"ap-south-1":["ap-south-1a","ap-south-1b"],"eu-west-2":["eu-west-2a","eu-west-2b"],"eu-west-1":["eu-west-1a","eu-west-1b","eu-west-1c"],"ap-northeast-2":["ap-northeast-2a","ap-northeast-2c"],"ap-northeast-1":["ap-northeast-1a","ap-northeast-1c"],"sa-east-1":["sa-east-1a","sa-east-1b","sa-east-1c"],"ca-central-1":["ca-central-1a","ca-central-1b"],"ap-southeast-1":["ap-southeast-1a","ap-southeast-1b"],"ap-southeast-2":["ap-southeast-2a","ap-southeast-2b","ap-southeast-2c"],"eu-central-1":["eu-central-1a","eu-central-1b","eu-central-1c"],"us-east-1":["us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e","us-east-1f"],"us-east-2":["us-east-2a","us-east-2b","us-east-2c"],"us-west-1":["us-west-1a","us-west-1c"],"us-west-2":["us-west-2a","us-west-2b","us-west-2c"]}
#!/bin/sh
# Based on gist.github.com/gboudreau/install-ffmpeg-amazon-linux.sh
# and https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@beeradmoore
beeradmoore / download_latest_minecraft.php
Created April 19, 2019 05:23
Downloads the latest version of Minecraft jars.
<?php
echo "Downloading manifest.\n";
$manifest = json_decode(file_get_contents('https://launchermeta.mojang.com/mc/game/version_manifest.json'), true);
$error = json_last_error();
if ($error != JSON_ERROR_NONE)
{
echo "ERROR: Could not parse manifest json, $error\n";
exit;
}