Wednesday, December 29, 2010

Cydia 'unable to parse package file'

Cydia error:

Unable to parse package file /var/lib/apt/lists/cydia.xsellize.com_. _Pacakges.IndexDiff (1)

SSHing into phone and deleting the file fixes it.

Monday, December 27, 2010

Amarok PHP and mYSQL

 <?php  
 //charset=utf-8 makes it so unicode output doesn't get gobbled up by browser  
 header("Content-type: text/html; charset=utf-8");  
 echo '<p>Youri\'s id3v2 script</p>';  
   
   
 //connect to mysql and select amarokdb  
 $link=mysql_connect("localhost", "username", "password") or die(mysql_error());  
 echo "Connected to MySQL<br />";  
 mysql_select_db("amarokdb") or die(mysql_error());  
   
 echo "Connected to Database<br />";  
   
 //this makes the mysql db play well with utf8  
 mysql_set_charset('utf8',$link);  
   
   
 //globally retrieve all variables in the url string  
 $variable = $_GET['what'];  
 $bitratevariable = $_GET['bitrate'];  
 $coversaction = $_GET['coversaction'];  
 $idofartist= $_GET['idofartist'];  
 $artistName= $_GET['artistName'];  
   
   
 //navigation  
 echo "<a href=?what=bg1cd>Look for albums that have a CD num set</a> <br />";  
 echo "<a href=?what=blt128>Look for tracks with bitrate lower than 128kbps</a> <br />";  
 echo "<a href=?what=covers&coversaction=lookup>Look up covers</a> <br />";  
 echo "<a href=?what=nulltracknum>Look for tracks with no tracknumber set</a>";  
 echo '<br/><br/>';  
 echo "Look up bitrates<br />";  
   
 echo "[<a href=?what=bitrate&bitrate=128>128</a>] ";  
 echo "[<a href=?what=bitrate&bitrate=160>160</a>] ";  
 echo "[<a href=?what=bitrate&bitrate=192>192</a>] ";  
 echo "[<a href=?what=bitrate&bitrate=256>256</a>] ";  
 echo "[<a href=?what=bitrate&bitrate=320>320</a>] ";  
 echo '<br/><br/>';  
   
   
   
 //return the artist's name when an artist iD is passed  
 function getArtist($artistnum)  
 {  
      $artist = mysql_query("SELECT * FROM `artists` where `id` = $artistnum");  
      while ($row = mysql_fetch_array($artist))   
      {  
           return $row{'name'};  
      }  
 }  
   
 //returns the album's name when an album id is passed  
 function getAlbum($albumnum)  
 {  
      $album = mysql_query("SELECT * FROM `albums` where `id` = $albumnum");  
      while ($row = mysql_fetch_array($album))   
      {  
           return $row{'name'};  
      }  
        
   
 }  
   
 //this lists all the artists in the database except for various artists  
 function listArtists()  
      {  
   
 //select UNIQUE artist ID's from a join table of artists and album (join by referencing artists id column with albums artist column  
 /*  
 artists      albums      
 ID NAME     NAME      ARTIST  
 88 ARTIST     ALBUM     88  
 */  
   
        $result = mysql_query("select distinct artist from artists join albums on albums.artist=artists.id ORDER BY `artists`.`name`");  
   
   
 //walk through the result and pull artist id and artistname  
      while ($row = mysql_fetch_array($result))   
      {  
 //urlencode for spaces in artists and utf8 artists  
           $artistID = $row{'artist'};  
           $artistNameSQL=getArtist($artistID);  
           echo "<a href=?what=covers&coversaction=getArtistAlbums&idofartist=$artistID&artistName=",  
           urlencode($artistNameSQL),  
           ">$artistNameSQL</a><br />";       
              
   
      }  
      }  
        
        
   
   
 //listallalbums belonging to artist ID when given an artist ID       
 //artistname is passed only for html output  
 function listAlbumsById($idofartist,$artistName)  
      {  
        
        
      $albums = mysql_query("SELECT * FROM `albums` where `artist` = $idofartist" );  
        
           echo "<strong>$artistName</strong><br />";  
           while ($row = mysql_fetch_array($albums))   
           {  
           $album = $row{'name'};  
        
 //amarok stores album covers by getting and md5sum hash of lowercased artist and album  
 //mb_strtolower works on unicode white strtolower doesn't  
           echo "<div style=\"display: inline-block\">";  
           echo "$album<br />";  
           echo "/home/youri/.kde4/share/apps/amarok/albumcovers/large/",md5(mb_strtolower("$artistName$album",'UTF-8')),"<br/>";  
           echo "<img width=500px src=./albumcovers/",md5(mb_strtolower("$artistName$album",'UTF-8')),"><br/>";  
           echo "</div>";  
           }  
        
      }  
   
   
 if ($variable=="bg1cd")  
 {  
      $result = mysql_query("SELECT * FROM `tracks` WHERE `discnumber` IS NOT NULL");  
      while ($row = mysql_fetch_array($result))   
      {  
           $artist = getArtist($row{'artist'});  
           $album = getAlbum($row{'album'});  
           echo "$artist - $album <br />";  
      }  
   
 }  
   
 elseif ($variable=="blt128")  
 {  
        
      $result = mysql_query("SELECT * FROM `tracks` WHERE `bitrate` < 128 ORDER BY `tracks`.`artist` ASC");  
      $num_rows = mysql_num_rows($result);  
   
      echo "$num_rows Tracks<br /><br />";   
        
           while ($row = mysql_fetch_array($result))   
      {  
           $artist = getArtist($row{'artist'});  
           $album = getAlbum($row{'album'});  
           $tracknumber = $row{'tracknumber'};  
           $title = $row{'title'};  
           $bitrate = $row{'bitrate'};  
           echo "$artist - $album - $tracknumber - $title [$bitrate]<br />";  
      }  
 }  
   
 elseif ($variable=="bitrate")  
 {  
   
      $result = mysql_query("SELECT * FROM `tracks` WHERE `bitrate` = $bitratevariable");  
      $num_rows = mysql_num_rows($result);  
        
      $totaltrax = mysql_query("SELECT * FROM `tracks`");  
      $num_rows_total = mysql_num_rows($totaltrax);  
        
      echo "$num_rows Tracks are $bitratevariable kbps ";   
      echo "out of a $num_rows_total total tracks<br />";  
        
      $percentage=($num_rows/$num_rows_total *100);  
        
      echo "Which equals: ";  
      echo number_format($percentage, 1)."%<br/>";  
   
   
 }  
   
 //if covers is called with lookup, list artists  
 //if covers is called with get artistalbums, then get artist's albums  
 elseif ($variable=="covers")  
 {  
   
   
      if ($coversaction == "lookup" )  
      {  
           listArtists();  
      }  
        
      elseif ($coversaction == "getArtistAlbums" )  
       {  
         
        
       listAlbumsById($idofartist,$artistName);  
         
       }  
   
 }  
   
   
   
 elseif ($variable=="nulltracknum")  
 {  
      $result = mysql_query("SELECT * FROM `tracks` where `tracknumber` is null");  
      while ($row = mysql_fetch_array($result))   
      {  
      $artist = getArtist($row{'artist'});  
      $album = getAlbum($row{'album'});  
      $title = $row{'title'};  
      }  
   
 }  
 ?>  

Sunday, December 26, 2010

iPhone 3GS log.

Jailbreak:

3GS 16GB jailbroken with spirit.

Spirit2pwn (old bootroom) -> sn0wbreeze -> 4.1

(Change hosts file/must have shsh for 4.1 saved)


Unlock:

Cydia -> Search -> ultrasn0w -> install


Installous:

Cydia -> Manage -> Edit -> Add -> cydia.hackulo.us
Cydia -> Search -> Installous -> Install


SSH

Change default passwords:

ssh mobile@192.168.1.6 (default passwd: alpine)
passwd
su root
passwd


TomTom

Mount iPhone under gnome, copy and paste tomtom 1.6 ipa onto filesystem.

ssh to phone as root

mv /var/mobile/Media/tomtom1.6.ipa /var/mobile/Documents/Installous/Downloads/

Go to installous and downloads and install ipa.

Favorites/settings restore:

iPhone:/private/var/mobile/Applications/D59505E5-17DF-4B2D-AD2A-73729133B4FC/Documents/USA, Canada, & Mexico mobile$ mv /User/Media/mapsettings.cfg ./


Apps: 

  • Camera Plus Pro
  • Skype
  • Google Voice
  • Calling Card
  • TomTom
  • iWebcamera
  • OPlayer
  • Ustream Broadcaster
  • iSSH
  • iFile
  • Atomic Web

Tweaks:

  • Winterboard
  • Silent Camera Theme
  • Glasklart Classic 4.0
  • SBSettings
  • SBSettings Glasklart theme
  • Glasklart Battery theme 
  • User Wallpaper
  • User Lock Wallpaper
  • Five Icon Dock
  • Volume Boost
  • Make it Mine
  • ISHShit 
  • Typophone 4
  • Metadata removr

Change Calling Card Icon:

Find /var/stash/Themes.ZAZeaY/Glasklart%20Icons.theme/Bundles/com.apple.mobilephone/icon.png

Copy it to /var/stash/Themes.ZAZeaY/Youri's Icons/Icons/Calling Card.png

Settings->Winterboard-> Summer Board mode [ON] and enable "Youri's Icons" theme.

Respring.


Rename Applications

Add cydia source http://cydia.myrepospace.com/Tw1zTiD-Chris2
Install rename II
Respring


LockInfo

Add cydia repo http://www.sinfuliphonerepo.com
Lockinfo

HTC plugin

iAdKiller

Add cydia repo http://cydia.xsellize.com/
Install iAdKiller


Screenshot

Saturday, December 18, 2010

phpMyAdmin collated db in utf8_bin shows hex data instead of UTF8 text

Expanding options and setting 'show binary contents' then pressing 'Go' fixes it.

and $cfg['DisplayBinaryAsHex'] = false;

 in /usr/share/webapps/phpMyAdmin/config.inc.php

Friday, December 17, 2010

CLRF characters in my PKGBUILD!

makepkg
==> ERROR: PKGBUILD contains CRLF characters and cannot be sourced.


Solution:

sed -i 's/^M//' PKGBUILD

[ctrl+v][ctrl+m] for the ^M symbol.

Thursday, December 16, 2010

Control amarok through dbus with SSH.

 The session needs to know $DBUS_SESSION_BUS_ADDRESS, so get that first and then run qdbus.

export DBUS_SESSION_BUS_ADDRESS=`cat /proc/$(pidof kded4)/environ | tr '\0' '\n' | grep DBUS | cut -d '=' -f2-` ; qdbus org.kde.amarok /Player org.freedesktop.MediaPlayer.PlayPause

Friday, December 10, 2010

Xorg wouldn't start with latest updates.

One of these in my Xorg.0.log after upgrading to latest mesa ati-dri and libgl

[    27.289] 0: /usr/bin/X (xorg_backtrace+0x28) [0x49f1a8]
[    27.289] 1: /usr/bin/X (0x400000+0x60239) [0x460239]
[    27.289] 2: /lib/libpthread.so.0 (0x7f42d79da000+0xf1c0) [0x7f42d79e91c0]
[    27.289] Segmentation fault at address (nil)



Removing 'nomodeset' from /boot/grub/menu.lst fixes it.