Download auto scripts to install Siri Proxy Server

Siri Proxy is a proxy server for Apple’s Siri assistant. The idea is to allow for the creation of custom handlers for different actions. SiriServer was developed by @plamoni and step by step tutorial by iPadsHouse.com this script doesn’t require any special knowledges of Ubuntu. So you’ll be able to install siri server within minutes.

siri server script

DNS Server

Python script Download dns.py or copy and paste everything there into a blank plain-text file and save this file as “dns.py”.

import socket

class DNSQuery:
def __init__(self, data):
self.data=data
self.dominio=''

tipo = (ord(data[2]) >> 3) & 15   # Opcode bits
if tipo == 0:                     # Standard query
ini=12
lon=ord(data[ini])
while lon != 0:
self.dominio+=data[ini+1:ini+lon+1]+'.'
ini+=lon+1
lon=ord(data[ini])

def respuesta(self, ip):
packet=''
if self.dominio:
packet+=self.data[:2] + "\x81\x80"
packet+=self.data[4:6] + self.data[4:6] + '\x00\x00\x00\x00'   # Questions and Answers Counts
packet+=self.data[12:]                                         # Original Domain Name Question
packet+='\xc0\x0c'                                             # Pointer to domain name
packet+='\x00\x01\x00\x01\x00\x00\x00\x3c\x00\x04'             # Response type, ttl and resource data length -> 4 bytes
packet+=str.join('',map(lambda x: chr(int(x)), ip.split('.'))) # 4bytes of IP
return packet

if __name__ == '__main__':
ip='555.555.555.555'
print 'Fake DNS Server:: dom.query. 60 IN A %s' % ip

udps = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
udps.bind(('',53))

try:
while 1:
data, addr = udps.recvfrom(1024)
p=DNSQuery(data)
udps.sendto(p.respuesta(ip), addr)
print 'Antwort: %s -> %s' % (p.dominio, ip)
except KeyboardInterrupt:
print 'Beenden'
udps.close()

2. Siri Server auto install script

This script will install and setup all required software to run Siri Server. Download dependencies.sh or copy and paste everything there into a blank plain-text file and save this file as “dependencies.sh

echo "refreshing apt (just in case)..."
sudo apt-get update
echo "installing required stuff etc..."
sudo apt-get install nano build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion wget
echo "Downloading Ruby 1.9.3"
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
tar xvzf ruby-1.9.3-p0.tar.gz
cd ruby-1.9.3-p0
echo "Installing ruby 1.9.3... [this takes bloody ages :p]"
./configure --prefix=/usr/local --enable-shared --disable-install-doc --with-opt-dir=/usr/local/lib
make
sudo make install
cd ..
echo "Installing required gems..."
wget http://rubyforge.org/frs/download.php/75475/rubygems-1.8.11.tgz
tar xvzf rubygems-1.8.11.tgz
cd rubygems-1.8.11
sudo ruby setup.rb
sudo gem install eventmachine CFPropertyList httparty json uuidtools
echo "done."
echo "Installing required stuff etc..."
git clone git://github.com/plamoni/SiriProxy.git
echo "Enter the SiriProxy directory"
cd SiriProxy
echo "Installing Rake and Bundler"
sudo gem install rake bundler
echo "Installing SiriProxy -- Can take a minute or two"
sudo rake install
echo "Make the .siriproxy directory in my home directory"
mkdir ~/.siriproxy
echo "Copy the example config"
cp ./config.example.yml ~/.siriproxy/config.yml
echo "Generate the certificates"
siriproxy gencerts
echo "Bundle SiriProxy (this installs the plugins and whatnot)"
sudo siriproxy bundle
echo "start the server"
sudo siriproxy server

This will install ruby-1.9.3-p0 together with rubygems-1.8.11, all necessary gems and Rake, Bundler. This script could be run on both 32 and 64 bis Linux.

Tags: ,