Il Diario di Tinton











This page has been moved to https://wiki.afm.co/x/SAI0Ag

 

Advertisements


20120303-004238.jpg

The other day i busted the power supply of the Apple Cinema Display HD 20″. I went to go look for a used one on eBay and was horrified at the $100 bucks price range.

After realizing it is really nothing fancy at all, simply a 24.8V 4A power supply, i decided to get the display back working using a generic supply. Or actually not so generic. I used an old iBook G4 power supply. It’s really not powerful enough to drive the monitor at full brightness, so i don’t suggest it as a permanent fix. However, it does cost $10, and i can alway buy 2 for $20 and connect them in parallel, and still save like $80.

In any case, i rarely need the full brightness: i almost always keep it at minimum. And the monitor draws like 20W or so at minimum brightness and 70-80W at max brightness. So the 65W iBook (or maybe it was a PowerBook) power supply works great as a temp fix.

The hardest part was to de-gut the original power supply. At first i was scared, but once i stuck the nose in the the connector hole, and smelled burnt electronics, that’s when i got courage: i took a saw to it, and sawed all around the seem, about 2mm of plastic (which is a lot! No way i could do it with an x-acto knife).

Once degutted, i found that the output connector was first of all nothing but negative, positive and ground (all the other pins are probably just there to make it flippable, without having to worry about polarization, and for optimizing current flow and reliability). And other great news: the connector is soldered on its own mini PCB with two strong independent screws! So all i did was yank the power supply, desolder the cables to the connector PCB, solder some new ones, close the almost empty case with black duct tape, and connect it with the PowerBook’s power supply.

I did try to see if i could fix the original first. However, from a quick look at the supply i realized there wasn’t really a visible busted component, so it probably was the transformer which went. It, however, is not marked at all, and it is in the middle of the PCB completely surrounded on all four sides by other components and soldered on the same side of the board! So i would have had to take half board apart, just to remove it. Once i removed it, i still didn’t know how to find out what parameters it had, so i wouldn’t know what to replace it with.

Bottom line: the fix is ugly, however it’s stable and it works great. I haven’t tested the voltage of the power supply under load, however at no load, it’s a stable 24.9V, and the Display can take all the way up to 28 something, i read somewhere. The question is: “What is the voltage at full load, and will the power supply actually be able to handle it?“. I’ll most likely end up buying to 45W supplies next time i fly to the States and connecting them in parallel.



{2010-11-23}   iPhone iPod bug

Just discovered an annoying bug in mail for iOS: If you have an iPod or iPhone and have an email in the drafts folder you want to finish and send, pay much attention when sending! If there is no network you, like me, might just get a warning of failed delivery, like as usual, except this time it doesn’t stay in the outbox, nor does it stay in the drafts. It’s gone! This happened to me only for emails I started on the Mac.



{2010-05-24}   mdbtools

I’m trying to get mdbtools to work on OS X 10.6 and/or amd64 linux. It’s so strange how its distributed by debian and macports, compiles fine, however gives obnoxious runtime errors.

The errors i get are the following:

$ mdb-ver file.mdb
JET3
$ mdb-tables -1 file.mdb
Segmentation fault
$ mdb-export file.mdb table
Segmentation fault

At the beginning i thought it had to do with OS X, however, when i ran into the same symptoms on Linux 2.6.18-6-amd64, i started thinking it could have been a 64bit issue. When Brian Bruns first wrote it, he probably didn’t prepare the code for 64bit architecture, making common assumptions such as an int is as big as a long or pointer.

I found some help here:

Splint

Splint is a utility that will check code for specific issues. In this case, i could use it to make sure that the size of long integers and pointers is 64 bits and the size of plain integers is 32 bits. When using splint, i found these flags to work (i put them in the .splintrc, since that was really the only thing i was using splint for):

-preproc
+posixlib
-I /opt/local/include/glib-1.2/
-I /opt/local/lib/glib/include/
-I ~/tmp/mdbtools_debug_attempt/mdbtools-0.6pre1/include

gdb

I played with gdb and libgmalloc, but not sure if i logged the work i did. When i run it now on linux, i get:

(gdb) run -1 OMS.MDB
Starting program: /usr/bin/mdb-tables -1 OMS.MDB
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 47589690023856 (LWP 14731)]
(no debugging symbols found)
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47589690023856 (LWP 14731)]
0x00002b48564e1fa4 in __gconv_get_alias_db () from /lib/libc.so.6
(gdb) cont
Continuing.
Cannot find user-level thread for LWP 14731: generic error
(gdb) cont
Continuing.
Cannot fetch general-purpose registers for thread 47589690023856: generic error
(gdb) cont
Cannot fetch general-purpose registers for thread 47589690023856: generic error
...


This is what happened:

  1. I backup up internal HardDisk to USB drive
  2. I booted off of USB drive with 10.5
  3. I mirror copied with SuperDuper! from a FireWire drive to internal HardDisk
  4. I didn’t reboot imeediately after i was done.
  5. When i went to reboot, the computer said it couldn’t shut down yet, as it was rebuilding some kind of cash.
  6. I listened to the hard drive, which sounded completely silent, then i forced a shutdown.

I think what was going on was that OS 10.5 had recognized that on the internal boot drive there was something different than what was actually running in memory. Don’t know why. Probably there is somewhere  in the code a reference to the physical drive, instead of the mount point, or something like that. So it started rebuilding the dyld cache on the internal hard disk which was a 10.6. So we now had a 10.5 cache on 10.6 filesystem.

The easiest fix was deleting all /private/var/db/dyld/*cache*



Always use the extended version of the regular expressions. In find:

find -E ./ -iregex ".*((zip)|(gz))$"

is equivalent to

find .| grep  -iE ".*((zip)|(gz))$"

Use this to search for this pattern or that pattern. The parenthesis to group expressions this way only work in extended (as grep(1) calls them) or modern (as re_format(7) calls them).

In grep use -i to ignore case. In find, use -iregex to ignore case.



Splitting files / Multiple archives

If you would like to create a multiple archive zip, tar or whatever, the easiest thing is to use split. Split any file into whatever size you wish like this:

split -b <number_of_megs>m <file_to_split>

which will create a sequence of files named <file_to_split>{aa,ab,ac,…}. You can add to pipes, define output filename, and more. See man page.

Rebuilding the split archive

To rebuild, use cat:

cat <file_to_split>?? > <file_to_split>

or feed the pipe directly to unzip or tar.

 



On the 10.5 and above, cron is deprecated. launchd is used instead. To obtain the similar effect of a cron job, one must make use of a launchd.plist file.

Resources



et cetera
%d bloggers like this: