Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@elvisimprsntr
Created November 9, 2012 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elvisimprsntr/4046106 to your computer and use it in GitHub Desktop.
Save elvisimprsntr/4046106 to your computer and use it in GitHub Desktop.
SiriProxy running on a Marvell DreamPlug computer.
# $Header: /root/RCS/siriproxy-dreamplug.txt,v 1.2 2012/08/01 14:03:34 root Exp $
# $Log: siriproxy-dreamplug.txt,v $
# Revision 1.2 2012/08/01 14:03:34 root
# add rvm install step
#
# Revision 1.1 2012/08/01 13:44:56 root
# Initial revision
#
#
# DESCRIPTION: SiriProxy running on a Marvell DreamPlug computer.
# AUTHOR: elvisimprsntr
# CREDITS: This file is derived from plamoni's instructions for getting SiriProxy running on a Ubuntu 11 VM: https://gist.github.com/1428474
# PREREQUISITES: A DreamPlug computer or equivalent device, and a router running www.dd-wrt.com open source firmware.
# ASSUMPTIONS: This instruction assumes the reader already has some basic Linux command line and editor experience and are remotely logging in to the plug computer from a *NIX based computer. It is not a BASH script, but the commands and configuration file syntax are formatted to allow one to cut and paste into a terminal window or editor.
# DISCLAIMER: This was written from notes and memory recall. I have ordered a second plug computer which I will use this procedure to correct any errors.
# Purchase a DreamPlug at: http://www.globalscaletechnologies.com/p-54-dreamplug-devkit.aspx
# Follow instructions to update your DreamPlug at: http://www.plugcomputer.org/Documentation/howtos/new-plugger-how-to/
apt-get update
apt-get dist-upgrade
apt-get autoremove
# Strongly recommend changing the default ROOT password of the DreamPlug.
passwd
# Install some basics:
apt-get install samba ssh vim rcs unzip less -y
# If you want to add or create SiriPorxy plugins that push custom pictures to Siri, then install APACHE
# NOTE: The defaults are fine. Your custom images need to reside in /var/www/
apt-get install apache2 -y
# Find out what address your router assigned to your DreamPlug.
ifconfig
# Edit the network settings to use a STATIC IP address.
# NOTE: To make it easy use the same settings your router assigned to your DreamPlug
vim /etc/network/interfaces
# Comment out the DHCP entry. Make the STATIC entry look something like this:
# NOTE: Tweak the address for your DreamPlug STATIC IP address.
# CAUTION: Make sure to get the syntax exactly correct! Otherwise, you will no longer be able to remotely access the DreamPlug once rebooted.
auto eth0
iface eth0 inet static
address 192.168.69.99
netmask 255.255.255.0
broadcast 192.168.69.255
network 192.168.69.0
gateway 192.168.69.1
# Reboot the DreamPlug
reboot
# On the DreamPlug change the /etc/resolv.conf to use external DNS servers to break the circular Apple Siri server DNS re-direct.
# NOTE: Comment out NAMESERVER entires from your ISP or router internal IP address.
vim /etc/resolv.conf
# Google public DNS servers
nameserver 8.8.8.8
nameserver 8.8.4.4
# Level3 public DNS servers - less hops and shorter ping times
nameserver 209.244.0.3
nameserver 209.244.0.4
# Enable SAMBA support. Tweak the Share Definition section in the /etc/samba/smb.conf file.
# TIP: If you enable RW access you will be able to create folders and write to the DreamPlug from any client. Also make sure to disable GUEST access.
vim /etc/samba/smb.conf
# Add ROOT as a remote user.
# TIP: Use the same password as the root login to eliminate the need to remember another password.
smbpasswd –a root
# Restart SAMBA daemon:
sh /etc/init.d/samba stop
sh /etc/init.d/samba start
# You should now be able to access the DreamPlug file system from any client.
# In lieu of running DNSMASQ on the DreamPlug, I opted to use my router to perform a transparent DNS redirect.
# On a router running www.dd-wrt.com open source firmware, configure a DNS redirect from Apple Siri servers to the STATIC IP address of the DreamPlug.
# NOTE: Tweak the address for your DreamPlug STATIC IP address.
# Services -> Additional DNSMasq Options
# iOS production Siri server
address=/guzzoni.apple.com/192.168.69.99
# iOS beta Siri server
address=/kryten.apple.com/192.168.69.99
# Here are the prerequisite dependancies that need to be installed. I listed them as separate lines to make it easier to add and comment out packages.
# NOTE: This list is basically the same as plamoni's.
apt-get install ruby -y
apt-get install build-essential -y
apt-get install openssl -y
apt-get install libreadline6 -y
apt-get install libreadline6-dev -y
apt-get install curl -y
apt-get install git-core -y
apt-get install zlib1g -y
apt-get install zlib1g-dev -y
apt-get install libssl-dev -y
apt-get install libyaml-dev -y
apt-get install libsqlite3-dev -y
apt-get install sqlite3 -y
apt-get install libxml2-dev -y
apt-get install libxslt-dev -y
apt-get install autoconf -y
apt-get install libc6-dev -y
apt-get install ncurses-dev -y
apt-get install automake -y
apt-get install libtool -y
apt-get install bison -y
apt-get install subversion -y
apt-get install pkg-config -y
# Since I am running SiriProxy on a dedicated plug computer I am not concerned about installing and running everything as ROOT.
# Install RVM - This will take awhile since there are no pre-compiled binaries for ARM processors.
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
# Set RVM path
[[ -s "/etc/profile.d/rvm.sh" ]] && . "/etc/profile.d/rvm.sh"
# Set the RVM path to be set up every time I log in
echo '[[ -s "/etc/profile.d/rvm.sh" ]] && . "/etc/profile.d/rvm.sh" # Load RVM function' >> ~/.bash_profile
# Install RUBY 1.9.3 -- This will take several minutes
rvm install 1.9.3
# Skip this step initially. but if you get error message
# "It seems your ruby installation is missing psych (for YAML output"
# at either the rake install, siriproxy install, or bundle install steps follow tips here:
# http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/
# Then re-install ruby.
rvm reinstall ruby-1.9.3-p286 # current ruby distro as of 2012-10-12
# Use RUBY 1.9.3 as the default (and current) version of ruby
rvm use 1.9.3 --default
# Clone the SiriProxy repo
git clone git://github.com/plamoni/SiriProxy.git
# Enter the SiriProxy directory
cd SiriProxy
# Make the .siriproxy directory in my home directory
mkdir ~/.siriproxy
# Copy the example config
cp ./config.example.yml ~/.siriproxy/config.yml
# Install SiriProxy -- Can take a minute or two
rake install
# Generate the certificates
siriproxy gencerts
# Install the certificate on the iPhone.
# On your *NIX machine use SCP to copy the certificate from the DreamPlug.
# Open a terminal window and use the following commands.
# NOTE: Tweak the address for your DreamPlug STATIC IP address.
cd ~/Downloads
scp root@192.168.69.99:/root/.siriproxy/ca.pem .
# Attach this file to an email account you have access to on your iPhone.
# On the iPhone simply tap the file and follow the prompts to install.
# Bundle SiriProxy (this installs the plugins and whatnot)
siriproxy bundle
bundle install
# Start the server
siriproxy server
@elvisimprsntr
Copy link
Author

Read the following to fix the CFPropertyList crash: plamoni/SiriProxy#389

@elvisimprsntr
Copy link
Author

If you using DHCP and the /etc/resolv.conf is getting overwritten, add the following to the /etc/dhcp/dhclient.conf

supersede domain-name-servers 8.8.8.8, 8.8.4.4;

@elvisimprsntr
Copy link
Author

If you do not see SiriProxy responding check the following:

  1. You need to either configure your router to perform a transparent DNS redirect or install DNSMASQ and make the appropriate tweaks.
  2. Siri is known to leak over the cellular connection even when connected to Wifi. Turn off cellular data. Occasionally I've had to toggle airplane mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment