Categories
iPhone Linux

How To: Stream Music From The iPhone In Ubuntu

This is the first how-to article that holds your hand step by step to stream music from the iPhone in Ubuntu over Wi-Fi. This will work on other distributions, simply replace apt-get with your package manager of choice.

Requirements:

– 1.02 Firmware iPhone with OpenSSH installed via Installer.app
– Ubuntu, or probably any distribution based on apt-get (such as Debian)
– Wireless Router (ad-hoc connection probably works too, untested)

These instructions were performed on brand new Ubuntu 32-bit installation of Gutsy Gibbon (7.10). They have been found to be complete and accurate. Installing OpenSSH on the iPhone is outlined in other articles available online, simply search for “iPhone jailbreak” and follow instructions, you will need a Windows PC or Mac.

Using two programs called FUSE (Filesystem in Userspace) and sshfs we can mount the iPhone filesystem in Linux, then configure ssh key pairs so we can connect without needing to sudo or login as root every time we want to sync the phone, then we’ll install beta versions of Libgpod and Rythmbox to end up with something insanely great:

screenshot-tokyo-ska-paradise-orchestra-loverswalk.png

1. Installing FUSE and other needed programs.

On your PC, goto Applications, Accessories, Terminal
Search for gstreamer in add/remove programs and add everything with the name starting with gstreamer, including ubuntu restricted extras.

Note: You can copy-paste every command from this article using CTRL+Shift+V.

sudo apt-get install sshfs

Then, add yourself to the fuse group with this command:

sudo adduser wayne fuse [Replace wayne with your username]

Re-authenticate using su - wayne to avoid /dev/fuse errors later on (or reboot). We’ll be leaving this terminal open for the rest of this guide.

2. Setting up Hosts file, Configuring OpenSSH password, and Configuring SSH Key Pairs
This lets you connect to your iPhone without using a password every time.

Turn off auto-lock on your iPhone by going to Settings | General | Auto-Lock | Never

Adding the iPhone to /etc/hosts
Open a terminal, type:

sudo gedit /etc/hosts

Edit the file to look like this, changing 10.0.0.196 to the IP address of your iPhone:

iPhone Host File Setup

You can find the IP address of your iPhone by either by looking in your wireless router configuration page (now would be an excellent time to make it a static DHCP address) or on the phone by going to Settings | Wi-Fi, then tapping the blue arrow next to the access point.

Save and quit gedit, you’ll be back to the terminal.

In the terminal we’ll generate SSH keys and connect to the iPhone

ssh-keygen -t rsa

Should output something like this:

Generating public/private rsa key pair.
Enter file in which to save the key (/home/wayne/.ssh/id_rsa): [ENTER]
Enter passphrase (empty for no passphrase): [ENTER]
Enter same passphrase again: [ENTER]
Your identification has been saved in /home/wayne/.ssh/id_rsa.
Your public key has been saved in /home/wayne/.ssh/id_rsa.pub.
The key fingerprint is:
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx wayne@gutsy
wayne@gutsy:~/Desktop$

4. Logging into the iPhone via SSH, Resetting Passwords, and setting up the iPhone SSH Keys.
ssh root@iphone

Don’t worry, if it takes a long time – the first time you connect, it takes about 30 seconds to generate keys on the iPhone.

wayne@gutsy:~/Desktop$ ssh root@iphone
The authenticity of host 'iphone (10.0.0.196)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'iphone,10.0.0.196' (RSA) to the list of known hosts.

root@iphone's password: dottie [This is the default password]
#

At the # prompt type the following:
passwd root [Type in the new password twice.]
passwd mobile [Type in the new password twice.]

Configure SSH keys on the iPhone.

mkdir ~/.ssh << [Error that it exists is OK.]
chmod go-w / ~
cp /etc/ssh_config /etc/ssh_config.bak
echo AuthorizedKeysFile .ssh/authorized_keys >> /etc/sshd_config
exit

You should see the following output:
Connection to iphone closed.
wayne@gutsy:~$

5. Configure SSH keys on your Linux PC/
scp ~/.ssh/id_rsa.pub root@iphone:.ssh/authorized_keys

You should see something like this:
root@iphone's password: [type the new password you setup here]
id_rsa.pub 100% 393 0.4KB/s 00:00
wayne@gutsy:~$

6. Mount your iPhone using sshfs

sudo mkdir /media/iphone/ -m 777

When running sshfs you may receive errors. Common ones are about /dev/fuse – logout, reauthenticate using su - wayne, or rebooting is a simple solution (although not needed).

sshfs root@iphone:/var/root/Media /media/iphone/
ln -s /media/iphone/iTunes_Control /media/iphone/iPod_Control

7. Install SVN versions of Rhythmbox and Libgpod

Download the debs here. (Thanks funk for packaging these!)
Extract this file with Archive Manager, then double click on each one and install each package.

After installing all of these, when you open up Rhythmbox via Applications | Sound & Video | Rythmbox, your iPhone will magically appear in the devices list, and allow you to stream media via wireless. If it’s not working, make sure that you can still browse to /media/iphone and view files yourself.

To ummount the iPhone:
fusermount -u /media/iphone

To re-mount the iPhone:
sshfs root@iPhone:/var/root/Media /media/iphone/

Did you run into any problems? Comment here and I’ll help you out best I can.

Bonus tip: Mount /var/root/Library/Ringtones instead and load up on ringtones!

Categories
Linux

Giving Away Software For Free Costs More Than You Would Think (Part 3)

For those of you less inclined to surfing all over my website, here’s a quick recap:

Part 1
: Did you know that the Ubuntu software repository contains 23,164 packages? I also introduce the Constructive Cost Model (COCOMO), and finally, reference an article quoting that Debian ‘cost’ 1.9 billion dollars to develop back in year 2000.

Part 2: I detail my plan of attack to find out how much the Ubuntu distribution ‘cost’ to develop using COCOMO and SLOCCount by David Wheeler. Without his excellent program, this article would not be possible.

Downloading the source code took nearly 2 days, due to the nature of apt-get, you must first build dependencies, then download the actual source code. There were some annoying programs that once downloaded, require user input (such as LILO) and that paused the downloading process until I provided some human input.

It took over 8 hours for SLOCCount to process all 51,447 files downloaded, with a 3.2GHz Intel Core 2 Duo processor.

I started this project with a brand new Gutsy Gibbon installation. By the time all was said and done,my hard drive contained 92.8 GB of gzipped source files, patches, graphics, etc – everything needed to build Ubuntu from scratch- and installed nearly 10 GB of dependencies.

Categories
Linux

I Am Ubuntu User #17716

I just recently found The Ubuntu Counter project which has lofty aims of counting Ubuntu users. Fun in theory, but there is no way that every user will ever login to a webpage to register their machine.

A better way would be to integrate it into the Ubuntu Forums – I’m number 396,365 there. 🙂

Here’s my super sweet button:

The Ubuntu Counter Project - user number # 17716

There’s also the Linux Counter project, and I just registered there also.

Categories
Linux

Giving Away Software For Free Costs More Than You Would Think (Part 2)

Starting with Part 1 of this series, I introduced the idea that free software is expensive to give away.

For example, in 2000, the Debian distribution would have cost nearly 1.9 billion dollars to re-write from the ground up.

It’s been almost 8 years since that report was generated, and Debian has somewhat faded from the limelight. Ubuntu has taken the lead as the most-used desktop Linux distribution since then, and I would like to roughly calculate how much Ubuntu costs to give away for no charge.

I will outline and detail my method and solution to this question in 8 steps:

Categories
Linux

Giving Away Software For Free Costs More Than You Would Think (Part 1)

Little known fact: The Ubuntu distribution is now includes 23,164 packages.

How much did all of these packages actually cost to make? Well thanks to the Constructive Cost Model, (COCOMO) we can find out. COCOMO estimates how much it costs to write x number of lines of code, based on complexity of the project as well as how collaboration takes place (ie over the internet vs in an office), and many other factors. Then you get a ballpark figure of how much the software cost to develop.

Categories
Linux

I Don’t Think We’re In Kansas Anymore: How-To Install KDE 4 Beta 2 on Ubuntu Gutsy Gibbon Beta 7.10!

Caution: As with any beta software, things can go wrong. I’m doing something that shouldn’t be done by mere mortals, all for the sake of experimentation. And for posterity, I did screw this up once. But I was able to recover from text mode console and resume. I’ve ommited those steps. 🙂

Categories
iPhone Linux

How To Mount Your iPhone Filesystem On Your Desktop In Ubuntu

Ever want to browse your iPhones’ filesystem on your Ubuntu machine? Follow these instructions and you’ll have it working in no time flat.

This article assumes your iPhone is “out of jail” and has Installer.app installed. If you have not already gotten this part taken care of, click here for steps you need to follow first.

  1. Install SSH on your phone by the following proceedure:
  2. Tap the Installer on your home screen.
  3. Install the following utilities:
    • Community Sources
    • BSD Subsystem
    • OpenSSH
  4. Once your iPhone has these installed, find your IP address by going into Settings, Wi-Fi and then click the blue arrow next to the network your iPhone and your Ubuntu machine are on.
  5. Turn off Auto-Lock on your iPhone, which will interrupt the OpenSSH server by going into Settings, General and Auto-Lock. Set Auto-Lock to never.
  6. Now, on your Ubuntu machine, simply click on Places, Connect to Server and follow these screenshots:
  7. Connect to iPhone via SSH
  8. Connect to iPhone via SSH
  9. Connect to iPhone via SSH
  10. Type the default password for root – “dottie”
  11. Connect to iPhone via SSH

Bam! You’re in! Now upload ringtones, compile hello world, slice dice and serve http via apache – whatever floats your dingy.

If you aren’t running Ubuntu, it’s time to upgrade. Just kidding. On any other Linux system this is probably going to be as easy (I hope) or gentoo-style (aka difficult and useless frustration). Two utilities you might need are FUSE and SSHFS if you’re going the frustrating route.

Thanks for reading, I’ll be writing about how to get the iPhone talking with Amarok and how to get ringtones uploaded very soon.

Categories
Linux

Ubuntu Forums Firefox Plugin – Finding Answers To Stupid Questions Was Never So Easy

Attention Humor Disabled Digg Visitors, the tagline of this article is actually a joke!  HDDV is a serious disease which effects approximately 23 million Digg front page visitors per month.

I remembered awhile back that I had installed a plugin for the Steam forums that gave me a little menu item up at the top inbetween Tools and Help in Firefox that allowed easy navigation of the Steam forums. I thought about it for a bit and thought,

“Hey! Why not make one of those for the Ubuntu forums?”

Well thankfully someone else already has. I present to you, the Ubuntu Forums Menu for Firefox.  If you don’t have Firefox already, click the button below and install it today!

Install and then goto the Addons settings in Firefox. Click Preferences:
screenshot-add-ons.pngCheck the appropriate boxes:
screenshot-ubuntu-forums-menu-settings.pngMenu at the top:
ubuntu_forums.pngRight Click Context Menu:
ubuntu_forums_context1.pngThis is an “insanely great” plugin. Kudos to Adam Smith.

Categories
Linux Rant

Trying out Gutsy Gibbon Part 2

I ran the following commands (again)

sudo sed -e ‘s/\sfeisty/ gutsy/g’ -i /etc/apt/sources.list
sudo apt-get update
sudo apt-get dist-upgrade

12:12 AM Started downloading.

12:30 Installing all the packages.  Downloading from the Gutsy repositories at 6MB/sec didn’t take a long time.

12:42AM I’m concurrently downloading Linux Mint while all the packages continue to install.

12:46AM DONE.  Reboot.

2:45AM Ohsh!t… Houston we have a problem.  I’m gonna rant here for a second.  When I use the brand new awesome thing that smells of a combination of fresh horse manure and burning hair called “Screens and Graphics Preferences” and I select my monitor as shown:

screenshot-choose-screen.png

Notice the little description text that shows that I’m choosing an LCD screen that ONLY displays in a native resolution of  1680 by 1050?

Now, see the list of available resolutions once I save that setting:

showmetheresultion.png

Where the hell is the 1680 by 1050 option?  NOT THERE!

Now, I know somebody is going to say ‘oh well just go and edit the xorg.conf file and you should be all set.’  Here is my preemptive response:

When is the last time you had to edit the registry in Windows to add a resolution option?

I rest my case.

Categories
Linux

Five Reasons Why Using Firefox On Windows Will Help You (Or Your Company) Migrate To Linux

Firefox has been my browser of choice for several years, and prior to that, I first came in contact with the technology that runs behind the browser, called the Gecko Renderer in early 1998. The thing that impressed me the most back then was how much FASTER the Gecko engine rendered pages as compared to Internet Explorer on a dial-up connection.

Here’s a short list of reasons why Firefox will help you if you ever decide to try out or switch to Linux (or Mac OSX for that matter).

  1. Firefox runs on Windows and all popular operating systems.
    Whether you prefer Windows, Mac, Linux, whatever, your favorite flavor of O/S, Firefox runs on it.
  2. The interface is the largely the same on Linux and Windows.
    The default interface and theme for Firefox is exactly the same no matter what O/S you are using.
    For me, the biggest change was where the Preferences item was displayed. Using the Menu Editor plugin for Firefox allows you to move around menu items, or hide them completely. I have found this HUGELY helpful for my own migration to Linux, as Preferences is located in the “Edit” menu at the top of the screen, as opposed to the Windows version of Firefox that actually has the Preferences menu located until “Tools.” Just install the plugin and move it easily.
  3. If you feel comfortable browsing the web, that’s a big step towards being familiar with the computer as a whole.
    Many time, when I have a problem or something I want to do in Linux and I don’t know how, I google for it. Using a browser like Firefox that has a standard interface among all operating systems, lets me feel comfortable while I’m searching on a topic that I am unfamiliar with.
  4. Add-ons that you enjoy in Windows are also available for Linux.
    One of the biggest reasons I like Firefox is because of the practical unlimited amount of Add-ons written for it.
    Do you want the weather in your taskbar? Done. Do you want a music player controller embedded in the browser so you don’t have to alt-tab to skip a song? Done! If you can dream it up, it’s probably already there.
    They function exactly the same way in Windows and in Linux, because they’re built on a framework that integrates with Firefox.
    Some of my favorites include: StumbleUpon, Adblock Plus, IE Tab (when using Windows), and DownloadStatusbar, Menu Editor and Stop-or-Reload Button
  5. Firefox is accepted as the most popular browser for users on any distribution of Linux.
    Firefox is bundled by default on the following distributions: Ubuntu (and it’s derevitives), Fedora, openSUSE, Mandriva, PCLinuxOS, SimplyMEPIS, CentOS, etc. Most Linux Distributions also make it easy to get and install Firefox if it is not installed by default.

If you don’t think these reasons are enough, humor me and try it out. I bet you’ll love the tabbed browsing and lack of advertisements when using Adblock Plus, which gets rid of nearly all ads out there. It’s terrific and no more annoying talking ads!