Skip to content

Instantly share code, notes, and snippets.

@elvisimprsntr
Forked from plamoni/gist:1428474
Created October 14, 2012 21:38
Show Gist options
  • Save elvisimprsntr/3889896 to your computer and use it in GitHub Desktop.
Save elvisimprsntr/3889896 to your computer and use it in GitHub Desktop.
SiriProxy running on a Marvell SheevaPlug computer
# $Header: /root/RCS/siriproxy-sheevaplug.txt,v 1.9 2012/10/31 07:18:22 root Exp $
# $Log: siriproxy-sheevaplug.txt,v $
# Revision 1.9 2012/10/31 07:18:22 root
# removed rvmsudo
#
# Revision 1.8 2012/10/21 01:52:02 root
# added steps to install apache web server
#
# Revision 1.7 2012/10/18 03:33:27 root
# added missing apt-get package and updated steps for libyaml warning message
#
# Revision 1.6 2012/10/16 00:58:10 root
# fixed date comment for ruby p286
#
# Revision 1.5 2012/10/15 23:28:08 root
# updated libyaml reinstall steps
#
# Revision 1.4 2012/10/15 21:20:12 root
# added command to edit the resolv.conf
#
# Revision 1.3 2012/10/15 09:53:18 root
# added RVM path steps
#
# Revision 1.2 2012/10/15 03:17:46 root
# corrected scp command
#
# Revision 1.1 2012/10/15 01:41:31 root
# Initial revision
#
# DESCRIPTION: SiriProxy running on a Marvell SheevaPlug 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 SheevaPlug 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 SheevaPlug at: http://www.globalscaletechnologies.com/p-22-sheevaplug-dev-kit-us.aspx
# Follow instructions to update your SheevaPlug at: http://www.plugcomputer.org/Documentation/howtos/new-plugger-how-to/
# Strongly recommend changing the default ROOT password of the SheevaPlug.
passwd
# Install some basics:
apt-get install samba ssh vim rcs -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 SheevaPlug.
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 SheevaPlug
vim /etc/network/interfaces
# Comment out the DHCP entry. Make the STATIC entry look something like this:
# NOTE: Tweak the address for your SheevaPlug STATIC IP address.
# CAUTION: Make sure to get the syntax exactly correct! Otherwise, you will no longer be able to remotely access the SheevaPlug once rebooted.
auto eth0
iface eth0 inet static
address 192.168.69.95
netmask 255.255.255.0
broadcast 192.168.69.255
network 192.168.69.0
gateway 192.168.69.1
# Reboot the SheevaPlug
reboot
# On the SheevaPlug 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 SheevaPlug 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 SheevaPlug file system from any client.
# In lieu of running DNSMASQ on the SheevaPlug, 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 SheevaPlug.
# NOTE: Tweak the address for your SheevaPlug STATIC IP address.
# Services -> Additional DNSMasq Options
# iOS production Siri server
address=/guzzoni.apple.com/192.168.69.95
# iOS beta Siri server
address=/kryten.apple.com/192.168.69.95
# 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, except for the libreadline version.
apt-get install ruby -y
apt-get install build-essential -y
apt-get install openssl -y
apt-get install libreadline5 -y
apt-get install libreadline5-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-0 -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 SheevaPlug.
# Open a terminal window and use the following commands.
# NOTE: Tweak the address for your SheevaPlug STATIC IP address.
cd ~/Downloads
scp [email protected]:/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