Skip to content

Instantly share code, notes, and snippets.

View moos3's full-sized avatar

Richard moos3

  • Boost Insurance
  • Maine, USA
  • X @moos3
View GitHub Profile
@moos3
moos3 / archive-mails
Created December 18, 2013 14:55 — forked from pkern/archive-mails
#!/bin/sh
BASE=$HOME/Maildir
ARCHIVEBASE=$HOME/Maildir/archive.
for folder in `find $BASE -maxdepth 1 -type d \! -regex '.*/archive\..*' \! -name cur \! -name tmp \! -name new`
do
folder=$(basename $folder)
if [ "${folder}" = "Maildir" ]; then folder=INBOX; fi
./cleanup-maildir.py --archive-folder=${ARCHIVEBASE}${folder} --maildir-root=$BASE --folder-prefix= --age=365 -d 1 -k -u -v archive ${folder}
<?php
chdir(__DIR__);
require_once('./vendor/autoload.php');
// Put all Freeswitch functions and Settings here
require_once('./settings.inc');
require_once('./lib/freeswitch_lib.inc');
$app = new \Slim\Slim();
$app->view(new \JsonApiView());
<?php
require_once('./EventSocketLayer.php');
/**
* Create ESL Socket and send command to API
*/
function eslCommand($command) {
$esl = new ESLconnection(FS_ESL_HOST, FS_ESL_PORT, FS_ESL_PASSWORD);
$e = $esl->api($command);
if (is_object($e)) {
return $e->getBody();
#!/usr/local/bin/python
#
# process-rxfax.py - post process incoming fax from freeswitch (spandsp raw .tiff => pdf, then
# emailed)
#
# the script uses the UUID from freeswitch to make a unique filename on the server while receiving,
# then renames the attachment to a friendly name for the emailed user. The script calls tiff2ps
# and ps2pdf to create a PDF from the initial TIFF from spandsp.
#
import sys # import the sys module for argv
@moos3
moos3 / 03_faxes.xml
Last active December 22, 2015 20:09
<include>
<extension name="test_inbound_fax">
<condition field="destination_number" expression="^(?:\+1|1)?(5551237890)$">
<action application="set" data="[email protected]"/>
<action application="set" data="fax_enable_t38_request=true"/>
<action application="set" data="fax_enable_t38=true"/>
<action application="python" data="process-rxfax"/>
<action application="hangup"/>
</condition>
</extension>
#!/usr/bin/env ruby
# Dynamic DNS updater by Andruby for Zerigo
# www.andrewsblog.org
ApiKey = 'myzerigoapikey' # your Zerigo API key
Host = 'test.example.com' # the host you want to dynamically update
User = '[email protected]' # your Zerigo username
NameServer = 'a.ns.zerigo.net' # Zerigo nameserver to query
LastIpTmpFile = '/tmp/dyn_update_last_ip' # a temporary file where we store the last ip adress
require 'Time'
require 'Nokogiri'
#
# svn-to-git
#
# Sync an svn repo to git.
#
# Checks for svn updates. If there are none, does
# nothing. Otherwise, commits & pushes the latest
bash -x powerline.sh right
++ dirname powerline.sh
+ export TMUX_POWERLINE_DIR_HOME=.
+ TMUX_POWERLINE_DIR_HOME=.
+ source ./config/helpers.sh
+ source ./config/paths.sh
++ export TMUX_POWERLINE_DIR_LIB=./lib
++ TMUX_POWERLINE_DIR_LIB=./lib
++ export TMUX_POWERLINE_DIR_SEGMENTS=./segments
++ TMUX_POWERLINE_DIR_SEGMENTS=./segments
# Ring the bell if any background window rang a bell
set -g bell-action any
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal screen-256color
# set -g default-terminal "screen-256color"
#
#set-option -g default-command "reattach-to-user-namespace -l $SHELL -l"
# Keep your finger on ctrl, or don't
@moos3
moos3 / gist:4318717
Created December 17, 2012 14:34
chef-server setup errors
[root@localhost ~]# gem list --local | grep chef
chef (10.16.2)
chef-expander (10.16.2)
chef-server-api (10.16.2)
chef-server-webui (10.16.2)
chef-solr (10.16.2)
[root@localhost ~]# chef-server
Merb root at: /usr/lib64/ruby/gems/1.9.1/gems/chef-server-api-10.16.2
~ No Gemfile found! If you're generating new app with merb-gen this is fine, otherwise run: bundle init to create Gemfile
Loading init file from ./config/init.rb