Skip to content

Instantly share code, notes, and snippets.

View mikew's full-sized avatar

mikew mikew

  • 709scene
  • St. John's, Newfoundland
View GitHub Profile
@mikew
mikew / recipe.sh
Last active December 11, 2015 08:58 — forked from okossuth/mechanize for kivy
#!/bin/bash
VERSION_mechanize=
URL_mechanize=http://pypi.python.org/packages/source/m/mechanize/mechanize-0.2.5.tar.gz
MD5_mechanize=
BUILD_mechanize=$BUILD_PATH/mechanize/$(get_directory $URL_mechanize)
RECIPE_mechanize=$RECIPES_PATH/mechanize
function prebuild_mechanize() {
true
#!/usr/bin/env ruby
require 'rexml/document'
require 'open-uri'
include REXML
USAGE = <<EOS
Usage: #{$0} [movie,show]
Marks all items in a Plex library as watched.
@mikew
mikew / __init__.py
Last active December 14, 2015 02:09
How to get Log, Dict, XML, et al from Plex plugin __init__.py to Shared/Libraries
# Contents/Code/__init__.py
import bridge
import library
to_export = dict(Log = Log, Dict = Dict)
bridge.init(**to_export)
def Start():
library.test()
@mikew
mikew / README.md
Last active December 20, 2015 21:59

Getting Started

curl -Ls https://gist.github.com/mikew/6201414/raw/b3961b77d82e061e0d7dba9f668e8c282bafb0b9/setup-cloud9.sh | bash

This will create a folter at $HOME/plexmediaserver, download the plexmediaserver.rpm for CentOS/x86_64 and extract it.

You will still need the Framework.bundle from an existing Plex Media Server install placed in $HOME/plexmediaserver.

How to backup data from SS Plex

It's an easy process, you just have to copy one folder to any destination of your choosing (ie your Desktop)

Windows

Copy %USER%\AppData\Local\Plex Media Server\Plug-in Support\Data\com.plexapp.plugins.wso\

OS X

#!/bin/sh
# Inspired by user rlively
# http://forums.plexapp.com/index.php/user/82346-rlively/
while true; do
clear
curl -s http://127.0.0.1:32400/video/ssp/downloads | grep options-for-current | sed -n 's/.*title="\([^"]*\).*/\1/p'
sleep 2
done
@mikew
mikew / 00-README.md
Last active December 31, 2015 04:59
Gitlab -> Jenkins

Installation

  • Set JENKINS_USER and JENKINS_TOKEN environment variables

  • Edit mappings.json and add a push hook in Gitlab to http://localhost:5678/push.php

    OR

Simply add a push hook in gitlab to http://localhost:5678/push.php?project=Jenkins+Project&amp;token=ABCDEF

@mikew
mikew / README.md
Last active January 2, 2016 18:59
Of ui-router and controllers

This is really just a shorthand for:

  • Creating an Angular controller using standard object notation.
  • Less repetition, but full support, of dependencies.
  • Support either Controller as resource, or passing it off to a separate view.
  • Creating States for ui-route, with all of the above.

What I like about this combined with ui-route is the pattern for resources:

components = {}
addOne = (name, component) ->
components[name] = component
return
addMany = (obj) ->
addOne name, component for own name, component of obj
@mikew
mikew / 00-README.md
Last active November 23, 2015 16:38
docker-machine create -d vmwarefusion
docker_machine_create_vmwarefusion () {
  name="${1:-test}"
  dir="${HOME}/.docker/machine/machines/${name}"
  vmx="${dir}/${name}.vmx"
  vmrun="/Applications/VMware Fusion.app/Contents/Library/vmrun"

  # Something about the initial run of docker-machine+vmwarefusion needs sudo
  sudo $(which docker-machine) -D create -d vmwarefusion "${name}"