Blackberry As Modem For Mac


I don’t have time to figure this out completely so I’m just gonna post a link. I’ve been wanting to tether my Blackberry to my Mac (or is it the Mac to the Blackberry?) to access the net but I can’t seem to get a straight answer. According to a pro on the Sprint forums you need your NAI? The phone is company owned so I don’t know how to get this info. But I’d sure like to try. Once again, shamelessly inlining:

To use a Mac with Phone As Modem support, you will need specific information to use the handset as a modem device. Among this criteria is the number to connect to the Sprint Network, and a username / password.

Your username (as provided in the Internet Connection settings through OS X) is your NAI. Your NAI is your Sprint email address for your phone. This is typically username123@sprintpcs.com.

You can find your NAI by going through the settings on your handset. The typical menu path on your Sprint handset to get your NAI is:

1. Settings > Phone Info > My Phone Number (View) > User Name — When selecting User Name, you will be given your NAI. It will follow the name pattern above (usernameXXX@sprintpcs.com) where XXX is a number.

2. You will need the Phone number to connect to. To access the Sprint Network, you will use #777 for the phone number on your phone.

PLEASE NOTE: If you do not have an applicable data plan, you will be charged data usage, so ensure you have an appropriate data plan for your type of use. Also, depending on your market (EVDO, vs Non-EVDO) connections speeds will vary. Instructions for pairing your handset via Bluetooth will be provided in this thread as well. In a situation with a handset like the RAZR2, where a data cable is NOT provided, you can pair wirelessly with your Mac using Bluetooth, eliminating the need for a cable. Bluetooth is standard on all MacBook, Macbook Pro, and the MacBook air laptop. It is also standard on all Intel based Mac Minis and the iMac. The Bluetooth pairing will allow you to not only use the handset as a Phone as modem, but also use iSync to link your Calendars and Contacts with you handset provided you have the appropriate iSync plug-in for your phone.

Blackberry white screen of death


If you own a Blackberry device and you like to play with things, like ringtones or wallpapers, or games, or if you develop software for Blackberry devices like I do then listen up! That’s right, put your ear next to your web browser and listen! There’s a new threat for computer hardware and it effects you Blackberry users. It’s the white screen of death and it manifests as an infinite rebooting sequence. It’s scary as all heck, especially if you’re about to release Beta and have 160 manhours of testing to complete in the next day and a half and a strict policy on company issued Blackberrys that mandate you are not allowed to crack open the casing and tickle the electrons on the circuit board. (I know, what a dumb policy, right?) Here’s the solution I found while frantically scouring the web. The short answer is to use the application loader to perform a device wipe. You have to connect while the thing is on the white screen I think. However I kinda don’t think it matters because my (BB) screen went dark right after I entered my password, leaving me wondering what in the world the application loader was actually connected to since the phone was obviously dead. I would never have figured this out in a million years. I was going about it all wrong. In my dumb brain I thought, “Why not hook up to the backup and restore console in the Desktop manager? Because I wanna restore my Blackberry, right? I’m not trying to load applications, I wanna remove everything and start from scratch!” Well for what it’s worth hook up to the Desktop Manager application loader to fix a constantly rebooting Blackberry.

(Oh and here’s the best part! Right after I finally got it to start the wipe sequence a coworker asked me a question causing me to rotate my chair clockwise while the USB cord was threaded through the armrest resulting in a catastrophy that ended with the yoinking of my device from the desktop hitting the floor, and disconnecting the cable. I’m not sure what this is going to do to the restore because it’s still restoring as I update this post but I’m sure its not a good thing to disconnect the USB cord on an OS restore to an already malfunctioning device. It can’t be much better to rebound said device off of the floor.)

Mime’s the word! Can’t see response data in JMeter…


Quick update here…

I’m struggling with JMeter because I haven’t used it in about 2-3 years and I’m trying to stress test our servlet middleware. For some dumb reason I get successful responses reported in the view results tree in JMeter but the Response Data tab is grey out completely with all of the radio buttons disabled. I poke my buddy for answers and he’s stumped. I post to the mailing list on Nabble and my question gets hung up in the queue because I’m not officially registered on their list server or whatever. I stumble across the answer myself. My server wasn’t setting mime types on the response object. so any time JMeter sees a web response without a mime type it gets all dumb and doesn’t know what to do. I’m not too happy about this behavior but I suppose it’s there for a reason.

Mustang deb file for Ubuntu (Dapper)


I’m in mid process of creating a “.deb” file containing Java 6. Why am I’m blogging about it? Well because it’s been next to impossible to do. I started trying to install Mustang about a month or two ago and I cuoldn’t get it. I posted on Kubuntu forums and got nowhere. The problem is that Java has always been a pain to install on Linux. Why somebody doesn’t rectify that longstanding issues puzzles me to this very day. To start you have to figure out which version of the JDK/JRE you want. (Windows, Linux, Solaris, SPARC, what the hell is a SPARC anyway?) That’s not too bad then you download the package. Debian/Ubuntu purists like myself hate the thought of installing software without a .deb file yet Sun offers no .deb distribution for Java. (They’re very friendly towards Windows and RedHat based distros.) So now you have this dumb self extracting file sitting on your hard drive that your afraid to touch until you can find the magic wand that turns it into that precious .deb you’ve been dreaming about. If you’ve read my blog before you may have seen an old article explaining the proper way to install Java on Debian/Ubuntu systems. That only half applies to the latest release of Java. According to my research (and prior efforts) the make-jpkg scripts will not work with Mustang leaving Debian-based distro users to further stare holes into the section of the screen higlighting a useless bin file. If your smart enough you’ll type make-jpkg mustang into Google and feel rejoiced at the link near the top of the page. (Currently I’m getting connection refused on the link but Google’s cached copy didn’t let me down!) Before you break out the fine wine let me pop your balloon and tell you that the new make-jpkg-mustang script doesn’t work. That’s where I started from this afternoon. Since nobody has been able to help me with an alternate reccomendation I’ve taken matters into my own hands. I rolled up my sleeves, dug into the broken script and patched it as best as I can. After a few iterations of “read script, run, cuss, edit, repeat” I was finally able to generate the “.deb” file I so longed to have stuffed into my distro. I installed my beauty and ran “sudo update alternatives –config java” to adjust my system to the latest and greatest from Sun only to find out in horror that I had in fact installed a JRE not a JDK. As a Java developer a JRE is next to useless to me so again I glared holes into the center of my Konqueror window frame. I was confused! I confirmed that I did in fact download a JDK yet what I had created and installed with the make-jpkg-mustang script was only a JRE!

I’m no Debian developer…
But I have read up on the .deb file format in the past, so I know a little about how it works. After reading the script, shedding a few more random swear words and a few more iterations of the earlier cycle I mustered a deb archive that included the entire JDK. I was happy as … until I re-ran update alternatives. Where the heck was my new JDK? Four more iterations of the cycle that would make Eddie Murphy cover his ears and I think I finally have something. I’m no Debian guru like I said before so my revisions to the script may be flawed or horribly incorrect but now Mustang shows up in update-alternatives as well as in Synaptic. Also, all of the JDK is in there instead of just the JVM. I’m placing my revisions below so you all can cheer, laugh, poke fun at, or rip apart. Hit me up, people…

/usr/bin/make-jpkg-mustang

#!/bin/bash
# make-jpkg-mustang v0.7.5
# Java 1.6 (mustang) JRE binary releases debian package creator
#
# (c)-left by Trevi� - <http://italy.copybase.ch/blog/>
# Released under FSF GPL v2 terms

echo ''
arch="$(dpkg --print-architecture)"
if ( [ -n "$1" ] && [ -f "$1" ] && [ -n "$(file -i "$1" | grep  "application/x-shellscript")" ] ); then    javafile="$(basename "$1")";    javadir="$(dirname "$1")";    if( [ "$javadir" = "." ] ); then       javadir="$PWD"    fi fi
if [ "$arch" = "amd64" ]; then    typestring=" AMD64 " elif [ "$arch" = "i386" ]; then    typestring=" "; else    echo -e "No available Sun's Java package for your arch.\nExiting..."    exit; fi
olddir="$PWD" workingdir="/tmp" cd "$workingdir"
if ( [ ! -d "$workingdir" ] || [ ! -w "$workingdir" ] ); then    echo -n "The standard script working directory ($workingdir) isn't writable, please select another"    if ( [ -w "$HOME" ] ); then       echo " leave this field empty to use your home directory ($HOME)"    fi    read -p "Temporary directory: " newworkingdir    if ( [ "$newworkingdir" = "" ] && [ -w "$HOME" ] ); then       workingdir="$HOME"    elif ( [ -d "$newworkingdir" ] && [ -w "$newworkingdir" ] ); then       workingdir="$newworkingdir"    else       echo -e "You've selected a bad directory!\nExiting...";       exit    fi fi
if [ -z "$javafile" ]; then    downlink=$(wget -q -O - "http://download.java.net/jdk6/binaries/" | grep "Linux${typestring}self-extracting JDK file" -1 | grep "http:\/\/.*jdk-6.*bin.*linux-.*\.bin" | cut -d'"' -f2)        javafile="$(basename "$downlink")"        if [ -n "$downlink" ]; then       echo -e "\nDownloading $javafile in $workingdir...\n"       sleep 3       wget -c "$downlink" -O "$javafile";    else       echo -e "\nJava download link not found; please notify the author at <trevi55@gmail.com>"       cd "$olddir"       exit;    fi    wait    echo -e "\nDownload Complete!" else    echo "Copying $javadir/$javafile to $workingdir"    cp -fu "$javadir/$javafile" $workingdir    wait    echo -e "\nCopy Complete!" fi
echo -e "\nNow will be run '$javafile', you must accept the Sun's Java license to generate your debian package\n\nPress any key to continue"
read -n1
jdkdir="$workingdir/jdk1.6.0"
rm -rf "$jdkdir"
chmod +x "$javafile"; "./$javafile" > /dev/stdout 2>&1 | grep -E -v ' jdk1\.6\.0\/|UnZipSFX'
wait
if [ ! -d "$jdkdir" ]; then    echo -e "The package you've choosen isn't a good Java binary self-extracting JDK package.\nExiting..."    cd "$olddir"    exit; fi
echo -e "\nCreating the debian package directory tree..." pkgdir="$workingdir/sun-java6" exdir="/usr/share/make-jpkg-mustang"
rm -fr "$pkgdir" mkdir -p "$pkgdir/DEBIAN" mkdir -p "$pkgdir/usr/lib/jvm/java-1.6.0-sun" mkdir -p "$pkgdir/usr/share/applications" mkdir -p "$pkgdir/usr/share/pixmaps" mv -f "$jdkdir" "./sun-jdk-1.6.0" mv -f "./sun-jdk-1.6.0" "$pkgdir/usr/lib/" rm -fr "$pkgdir/usr/lib/sun-jdk-1.6.0/jre/.systemPrefs" ln -sf "/usr/lib/sun-jdk-1.6.0/jre/plugin/desktop/sun_java.png" "$pkgdir/usr/share/pixmaps" mv -f "$pkgdir/usr/lib/sun-jdk-1.6.0/jre/bin/java" "$pkgdir/usr/lib/sun-jdk-1.6.0/jre/bin/java-bin" cp -f "$exdir/java.ex" "$pkgdir/usr/lib/sun-jdk-1.6.0/jre/bin/java"
for manfile in $(find "$pkgdir/usr/lib/sun-jdk-1.6.0/jre/man/" -type f); do    if [ ! -f "$pkgdir/usr/lib/sun-jdk-1.6.0/jre/bin/$(basename "$manfile" | cut -d'.' -f1)" ]; then       rm -f "$manfile";    else       gzip "$manfile";    fi done
for item in $(find "$pkgdir/usr/lib/sun-jdk-1.6.0/jre/lib/desktop/" -type d ! -regex '.*Contrast.*'); do    mkdir -p ${item//\/lib\/sun-jdk-1.6.0\/jre\/lib\/desktop//share}; done
for item in $(find "$pkgdir/usr/lib/sun-jdk-1.6.0/jre/lib/desktop/" -type f ! -regex '.*Contrast.*'); do    ln -sf ${item//$pkgdir/} ${item//\/lib\/sun-jdk-1.6.0\/jre\/lib\/desktop//share}; done
echo "Generating debian package control file..." cp -f "$exdir/postinst.ex" "$pkgdir/DEBIAN/postinst" cp -f "$exdir/postrm.ex" "$pkgdir/DEBIAN/postrm"
jreversion="$("$pkgdir/usr/lib/sun-jdk-1.6.0/jre/bin/java" -version > /dev/stdout 2>&1 | grep "build 1.6.0" --max-count=1 | cut -d' ' -f6 | cut -d')' -f1)" packager="$(whoami)" size=$(du -s "$pkgdir/usr" | cut -f1)
cat "$exdir/control.ex" | sed "s/{version}/$(echo "$jreversion")/g" | sed "s/{size}/$size/g" | sed "s/{user}/$packager/g" | sed "s/{arch}/$arch/g"  > "$pkgdir/DEBIAN/control"
# TODO search for new bin to add to postinst/postrm
echo "Calculating md5 sum..." (cd "$pkgdir" >/dev/null ; find . -type f ! -regex '.*/DEBIAN/.*' -printf '%P' | xargs -r0 md5sum > "DEBIAN/md5sums"; cd "$workingdir" > /dev/null) > /dev/null wait
package=$(cat "$pkgdir/DEBIAN/control" | grep "Package:" --max-count=1 |cut -d' ' -f2)   
if [ -w "$olddir" ]; then    debdir="$olddir"; else    debdir="$HOME" fi
debpkg="${package}_$(echo "$jreversion")_${arch}.deb"; echo -e "Building debian package in $debdir/$debpkg..."
fakeroot dpkg-deb --build "$pkgdir" "$debdir/$debpkg" > /dev/null 2>&1 wait
echo "Removing jdk and debian package temporary directory trees..." rm -fr "$pkgdir" "$jdkdir" wait
echo -e "\nDo you want remove temporary binary file \"$workingdir/$javafile\"?" read -p " [Y/n]: " -n1 removefile; if [ "$removefile" = "$(echo Y | tr [:upper:] [:lower:])" ]; then    rm -r "$workingdir/$javafile" fi
echo -e "\n\nPackage done!"
echo -e "\nDo you want to install the $debpkg now?" read -p " [Y/n]: " -n1 installdeb; if [ "$installdeb" = "$(echo Y | tr [:upper:] [:lower:])" ]; then    if [ $(whoami) = "root" ]; then       dpkg -i "$debdir/$debpkg";    else       echo ''       sudo dpkg -i "$debdir/$debpkg";    fi else    echo -e "\n\nYou must install manually the package $debdir/$debpkg" fi
echo -e "\nYou can always check your java version using \"update-alternatives\" and \"java -version\"\n\nScript made by Trevi� <http://italy.copybase.ch/blog>\nSuggestions, bugs and so on... trevi55@gmail.com";
cd "$olddir"

/usr/share/make-jpkg-mustang/postinst.ex

#!/bin/bash

j2se_base="/usr/lib/sun-jdk-1.6.0/jre" priority=3050
# alternative <program> function program_alternative() {     local program="$1"     update-alternatives \    --install "/usr/bin/$program" "$program" \    "$j2se_base/bin/$program" "$priority" \    --slave "/usr/share/man/man1/$program.1.gz" "$program.1.gz" \    "$j2se_base/man/man1/$program.1.gz" }
function select_alternative() {     local program="$1"     update-alternatives --config "$program" }
program_alternative java program_alternative java_vm program_alternative javaws program_alternative jcontrol program_alternative keytool program_alternative orbd program_alternative pack200 program_alternative policytool program_alternative rmid program_alternative rmiregistry program_alternative servertool program_alternative tnameserv program_alternative unpack200
# derive the architecture-specific  # directory for the plugin arch_dir="$(dpkg --print-architecture)"
# assemble the plugin path plugin_dir="$j2se_base/plugin/$arch_dir"
# netscape netscape_dir="/usr/lib/netscape/plugins-libc6" [ -d "$netscape_dir" ] || install -d -m 755 "$netscape_dir" update-alternatives \     --install "$netscape_dir/libjavaplugin.so" \    "netscape-javaplugin.so" \        "$plugin_dir/ns7-gcc29/libjavaplugin.so" "$priority"
# mozilla mozilla_dir="/usr/lib/mozilla/plugins" [ -d "$mozilla_dir" ] || install -d -m 755 "$mozilla_dir" update-alternatives \     --install "$mozilla_dir/libjavaplugin.so" \    "mozilla-javaplugin.so" \        "$plugin_dir/ns7/libjavaplugin_oji.so" "$priority"
# old firefox / swiftfox mozillafirefox_dir="/usr/lib/mozilla-firefox/plugins" [ -d "$mozillafirefox_dir" ] || install -d -m 755 "$mozillafirefox_dir" update-alternatives \     --install "$mozillafirefox_dir/libjavaplugin.so" \    "mozilla-firefox-javaplugin.so" \        "$plugin_dir/ns7/libjavaplugin_oji.so" "$priority"
# firefox firefox_dir="/usr/lib/firefox/plugins" [ -d "$firefox_dir" ] || install -d -m 755 "$firefox_dir" update-alternatives \     --install "$firefox_dir/libjavaplugin.so" \    "firefox-javaplugin.so" \        "$plugin_dir/ns7/libjavaplugin_oji.so" "$priority"
# Remove obsolete javaplugin from users' homes for user in $(ls /home); do     if [ -d "/home/$user/.mozilla/plugins" ]; then       rm -f "/home/$user/.mozilla/plugins/libjavaplugin_oji.so"    fi; done
if [ -d "/root/.mozilla/plugins" ]; then    rm -f "/root/.mozilla/plugins/libjavaplugin_oji.so" fi
# menus if [ -n "$(which update-menus)" ]; then    update-menus; fi
# mime if [ -n "$(which update-mime)" ]; then    update-mime; fi

/usr/share/make-jpkg-mustang/postrm.ex

#!/bin/bash

j2se_base="/usr/lib/sun-jdk-1.6.0/jre"
# alternative <program> function program_alternative() {     local program="$1"     update-alternatives \    --remove "$program" "$j2se_base/bin/$program" }
program_alternative java program_alternative java_vm program_alternative javaws program_alternative jcontrol program_alternative keytool program_alternative orbd program_alternative pack200 program_alternative policytool program_alternative rmid program_alternative rmiregistry program_alternative servertool program_alternative tnameserv program_alternative unpack200
# derive the architecture-specific  # directory for the plugin arch_dir="$(dpkg --print-architecture)"
# assemble the plugin path plugin_dir="$j2se_base/plugin/$arch_dir"
# netscape update-alternatives \     --remove "netscape-javaplugin.so" "$plugin_dir/ns7-gcc29/libjavaplugin.so"
# mozilla update-alternatives \     --remove "mozilla-javaplugin.so" "$plugin_dir/ns7/libjavaplugin_oji.so"
# old firefox / swiftfox update-alternatives \     --remove "mozilla-firefox-javaplugin.so" "$plugin_dir/ns7/libjavaplugin_oji.so"
# firefox update-alternatives \     --remove "firefox-javaplugin.so" "$plugin_dir/ns7/libjavaplugin_oji.so"
# menus #update-menus
# mime update-mime

/usr/share/make-jpkg-mustang/control.ex

Package: sun-java6
Priority: optional
Section: libs
Installed-Size: {size}
Maintainer: {user}
Architecture: {arch}
Version: {version}
Provides: java-virtual-machine, java2-runtime
Depends: libasound2 (>> 1.0.10), libc6 (>= 2.3.4-1), libgcc1 (>= 1:4.0.2), libstdc++5 (>= 1:3.3.4-1), libx11-6, libxext6, libxi6, libxp6, libxtst6
Recommends: gsfonts-x11, make-jpkg-mustang
Suggests: ttf-baekmuk, ttf-kochi-gothic | ttf-kochi-gothic-naga10, ttf-kochi-mincho | ttf-kochi-mincho-naga10, ttf-arphic-bsmi00lp
Description: Sun Java(TM) Runtime Environment (JRE) 1.6.0
 The Sun Java Platform Standard Edition Runtime Environment (JRE) 1.6.0
 contains the Java virtual machine, runtime class libraries, and
 Java application launcher that are necessary to run programs written
 in the Java progamming language. It is not a development environment and
 doesn't contain development tools such as compilers or debuggers.
 .
 Package made using make-jpkg-mustang by Trevi�