contact

Archive for the ‘Tech Questions’ Category

weird file in Mac OS X trash that keeps coming back

Wednesday, December 10th, 2008

I recently found a weird file in my trash that looked like this:

weird file in trash

weird file in trash

It is impossible to delete the file or rename it. secure emptying the trash won’t solve the problem either. if I click on “get info” it disappears. I found the following thread, which provides a good solution to the problem. And don’t worry it is not a virus

http://discussions.apple.com/thread.jspa?messageID=5882792#5882792

western digital mybook pro edition 500GB shuts down at random

Tuesday, December 2nd, 2008
WD mybook 500GB pro edition

WD mybook 500GB pro edition

today my time machine backup broke again. I tried reformatting the drive, hooking it up to the computer directly, firewire, usb nothing worked. at first the computer sees the drive and is able to mount it but after a short time the drive simply turnes off during file transfers. I called up western digital techsupport to see how I can fix the problem:

the solution: the drive has a broken thermal control unit and this can only be fixed by getting your drive replaced.

so I signed up for western digitals RMA program and now I am waiting for a replacement drive to be shipped to me. the friendly tech support guy told me I might even get a mybook studio edition which would be quite nice. so I now I have to wait and see how this whole replacement things works out.

Update I @ 9.12.2008:

today I got a package from western digital. It had a probably used western digital 500GB studio edition in it. The being used part sucks I think but since I only sent in a mybook pro edition a used studio edition seems to be a fair trade. The inital setup worked just fine but about 5 attempts to create a new time machine backup failed. The disk mounts allright but at some point during the file transfer it simply shuts down again. if I then hit the power button at the back it comes back up and mounts again which the old one did not do. Anyhow this is just not right for a product with such a price and that is advertised to be “mad for a mac”. As I type time machine is backing up to the drive which is now hooked up to my airport extreme router. I will see if it will be able to complete the backup that way.

western digital 500 GB studio edition

western digital 500 GB studio edition

Update II @ 10.12.2008:

Over night the backup of time machine finished successfully to the drive hooked up to my airport extreme. This morning I reconnected the drive via firewire 800 and deleted the old stuff, did two small backups all without problems. I take the drive now as working, since it will be hooked up via usb to the router anyway. Now I have to send Western Digital my old disk or they will charge me for the new one.

Update III @ 10.12.2008 22:56

around noon the drive did not wake up for a backup until i pulled the power plug. So I called up tech support and told them about it. He advised me to to perform a firmware upgrade which i did. after that everything seemed normal. But After rebooting the mac, I tried to launch the backup and it froze my mac. no piece of software or hardware has ever frozen my mac. I mean seriously this is an external hard drive not a crappy external tv card with weird drivers or anything. any 5 ? usb drive can do what this 150 ? piece can’t. I currently try to continue the backup. its been in a preparing state for ever and just as I type this it started to copy data , and it really finished. great. wonder what happens in an hour when the next backup is due. Anyhow I will call up tech support tomorrow again and have the drive replaced again. This is supposed to be a reliable backup solution. luckily i have mac girlfriends macbook to backup my critical data. I don’t know what I would do if I really needed the drive for work or anything. man I hate tech support!

One thing I know now for sure is I will get an offsite online backup solution, backblaze will be my choice. its 50$ a year thats about 40 euros a year. 150? for a WD studio Edition / 40 ? = more than 3 years. thats longer than the warranty of these drives.

Update IV @ 11.12.2008 1:01

now the drive appears to be working again. it finished serveral backups just fine while powering down in between. I will keep the laptop running all night to see if it can keep it up till next morning.

Update V @ 11.12.2008 9:44

the drive has beend working all night. finishing several backups powering up and down. I will keep the drive for testing over the weekend and decide monday whether to send it back or not.

Update VI @ 16.12.2008 23:05

I decided to give the drive another chance over the long weekend I had, and it worked. no more hickups, i open the lid of my macbook pro, i hear the drive power up, time machine does what it needs to do, the back up is finished, exactly ten minutes later the drive powers down. I mailed back my old mybook pro. hopefully it gets there before the holidays otherwise western digital is going to charge me the ridiculous amount of 384 dollars for the new 500GB studio edition which is like 150 ? at amazon. but I have faith in the postal service. I hope the drive lasts till I get my new mac mini server once the new models arrive at macworld in january. At this point I am totally clueless which external harddrives to get to extend the storage of the server, since I do not want to trust Western Digital with my really important data.

Update VII @ 22.09.2009 19:21

I have used the drive now since the last update without any further problems. I have been on vacation the last 2 weeks and after coming back, it powered up, backed up more than 13 Gigabytes and went back to sleep like a charm. This is how I want things to work.

I will keep updating this post as things progress.

Actionscript 3 3D with Flash CS4

Wednesday, November 26th, 2008

I finally got a copy of adobe flash cs4. In addition to the great new user interface flash cs4 can compile flashplayer 10 content which enables the new actionscript 3 3D methods. with only the three simply rotationX, rotationY and rotationZ properties one can quickly create really nice 3D animations. This is my first test.

here are the few lines of code it took to make this thing spin:

</pre>
import flash.display.*
 import flash.geom.*
 import flash.events.*
 import flash.display.*
 var panes:MovieClip=new MovieClip()
 panes.x=300
 panes.y=200

for(var i:Number=0;i<18;i++){
 var pane:MovieClip=new MovieClip()
 pane.graphics.lineStyle(1,0xffffff,0.5)
 pane.graphics.beginFill(0x003366,0.3)
 pane.graphics.drawRect(0,0,100,100)

pane.x=0
 pane.y=-50

pane.rotationY=i*20
 pane.moving=false
 panes.addChild(pane)

}

addChild(panes)
 panes.rotationZ=90
 panes.cacheAsBitmap=true
 panes.addEventListener(Event.ENTER_FRAME,movePanes)

function movePanes(e:Event){
 panes.rotationX+=5
 }
<pre>

Jquery documentation PDF version

Wednesday, November 19th, 2008

The Jquery documentation is nice but only works online. I found a guy who put the entire documentation into a nice downloadable pdf.

jquery documentation

jquery documentation

You can download the latest version for jquery 1.2.6 here –>

http://www.nabble.com/jQuery-Documentation-in-PDF-td20088645s27240.html

calculating the number of days between two dates

Sunday, November 9th, 2008

for a recent project I had to figure out how many days are between a given start and end date. My first very poor attempt was to split the dates and then get the monthes and then add up the days for each month. Very poor on performance.

The easy solution:

most modern programming languages offer Dates Objects that can handle timestamps, which makes our calculation very easy.

(Timestamp(endDate)-TimeStamp(startDate)) / 3600 / 24 = days

this will compute the amount of seconds between the start and end date, then divide by 3600 gives you get hours, divide by 24 and you have the number of days. This is especially nice since it automatically considers 29th of february.

note: if you use actionscript you have to again divide by 1000 since its timestamps are in milli seconds.

actionscript 3 screenshot

actionscript 3 screenshot

jquery ajaxForm and validate with ajaxSubmit()

Tuesday, October 14th, 2008

I am currently working my way into the jquery universe and I really like the great plugins that take a lot of the workload of off your back. I am developing an application that uses the ajaxForm plugin and it worked nicely. Then I implemented the also great validate plugin and it for it self also worked really well.

The problem:

it seems that the ajaxForm keeps getting submitted with or without errors using the ajaxForm submission and if the form contains no errors it gets submitted a second time via this method discribed by the plugin author:

</pre>
submitHandler: function(form) {
jQuery(form).ajaxSubmit({
target: "#result"
});
}
<pre>

The solution / workaround:

I found the only way to get this work is to completly ignore the submitting capabilities of the validate plugin and use the ajaxForms built in beforeSubmit option to check the form using the validate valid() function.

</pre>
beforeSubmit:checkForm // add this to your ajaxForms options

function checkForm(data,form){ // this method will tell the beforSubmit method if the form is valid
 return $(form).valid();
 }
<pre>

note: I have

Mac OS X disk utility – resource busy error

Friday, October 3rd, 2008
WD mybook 500GB pro edition

WD mybook 500GB pro edition

I noticed that time machine kept preparing for a backup on my western digital mybook 500GB pro edition external harddrive that is connected to an Apple Airport extreme basestation. At first I thought it was a time machine problem but soon I realized that my external harddrive was the source of the problem.

Sympthoms:

  • the disk is not mountable
  • the disk does not show up in finder
  • the airport utility can not access the base station as long as the disk is connected
  • the disk does show up in the disk utility

After screwing with it for a bit I decided to wipe the entire drive in order to fix the problem. Both erasing and repartitioning the disk resulted in an error message saying “resource is busy”.

What did not help:

  • restarting the disk
  • restarting the computer
  • booting from the os x disc and using the disc utility from there will not help either

So I was ready to give up and looked up the warranty information on the western digital website – which is really really good by the way. They had a small windows diagnosis tool for download one should try befor applying for a replacement. So I booted up in windows XP ran the diagnose and it toled me everything was perfectly fine.

The solution to the problem:

just use the standard built in windows XP disk management and wipe the old apple partition and replace it with a new windows NTFS partion( just for now). After this step windows should already be able to see and use the disc under my computer. Now simply reboot to OS X and launch the disk utility, reformat the disk to apples file system and reconnect it the base station.

Note:

Unfortunatly this solution results in complete loss of all your data that was on the drive. But I found no better way.

Saving pictures directly from safari mobile to iphone and ipod touch

Tuesday, September 23rd, 2008

I just discovered that it is possible to save images from safari mobile to your iphone and iPod touch. I run the 2.1 firmware so I can not say if this feature works on older versions as well.

In order to save an image simply hold your finger pressed on the image for a few seconds and you will be promted to save the image to your foto library. Once downloaded you find the pictures under the saved pictures gallary in the fotos app.

Very nice feature.

Snaged this pic from apple right now to my iPod and now I can post it using the wordpress app without a camera or a computer on my iPod touch

ipod touch image from the apple homepage

screenshot of saving the picture on the ipod touch

Apple Airport Extreme Basestation and Wake On Lan

Monday, September 15th, 2008

In order to cut down on energy usage I wanted my allwayson windows XP server to hibernate when not in use. My network adapter supports wakeOnLan and I also had it configured in a minute. Make sure Wake on Lan is activated in your Bios as well as in the configuration menu of the networking card.

Wake On Lan settings on the server

Wake On Lan settings on the server

wake on land settings - energy management

be sure to check all three boxes. The last box makes sure your pc does not wake up from random networking traiffc.

this is what it looks like on a mac

this is what it looks like on a mac

Then I go to my macbook pro and fire up this tool http://gsd.di.uminho.pt/jpo/software/wakeonlan/ which is a small free but fully functional wake on lan tool for macs that is able to send the so called magic packets that wake up a computer in standby or hibernation mode. There are a ton of tools like this for windows as well. google is your friend.

wake550

So within the network everything works just fine. I put in the mac address and the broadcasting IP which usually is something like 192.168.x.255 and hit go. seconds later my server is booting up. very nice.

Wake on Lan over the internet through a Airport Extreme basestation is a different story. In theory all you had to do is forward the UDP port 9 to the broadcasting IP of 192.168.x.255. So any magic package that hits your router on the wan port is automatically broadcasted over your local network in order to find the machine that needs to be powered up. pretty simple in theory.

1. Update 4.5.2009

2. Update 20.5.2009

Wake on lan over the internet

It is possible to do it over the internet on the long run. The important thing to understand is that the Airport extreme basestation still will not allow any broadcasting of outside traffic. It can be done however if you manually specifiy the ip address for the computer that should wake up. your are very likely to have your Airport Extreme Basestation hand out IP addresses to devices using DHCP. Your computer needs an IP reservation that will give it the same Ip every time it is on, so the magic package will always reach the correct machine. you can make such a reservation in the Airport utility at internet –> DHCP. The AEBS will only remeber the computer with the IP reservation for a short amount of time so it is not a long term solution.

Ip reservation

You need the computers mac address to make this reservation, usually something like this xx:xx:xx:xx:xx:xx. Then head over to you computer’s network settings and asign the same IP you just reserverd manually to the computer.

manual ip

Now you have to forward the UDP 9 port in the airport utility. Unlike previously assumed you do not want to forward it to the broadcasting IP but to the specific IP you asigned to the computer.

forwarding the udp 9 port

forwarding the udp 9 port

http://ifatwww.et.uni-magdeburg.de/wol/

http://stephan.mestrona.net/wol/

here is a really good german explaination of the entire issue.

Bottom Line:

it is possible to use wake on lan within your local network/subnet if you have an Apple Airport Extreme Basestation, but it is not possible to wake up your machine over the internet since the AEBS will not forword the magic packages coming in at the UDP 9 Port.

It is possible to do wake on lan over the internet and on your local lan with your airport extreme basestation. Thanks a bunch for the commenter who came up with this idea!

It is possible to do wake a lan over the internet but after a short time the AEBS “forgets” the link to the computer and it will not work any more. Sry for the messy post, I will clean it up once I have figuered the damn problem out!

windows vista – my experience

Friday, August 22nd, 2008

since my laptop broke down i had to use one of my dads computers which happens to run windows vista. at first I thought about just wiping the drive and put on windows xp right away, but I gave it a shot and I must say I am quite surprised.

Internet connection:

i took the computer to my room pluged it in and there was no internet connection. grr, but i turned out that there was just an old configuration still in place and it took two mouse clicks to geht this machine online. so bassically not more difficult than on my mac.

Networking:

vista is crazy about permissions, and so it took me quite a while to figure out how to share a folder on another computer in order to copy some stuff to this computer. In windows defense I must say that I had file permission problems as well when sharing files between my girlfriends mac and my own.

installing software:

no problems there. just downloaded the couple of programs that I use and after one hour i was ready to contiune working on the same website i was working on my macbook pro befor it crashed. if could even install xampp without any trouble

the notoriouse cancle or allow question:

well it comes up once in a while but stays within acceptable