Tag Archive for 'Linux'

Redsn0w, Linux and Jailbreaking iPhones

redsn0w_iPod_d-tI finally got my iPhone jailbroken in linux using VirtualBox and Redsn0w.  I know this isn’t the primary method that people want to use, but it is a step in the right direction.

There is a lot of having to re-connect the device because it will disconnect itself from the virtual machine, but as long as you are paying attention, then you shouldn’t have a problem.

On another note, I haven’t given up on trying to sync the iPhone 3G running the 3.0 firmware with Amarok, but things have been slow.  I started up again, and ran right into the same problem I had last time, where does the FirewireGUID information get saved?  There also seems to be problems with the permissions once logged into the iPhone via ssh.  Hopefully soon I will figure this one out.

Rip DVDs in Linux for your Xbox 360

So I have found many posts out there where everyone can’t seem to find the “easy” or “user friendly” software that makes ripping DVD’s to your computer to stream to 360 via UPnP easy. Hopefully I have the solution that people want. I found that dumping the DVD stream with mplayer and using vlc to convert was the easiest method. I have also been playing with the formats and containers to encode with, and found the one that seems to look the best and still manage to save a little space.

First, simply put your DVD in the drive and use mplayer to dump the stream:

mplayer dvd://1 -dumpstream

If you have an ISO image, then:

mplayer dvd:// -dvd-device DVD.ISO -dumpstream

You should now have “stream.dump” in the folder that your executed the command in.

Next, launch vlc, then click on the “Media” menu option, and select “Convert / Save”.

file-media-convert

Click “Browse” and select a location to save your file.  Save your file as a “.mov” file.

add

Before starting, you will want to create a profile so that you can repeat this easily.  Click the “New Profile” button which looks like a sheet of paper with a star on it. (last button in the Settings block)

convert

In the “Encapsulation” tab, select “MP4/MOV”.

encap

In the “Video codec” tab, check Video, Codec H-264, Bitrate 3200 kb/s, Frame Rate 35 fps.  (I am still tweaking these settings for best quality, so any help would be appreciated).

vcodec

In the “Audio codec” tab, check Audio, Codec MPEG 4 Audio (AAC), Bitrate 256 kb/s, Channels 2, Sample 48000.

acodec

After that, label your profile, save, and start your ripping.  My video files, on average, are about 1.5GB in size.

Any help on fps and bitrates would be appreciated, for me, file size isn’t as much of a problem, I want the best quality.

Xbox 360 Media UPnP Server with uShare

After a little work, I finally got my Xbox 360 to connect with my computer using uShare. uShare allows you to share music, movies and pictures to your Xbox via UPnP. For Gentoo/Funtoo users out there, it is a bit of a pain to get working. First, it isn’t in Gentoo’s official Portage, so you have to get the overlay, and add… for Funtoo users though, the version listed in Portage has problems with the init scripts, so it is better to get the Overlay anyway.

Overlay: http://bugs.gentoo.org/192561

Next, the config files; if you had an old version of uShare, ditch it, and all of it’s config files(/etc/ushare.conf).  I used the following config for /etc/conf.d/ushare … and make sure that you add ‘-c’ in front of the directories you plan on sharing, or uShare wont start up, and wont give you any proper error readout.

# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

# User to run ushare daemon (if none, root will be used)
USHARE_USER=""

# UPNP Friendly Name:
USHARE_NAME="reaper"

# The interface to bind to:
USHARE_IFACE="eth0"

# A List of directories to share, each precieded by '-c':
USHARE_DIRS="-c /home/roberts/media"

# Misc. options, like:
#  -p $port        Use specific port to listen ($port)
#  -x, --xbox        Use XboX 360 compliant profile
#  -d, --dlna        Use DLNA compliant profile (PlayStation3 needs this)
#  -w, --no-web        Disable the control web page (enabled by default)
#  -t, --no-telnet    Disable the telnet control (enabled by default)
USHARE_OPTS="-x -p 49152"

After this, you should be good. Start uShare with ‘/etc/init.d/ushare start’, point your browser to YOUR.IP:49152/web/ushare.html , and you can add more directories to share there.

Overall, the web interface is really bare and has no automatic refresh option, so every time you add files to the share directories, you have to restart the service, or click the refresh button on the web interface, however, it works. The only downfall is that it doesn’t perform transcoding, so you have to make sure you encode your videos in the right format. (I am working on that now, because I can see all of the directories, but the files are the “wrong format”)

Another tip, when trying to connect from the Xbox, make sure that you are in the “Video Library”, “Music Library”, or “Picture Library” and not in the Windows Media Center section. UPnP does not substitute WMC.

Programming Page

I finally knocked the dust off of my C++ book, and started learning C++ again. I can already tell that I forgot almost everything which is crappy, but it seems to be coming back to me quickly. In the mean time, I am going to be keeping track of all of my own code that helps me learn the chapters material. If the code is from the book, then I will not post it, but if it is something that I wrote myself, then I will post it under my ‘Programming’ page.

(0)

My Openbox WM Configuration

I have been trying to find a decent window manager for my laptop that wouldn’t kill my resources, and would still look nice. Originally, I started using fluxbox, but it wasn’t cutting it for me, mainly because it has significant problems with ‘xcompmgr’ and certain programs with transparencies. So I ventured to openbox. At first look, wow, it has no panels, no functional desktop, really, it has nothing, just a simple right click menu for all of your applications. After exploring a little, i came across wbar, tint2, conky & trayer. All which are very useful for the openbox desktop. Below is a screenshot, and additionally, I created a script that will mirror my setup for your desktop. Let me know what you think.

Screenshots:

Download:
Script

Ipod Touch Sync’ed to Amarok in Gentoo

First, as always, I am not responsible for any damages done to your equipment, if you choose to jailbreak and modify your device, that is on you!!

Now, you will need to obtain a version of the 2.x firmware, and your device will need to be jailbroken. After you have jailbroken the device, you need to install ‘OpenSSH’ and ‘Mobile Terminal’ from Cydia or Installer. These allow the obvious, ssh access and a terminal on the device.

On your linux box, you will need Amarok 1.4.10 or before, sadly, Amarok 2.0 will not work yet. You will also need sshfs and fuse.

# echo "media-sound/amarok ipod" /etc/portage/package.use
# emerge sys-fs/fuse sshfs-fuse =media-sound/amarok-1.4.10-r2

Set a static ip address on the device to match your the network your linux box is on.

Now, ssh into the device, the root password is defaulted to alpine.

$ ssh root@192.168.1.110

Edit the /etc/ssh/ssh_config on the device, and add the following lines:

iTouch# nano /etc/ssh/ssh_config
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

Next, you need to generate a ssh key for passwordless login into the device, and copy it to the device.

$ ssh-keygen
$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1.110

Now to make sure that your permissions are set right for passwordless login:

iTouch # cd ~
iTouch # cp .ssh/authorized_keys .ssh/authorized_keys2
iTouch # chmod 755 /var/root
iTouch # chmod 700 /var/root/.ssh
iTouch # chmod 644 /var/root/.ssh/authorized_keys
iTouch # reboot

After your device has rebooted, test your connection to make sure that you can log into your device without a password.

$ ssh root@192.168.1.110

If all is well, mount the device to your desired directory, or you can use ipod-touch-mount or iphone-mount in Ubuntu.

$ mkdir ~/itouch
$ sshfs root@192.168.1.110:/var/mobile/Media ~/itouch

Next, we have to get and set the Firewire GUID:

$ cd ~/itouch/iPod_Control/Device
$ su
# lsusb -v -d 05ac: | grep iSerial | awk '{print $3}' | cut -b1-16 | xargs printf "FirewireGuid: 0x%s\n" > SysInfo

Reboot the device. Now, before we can continue with syncing and adding music to the device, we have to modify the database version. This will allow libgpod to recognize and sync your device to Amarok. Sadly, I haven’t gotten this to work with RhythmBox or Exile.

We are going to log into the device, and edit the checkpoint.xml file…

$ ssh root@192.168.1.110
iTouch # nano /System/Library/Lockdown/Checkpoint.xml

Search for the DBVersion Key, and change the value from 4 to 2.

iTouch # reboot

The last thing we have to do is add your device to Amarok so that it will populate your music and you can sync your device.

  • Launch Amarok, and go to Settings => Configure Amarok…
  • Click the ‘Media Devices’ botton at the bottom
  • Click ‘Add Device…’
  • Select ‘Apple iPod Media Device’
  • Name your Device
  • The mount point should be ‘/home/$USER/itouch’ (unless you are using ipod-touch-mount, then it is /media/ipod)
  • Click Ok, and your are all set. Once you are in Amarok, just go to the devices tab on the bottom left (printed sideways) and click the ‘Connect’ button on your device and your music will populate in that device window. You can drag and drop your music into that device from your Amarok music collection as well.

Removing Empty Sub-folders

(From Old Database) I was messing around with my music collection and found that I had many empty directories and sub-directories and wanted to get rid of them so that it wasn’t false excitement on certain bands. After days of searching, and trying to find a solution (without actually having to manually delete 2000+ directories manually) I found that simple commands help.

#find /path/to/dir -type d -exec rmdir {} \;

Just wanted to paste this so I wouldn’t forget it.