nmh, mh-e and emacs on OS X 10.7

Hi there,
I haven’t posted in a while. But this short post should proof im still alive 😉

I’ve been doing a lot emacs lately and decided to give nmh a try. Unfortunately the script that ships with it, to automatically build and install nmh, won’t work on my Macbook running OS X 10.7. It just gives me this output:

make[2]: *** [check-TESTS] Error 1
make[1]: *** [check-am] Error 2
make: *** [check] Error 2
build failed!
build log is in build_nmh.log

The build_nmh.log is full of messages that tell me to go away.

Here’s what I did to manually install it.

$ cd nmh
$ autoconf
$ autoheader
$ configure --enable-debug --enable-pop --with-editor=emacs --prefix=$HOME/nmh
$ make
$ sudo make install

This installed nmh binaries into the “~/nmh” which is ok for now because I’ll just want to try out.

After that you need to got to emacs which includes mh-e since emacs 18. So this should apply to my nightly build version 24.3.50.1 from EmacsForMacOsX.

Now you need to configure the variable ‘mh-path’ so emacs will know where to find the executable.
I did this through calling ‘M-x customize-variable mh-path’ and entered “User/cb0/nmh/bin”
This will set this variable in you .emacs file

(custom-set-variables '(mh-path (quote ("/Users/cb0/nmh/bin"))))

After this run “M-x install-mh” to install and “M-x mh-version” to check if everything is installed correctly.

MH-E 8.5

MH-E compilation details:
 Byte compiled:		yes
 Gnus (compile-time):	Gnus v5.13
 Gnus (run-time):	Gnus v5.13

GNU Emacs 24.3.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2013-03-28 on bob.porkrind.org

nmh 1.5+dev
 mh-progs:	/Users/cb0/nmh/bin
 mh-lib:	/Users/cb0/nmh/etc
 mh-lib-progs:	/Users/cb0/nmh/lib

Darwin snowball.lan 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:26:45 PDT 2012; root:xnu-1699.32.7~1/RELEASE_I386 i386

I also installed the manual so I dont have to leave emacs for a straight start.

Now I’m excited to see nmh live and inside emacs.

iTunes Sharing over ssh

Today I realized that I had not a single song on my notebook hard disk. Thanks to Last.FM 🙂
Unfortunately “Simplify Media” has been adopted by Google Inc. and they do not offer a similar service yet. So I needed a solution to stream my iTunes from home to the office. If found a great solution by “Robert Harder” which works like charm. (source).
This is the bash script:

#!/bin/sh
dns-sd -P "Home iTunes" _daap._tcp local 3689 localhost.local. \ 
127.0.0.1 "Arbitrary text record" &
PID=$!
ssh -C -N -L 3689:localhost:3689 username@dyndns_name.dyndns.org
kill $PID

Howto disable iPhoto autostart when connecting an iPhone ?

Finally I found an awnser:
NOTE: This is only for Mac, I don’t know how to do it on a Windows machine.

1. connect your iPhone to your Mac
2. close the starting iPhoto for the last Time 😉
3. open up the “Image Capture” (eng) / “Digitale Bilder” (de) Application
4. select your iPhone and choose “No Application” in the DropDown List.
5. close it and enjoy connecting your iPhone without the annoying autostart

recover zip password under os x

Marc Lehmann has written a zip Password cracker similar to fzc or zipcrack. It can be used to either bruteforce or try a dictionaty attack on a password protected file.
It’s called fcrackzip and can be found here.
Just follow the instruction given in the Readmefile and compile it. This work’s great for me under 10.5.6 as long as you have X Code installed.

Here’s how I use it:

fcrackzip -b -c aA1 -l 6-8 -v -u file.zip

-b : bruteforce the password
-c : use the following character classes for cracking:

a    use all lowercase character
A   use all uppercase character
1    use all digits

-l 6-8 : Try passwords between 6 to 8 characters in length
-v be more verbose (this will print out the actual used password)
-u file.zip : Try to decompress first file in file.zip with the generated password.

And when the output starts with ‘PASSWORD FOUND!!!!: pw ==’, I’m happy.

For more command line options see the project page under http://www.goof.com/pcg/marc/fcrackzip.html.

java decompilers

Because I have no recent Backup of the big java project I was working I have to decompile the class Files that are in this jar.
I found 3 different java decompilers for mac os x.

  1. MacJAD (google for Download)
    – onyl able to open single class files
  2. JarInspector (http://www.codeland.org/)
    + can open jar files
    + correct 
    – unable to decompile the anonymous inner classes I use
    – seems to be confused by nested catch and try blocks 
  3. JD-GUI (http://java.decompiler.free.fr/)  
    + can open jar files
    + 90% able to decompiling anonymous inner classes

A big problem all tools share is that if you have nested iterations, for/while loops they all rename the variable you iterate over to ‘i$’. So it’s possible if your code looks like this:

while(iterator.hashNext()) {
...
    for(int varA; ....){
        for(int varB; ....){.....}
    }
...
}

the decompiled code will end up looking this:

while(i$.hashNext()) {
...
    for(int i$; ....){
        for(int i$; ....){.....}
    }
...
}

which isn’t really funny …

My conclusion is that JarInspector seems to be the best but if you need the inner class support use JD-GUI for the parts of the code those are in.

Imac horror crash

I don’t know what’s going on. Last week my old Powerbook G4 suddenly stoped working because of some hdd error.
Today I told my 1 year old 24” iMac to shutdown and went away. When I returned it was still trying to shutdown but I couldn’t do anything except for resetting. After a reboot the horror was perfect because of this huge ? Symbol on the screen indicating that no hdd was found.
I was near crying
After running hardware test it told me there is an 4HDD/11/40000004 sata(0,0) error. ;(
Disk Utility told me that it couldn’t repair because of wrong disk permission and repair disk permission told me it couldn’t finish because of some unknown error ;(
I’ll now try to solve this with diskwarrior, tomorrow morning I’m going to buy some FireWire cable to try to rescue some of my data via target mode.
Wish me some luck, there’s too much work on it…
why is this happening, is there some kind if hardware destroying virus I’m infected with? A single person just can’t have so much bad luck

backspace problem with screen in remote debian with os x

Every time I use terminal in combination with an ssh connection to a remote host and the execute screen I’m not able to use the backspace key.
Found a soultion in the comment section of atomized

just put the following line into your ~/.bash_login script

export TERM=xterm

fin

BibTeX and LaTeX in TeXShop OS X

  1. create a file (e.g. cites.bib) that will contain the cites
  2. create a cite in cites.bib (you may use http://www.interaction-design.org/citation-maker/ as the simple solution)
    e.g.

    @misc{bibAndTex,
      AUTHOR = {cb0},
      TITLE = {BibTeX and LaTeX in TeXShop OS X},
      PUBLISHER = {cb0},
      ADDRESS = {Leipzig},
      YEAR = {2009},
    URL = {http://0xcb0.wordpress.com},
    note = {This is an electronic document. http://0xcb0.wordpress.com
               Date retrieved: Feburay 22, 2009. Date last modified: Feburay 22, 2009},
    url = {http://0xcb0.wordpress.com},
    }
  3. Insert the following 2 lines at the desired place of your bibliography
    \bibliography{cites}{}
    \bibliographystyle{plain}

    cite is the reference to the created cites.bib

  4. cite it somewhere
    \cite[see cb0's Blog]{bibAndTex}
  5. Save all changes
  6. set Latex
    bild-1
  7. set BibTeX
    setbib
    output should start with sth. like this
    bild-3
  8. 2 times step 6 for correct numbering of all cites
  9. look at the results
    citeintext
    the cite in the text

    bibliography
    the cite in the bibliography
  10. enjoy