Skip to content

Instantly share code, notes, and snippets.

View lxcodes's full-sized avatar

Alexander lxcodes

  • fh group
  • Erie, PA
View GitHub Profile
#!/bin/bash
# This script is used by Icinga to post alerts into a Slack channel
# using the Incoming WebHooks integration. Create the channel, botname
# and integration first and then add this notification script in your
# Icinga configuration.
#
# All variables that start with NAGIOS_ are provided by Icinga as
# environment variables when an notification is generated.
# A list of the env variables is available here:
@stevewithington
stevewithington / muraLogoutHandler.cfm
Created May 22, 2014 20:16
Mura CMS : Redirect user after logout
<cfscript>
public any function standardPostLogoutHandler($, event) {
// you could redirect the user to any url you want here
location(url=arguments.$.createHREF(filename='about'), addtoken=false);
}
</cfscript>
@bmannix
bmannix / auto_rebuild.tcl
Last active January 12, 2018 05:10
Ansible driven expect script
#!/usr/bin/expect
set timeout 30
#setup some abitrary commands
set cmdstr(0) "cd /opt/obb/server"
set cmdstr(1) ". build/setup"
set cmdstr(2) "rebuild_db"
spawn /bin/bash
#send the first command
send "$cmdstr(0)\n"
#wait for a prompt to appear
@stevewithington
stevewithington / muraAnnounceEvent.cfm
Last active April 27, 2018 19:20
Mura CMS : Announce an Event From a Form
<!--- 1) Create a form with a hidden form field like shown below, and place it in a layout template, or in a display object, etc. --->
<form method="post">
<input type="text" name="myField" value="Some Value">
<input type="hidden" name="myFormIsSubmitted" value="true">
<input type="submit">
</form>
<cfscript>
// 2) In the eventHandler.cfc (Site, Theme, Plugin, or other custom handler) you could listen for the even in one of Mura's eventHandlers such as 'onRenderStart'
public any function onRenderStart(event, m){
@stevewithington
stevewithington / config.xml.cfm
Last active December 14, 2023 10:10
Mura CMS : Example of how to create a Frequently Asked Questions (FAQ) area/section with Mura CMS and Bootstrap3 markup.
<!--
1) Drop this in your theme /{SiteID}/includes/themes/{Theme}/config.xml.cfm
-->
<theme>
<extensions>
<extension type="Folder" subType="FAQ" availableSubTypes="Page/Question" iconClass="icon-question-sign">
</extension>
<extension type="Page" subType="Question" iconClass="icon-question" hasSummary="0" hasBody="0" hasAssocFile="0">
</extension>
@stevewithington
stevewithington / muraUserBeans.cfm
Created March 10, 2014 16:05
Mura CMS: These are examples of how to register an event handler/listener for when a user is being saved or updated, and then access the old user bean along with the new user bean.
<cfscript>
// Place these methods in your Site, Theme, or Plugin's eventHandler.cfc
public any function onBeforeUserSave($) {
var newUserBean = arguments.$.event('userBean');
var oldUserBean = arguments.$.getBean('user').loadBy(userid=arguments.$.event('userid'));
// if you want to stuff the oldUserBean in the event
// $.event('oldUserBean', oldUserBean);
@stevewithington
stevewithington / muraDynamicExtendedAttributes.cfc
Last active April 16, 2017 22:15
Mura CMS : This is an example of how to dynamically populate an extended attribute select menu/selectbox based on a Mura Content Collection / Local Index.
<cfscript>
component extends="mura.cfobject" output="false" {
// Drop the methods below in your theme or site contentRenderer.cfc
// This example assumes you wish to populate the Label with the content Title, and the value stored would be the URL
// With the methods defined below, you should be able to add the following into your extended attribute fields:
// Option List: [mura]$.getSpeakersOptionList()[/mura]
// Option Label List: [mura]$.getSpeakersOptionLabelList()[/mura]
@stevewithington
stevewithington / dsp_sharedLogin.cfm
Created February 14, 2014 16:24
Mura CMS: How to lock down a page/section with a single, shared password. 1) Create a User Group called "Shared User Group" 2) Create a User called "Shared User" and assign that user to the "Shared User Group" ... you could use something like "shareduser" for the username ... just be sure to note the password! 3) Lock down the content node you w…
<!--- drop this file under the theme's display_objects directory --->
<cfoutput>
<form id="login" class="form-horizontal" name="frmLogin" method="post" action="?nocache=1" onsubmit="return validate(this);" novalidate="novalidate" >
<legend>#arguments.$.rbKey('user.pleaselogin')#</legend>
<div class="control-group">
<label class="control-label required" for="txtPassword">#arguments.$.rbKey('user.password')#</label>
<div class="controls">
<input type="password" id="txtPassword" name="password" placeholder="#arguments.$.rbKey('user.password')#" required="true" message="#htmlEditFormat(arguments.$.rbKey('user.passwordrequired'))#" />
<span class="help-inline">#htmlEditFormat($.rbKey('user.required'))#</span>
</div>
@L422Y
L422Y / osx_automount_nfs.md
Last active May 4, 2024 14:26
Automounting NFS share in OS X into /Volumes

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service