Skip to content

Instantly share code, notes, and snippets.

View AshMartian's full-sized avatar
🌎
Kinder world with code

Ash Martian AshMartian

🌎
Kinder world with code
View GitHub Profile
@AshMartian
AshMartian / sessions to template
Created April 5, 2014 21:15
Separating sessions into an array of objects containing an array and date string.
console.log(this.get('model.content'));
//loop through the sessions
this.get('model.content').forEach(function(session){
if (session.get('isActive')) {
var sessionDate = moment(session.get('sessionStart'));
var formatDay = sessionDate.format("dddd, MMMM Do YYYY");
var shouldAddNewDay = true;
sessions.forEach(function(sessionDay){
if (formatDay === sessionDay.formatDay) {
@AshMartian
AshMartian / Problem with Route
Created April 9, 2014 00:16
Having some issues with Ember data and specific routes
// app/routes/sessions.js
export default Ember.Route.extend({
model: function(){
return this.store.find('formatted-sessions', {event: this.modelFor('event').get('id')});
}
});
// app/models/formatted-sessions.js
@AshMartian
AshMartian / puppet.log
Created July 18, 2016 14:15
Puppet compose logs
Attaching to puppetboard, puppet, puppetdb, postgres, 587a058f241b_587a058f241b_puppetboard
puppetboard | [2016-07-18 14:08:01 +0000] [1] [INFO] Starting gunicorn 19.5.0
puppetboard | [2016-07-18 14:08:01 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
puppetboard | [2016-07-18 14:08:01 +0000] [1] [INFO] Using worker: sync
puppetboard | [2016-07-18 14:08:01 +0000] [9] [INFO] Booting worker with pid: 9
puppetboard | [2016-07-18 14:08:31 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:9)
puppetboard | [2016-07-18 14:08:31 +0000] [9] [INFO] Worker exiting (pid: 9)
puppetboard | [2016-07-18 14:08:31 +0000] [10] [INFO] Booting worker with pid: 10
puppet | Warning: The following options to parse-opts are unrecognized: :flag
postgres | LOG: database system was shut down at 2016-07-18 14:06:38 UTC
@AshMartian
AshMartian / docker-compose.yml
Created July 18, 2016 14:22
Puppet Docker Compose File
puppet:
container_name: puppet
hostname: puppet
image: puppet/puppetserver
ports:
- 0.0.0.0:8140:8140
volumes:
- ./code:/etc/puppetlabs/code/
- ./conf:/etc/puppetlabs/puppet/
environment:
@AshMartian
AshMartian / nagios.log
Created July 18, 2016 16:01
Nagios Logs
[1468857395] Nagios 4.1.1 starting... (PID=7527)
[1468857395] Local time is Mon Jul 18 08:56:35 PDT 2016
[1468857395] LOG VERSION: 2.0
[1468857395] qh: Socket '/var/spool/nagios/cmd/nagios.qh' successfully initialized
[1468857395] qh: core query handler registered
[1468857395] nerd: Channel hostchecks registered successfully
[1468857395] nerd: Channel servicechecks registered successfully
[1468857395] nerd: Channel opathchecks registered successfully
[1468857395] nerd: Fully initialized and ready to rock!
[1468857395] wproc: Successfully registered manager as @wproc with query handler
@AshMartian
AshMartian / nagios.cfg
Last active July 18, 2016 16:49
Nagios config
##############################################################################
#
# NAGIOS.CFG - Sample Main Config File for Nagios 4.0.8
#
# Read the documentation for more information on this configuration
# file. I've provided some comments here, but things may not be so
# clear without further explanation.
#
#
##############################################################################
@AshMartian
AshMartian / attribute-resolver.xml
Created May 5, 2017 15:15
Shibboleth Attribute Resolver
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is an EXAMPLE configuration file. While the configuration
presented in this example file is semi-functional, it isn't very
interesting. It is here only as a starting point for your deployment
process.
Very few attribute definitions and data connectors are demonstrated,
and the data is derived statically from the logged-in username and a
static example connector.
@AshMartian
AshMartian / attribute-filter.xml
Created May 5, 2017 15:16
Shibboleth Attribute Filter
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is an EXAMPLE policy file. While the policy presented in this
example file is illustrative of some simple cases, it relies on the names of
non-existent example services and the example attributes demonstrated in the
default attribute-resolver.xml file.
Deployers should refer to the documentation for a complete list of components
and their options.
-->
@AshMartian
AshMartian / relying-party.xml
Created May 5, 2017 15:19
Shibboleth Relying Party configuration
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
# Create shell script, place ffmpeg / youtube-dl / CocoaDialog in the /Applications/Utilities folder
loggedInUser=$(/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }')
cd /Users/$loggedInUser/Desktop/
DESKTOP="/Users/$loggedInUser/Desktop"
RS=`/Applications/Utilities/CocoaDialog.app/Contents/MacOS/CocoaDialog inputbox --informative-text "Youtube URL" --text "Paste Youtube URL here" --button1 "MP3" --button2 "MP4" --button3 "Close" -title "Youtube Downloader"`
URL=$(echo $RS | cut -c 3-)
ANS=$(echo $RS | cut -c 1-1)