os x

You are currently browsing articles tagged os x.

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

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

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.

On OS X you can easily decode base64 strings with the openssl command

openssl base64 -d -in <(echo “dGhpcyBpcyBhIHRlc3QKCg==”)

just drop the ‘-d’ if you want to encode things.

I found this here

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.

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

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

  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

A nice way to convert any .bin/.cue file to a .iso file so you can burn it with hdiutil is:
0xcb0:$ bchunk discImage.bin discImage.cue discImage.iso
and the burn it
0xcb0:$hdiutil burn discImage.iso01.iso

bchunk is avaliable through
0xcb0:$sudo port install bchunk

I needed a list of german correct words to check some stuff for my BA Thesis.
Couldn’t find a way to get all words from the auto-correction function on OS X. I thought there might be a complete list of words which I simply read in and then check. But it doesn’t look like there is something.

So I do google and found out that translation files ending with ‘.strings’ located at the ‘lproj’ folder contain translations for the internationalization. The only thing I need is to make a list of those files, then go through this list and extract the german translation words. I don’t care about double word’s because the can be filtered out later easily.

So here is my Script:
[---BOF---]
#!/bin/bash
B=$IFS;
IFS=$’\n’
for i in $(locate .lproj | grep “German” | grep “\.strings” | grep -v InfoPlist)
do
for line in $(cat $i | grep –binary-files=text -v “/” | grep –binary-files=text “=”)
do
IFS=” ”
for word in $(echo ${line//[\"-\+\.,:=;&\)\(%,@1234567890]/} | awk ‘{ $1=”"; print  }’)
do
if [ ${#word} -gt 1 ]; then
echo $word >> ~/Desktop/iMacDELang.txt;
fi;done
IFS=$’\n’
done;done
IFS=$B
[---EOF---]

For other languages just replace “German” in line 4 with your desired language.

Execution takes about 5 mins and I end up with a list of ( after filtering ) 43756 uniqe german words.
This was enough for my first test, later on I do really need a complete list of all words. Tthis would be great

« Older entries