3G-Modding your eee 1000he hackintosh

As some of you may know I’ve been using snow leopard on my eee 1000he for quite a while(You can still get the modded DSDT I use on my system from my github page)

Here’s a list of items I got myself:

  • a sim card(yeah, you’ll laugh, I actually forgot about this part… :P)
  • a 3G minipci card. i used an Option 378 which is quite cheap. I will explain later… Some people use a sierra wireless mc8775
  • a minipci socket, for example this one from farnell
  • a sim slot 8 pin

I won’t cover the details on soldering the sim and minipci socket as it’s explained on the eeepc user forum

A word of advice before trying to solder the sockets onto the board. You might wanna scrape of the surface of the solder pads on the mainboard first, as that will make it easier for you.

As described on the forum post you’ll need to short the 3.3V line the USB lines and a fourth one for powering up the minipci socket aside from soldering the sim slot.

The images below are a courtesy of dementho from the eee forums:

The real issue arose when I actually tried to initialize the card in MacOS. Turns out the Option cards start in ZeroCD mode and need to be initialized in modem mode prior to be usable. Well, normally you would just install the driver and be done with it but not so with normal unlocked GTM378 cards you buy on ebay.

My GTM378 card came with an old firmware. So the vendor id was 0×5c6(qualcomm) and product id 0×1000, whereas the vendorId should be 0×0af0(Option NV). Naturally the Globesurfer 7.2 osx drivers don’t work with this device. Not even if you hardcode the product and device id into the drivers plists.

The solution is to debrand your GTM378 by finding the superfire firmware of any GTM378 card and patching it to accept your card as target. That is Globesurfer ICON 7.2 and a whole bunch of others. The firmware I have here is 2.5.11hD I think.

Enable logging in the updater:

  8.144: CPagePreparation::Do, Zaltys detected properly
 14.618: CPagePreparation::Do, product:  GlobeSurfer ICON 7.2 E.
 14.618: CPagePreparation::Do, code:  MO0201-10959.
 14.618: CPagePreparation::Do: unsupported card (MO0201-10959).
MO0201-10959 is your target. search for
5400610068006f006d0061
which is essentially Tahoma in hex. The second occurance should lead you to your target. See below:

Open the installer in a hex editor and write your card id in the installer. I uploaded the firmware here. That should allow you to upgrade your card without problems. After that you can download the snow leopard drivers from the ICON 225 support page

Ironically they work fine with the GTM378 and fix a lot of issues the GTM378 and ICON 7.2 drivers have(since they’re essentially the same just newer).

HTH

... as for me, I’m enjoying the 3g mod on my hackintosh!

awesome with gentoo-prefix

I just updated a whole bunch of ebuilds for gentoo-prefix you can find the overlay here.

Just clone it and put it somewhere in your $EPREFIX/usr/local/portage then add that folder to your make.conf

In my case the make.conf looks as follows:

USE="unicode nls ruby perl xterm-color X"
USE="$USE xcb svg"
USE="$USE png jpeg mmx bzip2"
CFLAGS="-O2 -pipe -march=nocona"
CXXFLAGS="${CFLAGS}"
PORTDIR_OVERLAY='/opt/local/gentoo/usr/local/portage/my-overlay'

Then simply doing a:

emerge hsetroot
USE=osx emerge awesome rxvt-unicode

Instead of USE=osx you could also do a:

mkdir -p $EPREFIX/etc/portage/package.use
echo 'x11-terms/rxvt-unicode osx' > $EPREFIX/etc/portage/package.use/rxvt

Anyway, that should be enough to install awesome 3.2.1 and rxvt-unicode with copy&paste support for osx.

gentoo osx

Update: I also forgot to run the emerge -u world after the bootstrap. So you might want to do that yourself.

Update2: if libXt fails to build try

emerge '<automake-1.10'

So, I was growing more and more tired of fink and macports and hoping that there something portage like for osx.

I looked around and found this article on gentoo-macos, which seemed bad. But after a quick visit in the #gentoo irc channel it turned out that gentoo-mac had been merged into gentoo prefix.

There is a nice tutorial on getting gentoo-prefix running on macosx. It’s pretty straightforward…

However, to save you guys some compilation and setup time, I packaged my “somewhat stage3” of the gentoo folder and uploaded it. You can download it here. It contains pretty much the base system and also mysql5, git, svn and git-svn. No ruby but just emerge it as you please.

Extract it and put something along these lines into your shell config:

export EPREFIX="/opt/local/gentoo"
export PATH="$EPREFIX/usr/bin:$EPREFIX/bin:$EPREFIX/tmp/usr/bin:$EPREFIX/tmp/bin:$PATH"

I know /opt/local/gentoo wasn’t such a wise choice but well whatever.

A couple of caveats:

  1. You need to be on leopard with a core2duo with my package
  2. glib doesn’t get paste the automake on my system(which is obviously bad). However, looking into it. UPDATE if it still doesn’t work just emerge gtk-doc-am
  3. Seems like xcb is masked. Will let you know if I find out why UPDATE xcb works fine
  4. pango doesn’t detect Xquartz cairo. Ie. gentoo portage is not as tolerant as macports using pkgconfig files from whereever they’re installed on your system. Don’t get me wrong, this is actually a good thing. I’ll make an ebuild in time I guess. UPDATE no problem either, the pango package was broken, but its fixed now

Another useful link for ‘creating’ your own packages with ecopy is available here. For the tutorial on that page you will also need to install(emerge) the following:

emerge portage-utils
emerge gentoolkit-dev

Oh and… I think it’s already emerge’d in the “stage3” I uploaded…

hope you like it. I know I do.

open urxvt here and open in vim applescript

Update: noticed a little bug in the script, the right way to do it should be this:

    set disp_no to do shell script "disp_no=($( ps -awx | grep -F 'bin/X' | awk '{print $(NF-2)}' | grep -e \":[0-9]\"  )); if [[ -n $disp_no ]];then DISPLAY=${disp_no}.0; else DISPLAY=:0.0; fi;echo $DISPLAY"

if you have tcp forward off, maybe without $NF if it’s enabled but anyway grep -F X11.app won’t work with newer X versions

If you don’t already know I use x11 and a selfcompiled terminal version of vim for all my work. If you’re in OS-X you might still want to run text files in your favorite editor, and have the ability to open the terminal in the current finder version for whatever reason.

I started using Fastscripts Light a long time ago and it’s a pretty nifty little app. The applescript is based a bit on the OpenInTerminal applescript.

However, for some reason when I run the scripts from Fastscripts via hotkey the DISPLAY variable is wrong as follows:

/tmp/launch-9el5tK/:0

I use the following in my shell config files(sorry, it’s not really mine, but I have no idea who I got it from)

# Set the DISPLAY variable -- works for Apple X11 with Fast User Switching

if [[ -z $DISPLAY && -z $SSH_CONNECTION ]]; then
    disp_no=($( ps -awx | grep -F X11.app | awk '{print $NF}' | grep -e ":[0-9]"  ))
    if [[ -n $disp_no ]];then
        export DISPLAY=${disp_no}.0
    else
        export DISPLAY=:0.0
    fi
    echo "DISPLAY has been set to $DISPLAY"
fi

Anyway, the to fix the openinrxvt all you need to do is change it the following way:

    disp_no=($( ps -awx | grep -F X11.app | awk '{print $NF}' | grep -e ":[0-9]"  ))
    if [[ -n $disp_no ]];then
        DISPLAY=${disp_no}.0
    else
        DISPLAY=:0.0
    fi
    echo $DISPLAY

compressed, the Applescript looks as follows:

    set disp_no to do shell script "disp_no=($( ps -awx | grep -F X11.app | awk '{print $NF}' | grep -e \":[0-9]\"  )); if [[ -n $disp_no ]];then DISPLAY=${disp_no}.0; else DISPLAY=:0.0; fi;echo $DISPLAY"

    do shell script "env DISPLAY=" & disp_no & " /opt/local/bin/urxvt -cd '" & the_path & "' &> /dev/null &"
    tell application "X11" to activate

Running vim is pretty much the same except that you will need to compile a console version with the server option, and then run the original instance with—servername VIM (or whatever servername you might want to use).

The relevant launch part of the Applescript looks like this:

    do shell script "env DISPLAY=" & disp_no & " /opt/local/vim/bin/vim --remote \"" & the_path & "\" &> /dev/null &"

You can get the complete openinrxvt script here and the run in vim script here

After you place them into your ~/Library/Scripts/Applications/Finder folder you can use Fastscripts:fastscripts to create Finder specific hotkeys.

You might also be interested in a modified version of the script that uses the client/daemon set up of urxvt, which I talked about earlier.

    do shell script "env RXVT_SOCKET=$HOME/.rxvt_socket DISPLAY=" & disp_no & " /opt/local/bin/urxvtc -cd '" & the_path & "' &> /dev/null &"

cutehg in OSX

UPDATE: murky native osx mercurial client is out

sed -i '' -e 's/port:tk//' /opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/python26/Portfile

sudo port install python26
sudo port install py26-sip

Pyqt4 seemed to have problems with qt4.5 so I installed it with the QT available from the Trolltech website.

wget http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-mac-gpl-4.4.4.tar.gz
tar xzvf PyQt-mac-gpl-4.4.4.tar.gz
cd PyQt-mac-gpl-4.4.4
python2.6 ./configure.py -q /Developer/Tools/Qt/qmake
make install

hg clone http://bitbucket.org/bfrog/cutehg-stable/
cd cutehg-stable
python2.6 setup.py install

After you install everything you might get an annoying bug looking as follows while using the annotate or history command:

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128) pyqt4

checking the python shell gives this:

python2.6
>>> import sys
>>> sys.getdefaultencoding()
'ascii'

This is easily fixed by doing:

echo "import sys
sys.setdefaultencoding('utf-8')" > /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/sitecustomize.py

What i don’t really get is why python won’t just use my LC_LOCALE/ALL but whatever.

HTH

Organizing Entourage in Threads

UPDATE: it’s a lot easier in outlook 2003 since group by conversation actually works as advertised

Everybody knows Outlook and most people know Entourage(the crappy osx version of Outlook). I call them the worst possible way of managing your email.

Why? Because by default the grouped email view does not group them by threads!

I’ve had some lengthy discussions with a good friend of mine I’m working with about he should group his mails by threads. But guess what, turns out I’m wrong. Entourage doesn’t even allow you to do that out of the box. But fear not young padawan there is a way(well at least somewhat …)

Default Entourage looks like this:

After adding a custom sort condition it looks like this:

It’s quite simple:

  • click on the arrange and click on Edit Custom Arrangements…
  • click on New to create a new arrangement
  • Name it threaded view or whatever
  • set group items by: Conversation
  • set sort groups by Received Newest on top
  • set sort items within groups by Conversation Index Newest on top
  • set default display for groups: Collapsed
  • click ok
  • right click on arrange again and select threaded view

The only thing you need to do now is convince your coworkers to set their reply header to not append infinite amounts of AW: in front of their messages since this crappy outlook clone will make a thread for each one of them, meaning that you can actually have a thead with AW: AW: AW: random trash RE: AW: AW: AW: random trash thanks to outlook or outlook express users.

Have fun

A prettier Terminal in OS-X Part 3 (urxvt and screen)

I was a bit annoyed of having to set TERM=xterm-256color. A more or less proper solution can be found on the rxvt-unicode ml from John Eikenberry.

cd ~
infocmp -L rxvt-unicode > rxvt-unicode.terminfo
sed -i '' 's/#256/#32767/' rxvt-unicode.terminfo
sed -i '' 's/#88/#256/' rxvt-unicode.terminfo
if [ ! -e .terminfo ]; then
mkdir .terminfo
fi
tic -o .terminfo/ rxvt-unicode.terminfo
rm rxvt-unicode.terminfo

I’ve also largely assimilated Bart’s configs. You can find them and the screenrc here .

hf

A prettier Terminal in OS-X Part 1 (awesome is awesome!)

o I recently switched over to awesomewm on my desktop because either the desktop wm’s suck(kde,gnome) or fluxbox,fvwm weren’t quite what I needed.

So I went looking for a good terminal that supports 256 colors. There’s mrxvt and whatnot, but again the Probleme with these is that either utf-8 is missing or they’re in some other way ugly, dependency wise or whatever.

Then there’s this nifty term called urxvt(apparently it doesn’t seem to follow ecma-48?). Anyway, I like it and although iTerm does support 256 colors, it’s rather slow imho.

The end result could look like this…

The dependencies I used for installing awesome look as follows:

  • pango
  • imlib2
  • libconfuse
  • XQuartz (2.3.2.1 at the time of this writing)

If you use macports 1.5 and XQuartz 2.3.2.1 you should remove the cairo dependency from pango. Otherwise awesome might link to XQuartz cairo while pango links to macports cairo causing an annoying crash while restarting, connecting the second head or closing X11.

sudo perl -ni -e 'print unless /pkgconfig\/cairo/' /opt/local/var/macports/sources/rsync.macports.org/release/ports/x11/pango/Portfile

then you can probably do the following to install awesome(awesome.diff fixes a configure issue on osx, you can find it here ):

sudo port install pango imlib2 libconfuse

wget http://awesome.naquadah.org/download/awesome-2.3.4.tar.bz2
tar xjvf awesome-2.3.4.tar.bz2
cd awesome-2.3.4

patch -p1 < ../awesome.diff

./configure --prefix=/opt/local
make

The build will probably fail somewhere in between because of defconfig.h . If so you can use the following command to fix it:

# this can probably done much better but meh, i don't know sed syntax too well, -i '' means edit in place
sed -i '' -e 's/DEFAULT_CONFIG =.*$/DEFAULT_CONFIG = "\\/' -e 's/-n ".*$//' -e '/./!d' defconfig.h

Afterwards finishing the build you will probably want to create an ~/.xinitrc file and add the following to it:

#!/bin/sh

#unless you want the annoying bells or visual bells keep the following 2 lines
xset b off 
xset b 0 0 0 

# the fork switch won't work on osx, so no -f here
export RXVT_SOCKET=$HOME/.rxvt_socket
urxvtd -q -o &

awesome

Also if you use an exotic shell config(eg. with zsh) it might break X11 a bit unless you put the following in your ~/.x11run

#!/bin/bash

exec -l "bash" --login -c 'exec "${@}"' - "${@}"
Don’t forget to run
chmod +x ~/.x11run

afterwards(note this is a pretty new feature of XQuartz.

I’ll continue next time on how to setup urxvt. Meanwhile you can use xterm which also has 256 color support, however XQuartz xterm won’t detect terminus font if you decide to use a non antialiased font.

New Skype themes in OSX

So yesterday skype released a new version of Skype for Mac. You con get it here.

I know skype is evil and stuff but anyway they released a new theme that is used for the Mood chat. Sadly you cannot chose it as default message font, so what to do? Well a simple 3 liner in Terminal allows you to use it as default chat style.

Open Terminal.app or whatever your favorite Terminal is(mine is urxvt) and type in the following:

mkdir -p ~/Library/Application\ Support/Skype/ChatStyles
cp -r /Applications/Skype.app/Contents/Resources/ChatStyles/MoodMessage.SkypeChatStyle ~/Library/Application\ Support/Skype/ChatStyles/MoodStyle.SkypeChatStyle
sed -i '' -e 's/moodmessage/moodstyle/' ~/Library/Application\ Support/Skype/ChatStyles/MoodStyle.SkypeChatStyle/Contents/Info.plist

Now you can set MoodStyle in Preferences/Chats/Style.

However I wasn’t quite happy with this solution, so I read about Skype supporting Adium message styles. Well… tough luck, turns out they dropped support for Adium message styles a couple of months later. Turns out it they didn’t completely drop it, just mod it a bit. So I sat there last night and stitched together a version of renkooNaked that works in Skype.

The downside: The fonts gonna be messed up if you use any non 11 size, since the first line will always be 11px. Also, you should select the font once to set it properly.

Anyway, this is how it’s going to look(just click on the picture to download):

Collab.net Subversion 1.5 OSX Problems

So I started using Versions a while ago… When I saw there’s people having problems with the 1.5 cli tools from Collab.net I was sceptical. But being unable to keep myself from upgrading I tried it anyway.

And what do you know… I get exactly the same problem described by “Gary Gray” on the Versions group…

Commiting svn+ssh results in this error message:

svn: Commit failed (details follow): svn: Cannot negotiate authentication mechanism

So I started digging around there’s essentially two fixes to this problem. The first would be to reinstall subversion with the—without-sasl flag on osx and the other is described here.

The problem however is that both of these require recompiling subversion. Now the question is why would you recompile subversion if you already have it and the problem is just in dependent libraries?

That’s right, the only reason I write this is because I didn’t feel like recompiling a bunch of dependencies that I might never use again. So this fix actually works fine without reinstalling subversion.

Contrary to commen belief the cause of this problem is not the sasl library but in fact the bundled openssl library(don’t kill me if I’m wrong though :P)

So first of all you would go on and install/upgrade openssl and sasl in your favorite package manager.

Since I use macports it would look like this:

sudo port upgrade openssl
sudo port install cyrus-sasl2

In this case the libs are installed into /opt/local/lib . I think it’s /sw/lib for fink..?

Then you want to make the old subversion binaries to use the new libraries instead by using the following:

for f in `ls /opt/subversion/lib/libsvn*1.0.0.0.dylib` ; do
    install_name_tool -change /usr/lib/libsasl2.2.dylib /opt/local/lib/libsasl2.2.dylib $f  ;
    install_name_tool -change /usr/lib/libssl.0.9.7.dylib /opt/local/lib/libssl.0.9.8.dylib $f ;
    install_name_tool -change /usr/lib/libcrypto.0.9.7.dylib /opt/local/lib/libcrypto.0.9.8.dylib $f ;
    lipo $f -thin i386 -output $f ;
done
for f in `ls /opt/subversion/bin` ; do
    install_name_tool -change /usr/lib/libsasl2.2.dylib /opt/local/lib/libsasl2.2.dylib /opt/subversion/bin/$f  ;
    install_name_tool -change /usr/lib/libssl.0.9.7.dylib /opt/local/lib/libssl.0.9.8.dylib /opt/subversion/bin/$f ;
    install_name_tool -change /usr/lib/libcrypto.0.9.7.dylib /opt/local/lib/libcrypto.0.9.8.dylib /opt/subversion/bin/$f ;
    lipo /opt/subversion/bin/$f -thin i386 -output /opt/subversion/bin/$f ;
done

lipo is necessary in my case since the subversion binaries are 64 bit as well and the library my macports installed were 32 bit intel, causing it to crash.

You might want to use ppc or something if you’re on a G4.

Update: Here’s a little script with which you can toggle svn 1.5 support in xcode on and off:

#!/bin/sh

XCODESVN=/Developer/Library/Xcode/Plug-ins/XcodeSubversionPlugin.xcplugin/Contents/MacOS/XcodeSubversionPlugin 
SVNPREFIX=/opt/subversion

if [ ! -f ${XCODESVN}.bak ]; then cp $XCODESVN ${XCODESVN}.bak ; else cp $XCODESVN.bak ${XCODESVN}; rm $XCODESVN.bak; exit; fi

install_name_tool -change /usr/lib/libapr-1.0.dylib $SVNPREFIX/lib/libapr-1.0.dylib $XCODESVN
install_name_tool -change /usr/lib/libaprutil-1.0.dylib $SVNPREFIX/lib/libaprutil-1.0.dylib $XCODESVN
install_name_tool -change /usr/lib/libsvn_client-1.0.dylib $SVNPREFIX/lib/libsvn_client-1.0.dylib $XCODESVN
install_name_tool -change /usr/lib/libsvn_delta-1.0.dylib $SVNPREFIX/lib/libsvn_delta-1.0.dylib $XCODESVN
install_name_tool -change /usr/lib/libsvn_diff-1.0.dylib $SVNPREFIX/lib/libsvn_diff-1.0.dylib $XCODESVN
install_name_tool -change /usr/lib/libsvn_fs_fs-1.0.dylib $SVNPREFIX/lib/libsvn_fs_fs-1.0.dylib $XCODESVN
install_name_tool -change /usr/lib/libsvn_fs-1.0.dylib $SVNPREFIX/lib/libsvn_fs-1.0.dylib $XCODESVN
install_name_tool -change /usr/lib/libsvn_ra_dav-1.0.dylib $SVNPREFIX/lib/libsvn_ra_neon-1.0.dylib $XCODESVN
install_name_tool -change /usr/lib/libsvn_ra_local-1.0.dylib $SVNPREFIX/lib/libsvn_ra_local-1.0.dylib $XCODESVN
install_name_tool -change /usr/lib/libsvn_ra_svn-1.0.dylib $SVNPREFIX/lib/libsvn_ra_svn-1.0.dylib  $XCODESVN
install_name_tool -change /usr/lib/libsvn_ra-1.0.dylib $SVNPREFIX/lib/libsvn_ra-1.0.dylib $XCODESVN
install_name_tool -change /usr/lib/libsvn_repos-1.0.dylib $SVNPREFIX/lib/libsvn_repos-1.0.dylib $XCODESVN
install_name_tool -change /usr/lib/libsvn_subr-1.0.dylib $SVNPREFIX/lib/libsvn_subr-1.0.dylib $XCODESVN
install_name_tool -change /usr/lib/libsvn_wc-1.0.dylib $SVNPREFIX/lib/libsvn_wc-1.0.dylib $XCODESVN

Enjoy

AOChat

Anarchy Online Chat Client for OS-X with Growl Integration and other fancy things. There is a few issues however that needs to be fixed. The pass floats around in memory… server