This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Start Adhearsion in JRuby, while building a pidfile as soon as possible. | |
| def ahnctl_start | |
| shell_command = "#{exec_ahn_async} && #{wait} && #{save_pid}" | |
| %x{shell_command} | |
| end | |
| private | |
| # Run start in the background, since it is not daemonized. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://npmjs.org/install.sh | sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def mongodb_keys(from,to,data) | |
| if data.kind_of? Hash | |
| result = {} | |
| data.each_pair do |k,v| | |
| result[k.to_s.gsub(from, to)] = mongodb_keys(from, to, v) | |
| end | |
| return result | |
| elsif data.kind_of? Array | |
| result = [] | |
| data.each do |v| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. | |
| require 'rubygems' | |
| require 'rails/commands/server' | |
| require 'rack' | |
| require 'webrick' | |
| require 'webrick/https' | |
| module Rails |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: ahn | |
| # Required-Start: ahn daemon | |
| # Required-Stop: ahn daemon | |
| # chkconfig: 2345 91 60 | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Adhearsion daemon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #title : tts.sh | |
| #description : This script will convert text to speech using Google translate API | |
| # and then to Asterisk formats (wav, sln, gsm) | |
| # | |
| #author : Andrius Kairiukstis <k@andrius.mobi> | |
| #date : 26 July 2013 | |
| #version : 0.1 | |
| #usage : bash tts.sh FILENAME VOICE PHRASE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Find next number to send call | |
| def next_number | |
| # first parse CDRs | |
| Cdr.parse | |
| # find number | |
| sql_request = %{campaign_id = ? and | |
| call_state = ? and | |
| number_of_retries < ? and | |
| (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(updated_at)) <= ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # function to generate random password, on input requires an argument - lenght of password | |
| genpasswd() { | |
| local l=$1 | |
| [ "$l" == "" ] && l=20 | |
| tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs | |
| } | |
| # MySQL default root password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| desc "Loads initial data (use once after migration)" | |
| task "db:initialize" do | |
| require './lib/initialize' | |
| require 'fileutils' | |
| # Print out DB log | |
| ActiveRecord::Base.logger = Logger.new(STDOUT) | |
| ActiveRecord::Base.logger.level = Logger::DEBUG | |
| YAML::load_file("#{APP_ROOT}/config/pbxes.yml").each_pair do |name,params| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'monitor' | |
| require 'pp' | |
| require 'timeout' | |
| require 'time' | |
| require 'pp' | |
| require 'rubygems' | |
| require 'AGIServer' |