Monday, September 13, 2010

HP LaserJet 1018 on MacOS

For some marketing reason the HP does not provide any support for this printer. It is possible to make it work using the foomatic but it is a pain and suffer. Thanks to this guy a way to make it run using the native HP drivers was found.  Unfortunately a lot of people report about the problems finding the right 1022 printer driver as for some reason after doing all possible updates the only driver for 1022 in the system is the one from Guteprint. Same thing happened to me. A workaround is to download the driver update bundle directly from the Apple's support website. Finally the procedure of installing the support for the printer is as following:

1. Download the HP Printer Drivers v.2.4.1 for Mac OS X v10.6
2. Connect the printer and turn it on.
3. Add a new printer selecting the HP LaserJet 1022 driver (version 1.3.0.261)

Then the printer should start working well.

Thursday, September 9, 2010

Exporting all events from iPhoto to a disk folder

Recently my wife asked to download all photos from my iMac to her Windows7 notebook PC structured into the directories named after the corresponding event name. As there was no such feature present in the iPhoto I decided to write a script to automate the task. Unfortunately the Apple scripting for the iPhoto application is not able to exploit even a half of all features available. There is no way to get the list of all events and therefore no way to find out the photos they contain. The standard export function can not be accessible with the scripting too.

After some Google searching I found a very interesting resource by Michael Kwaƛnicki. The idea of accessing the files in the iPhoto library package directly using the information in the SQLite database is brilliant. The script bellow creates the "iPhoto export" folder under the users's "Downloads"and saves all events each to the separate folder  having the media files ordered by name.

Download: export all iphoto events.applescript (4 KB) [2010-09-07]

Sunday, July 4, 2010

Mac OS 10.6.4 on Asus X51L notebook

Standard installation process:
  1. Booting up with iBoot.
  2. Installing the Mac OS Retail 10.6.3
  3. Updating to 10.6.4 with update combo
  4. Running the Multibeast with the following options on:
    • Easybeast for supported CPU
    • Voodoo PS/2 Controller with Trackpad Support

My version of the notebook has a hardware bug that prevents the integrated display to be identified correctly during the cold boot. Its native resolution is 1280x800 while it usually boots up with 1280x768. The desktop is not stretched to 800 pixels so the bottom 32 pixels are filled with some rubbish. Such behavior is observed even during the hot reboots so I could not figure out what caused it. Examining the /var/log/windowserver.log file I discovered how the display is identified when everything goes fine:

Jul 05 17:41:51  [57]   Display 0x2be05d00: MappedDisplay Unit 0; Vendor 0x6af Model 0x8174 S/N 0; online enabled built-in (0,0)[1280 x 800], Rotation 0, base addr 0x102000000

 and when it fails:

Jul 05 17:38:03  [54]   Display 0x5b81c5c0: MappedDisplay Unit 0; Vendor 0x756e6b6e Model 0x717 S/N 0; online enabled built-in (0,0)[1280 x 768], Rotation 0, base addr 0x102000000

In failed case the vendor and model numbers are 0x756e6b6e and 0x717 respectively so to solve the problem I modified a display override file with the correct EDID data at /System/Library/Displays/Overrides/DisplayVendorID-756e6b6e/DisplayProductID-717

The EDID was got with the following command:

ioreg -l -w 0 |grep EDID

Using the PlistEditPro application I modified the DisplayProductID-717 changing the DisplayProductID and DisplayVendorID to the correct values. IODisplayEDID saves the EDID data. The result override file follows:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DisplayProductID</key>
<integer>33140</integer>
<key>DisplayProductName</key>
<string>Asus X51L 1280x800x32 integrated display</string>
<key>DisplayVendorID</key>
<integer>1711</integer>
<key>IODisplayEDID</key>
<data>
AP///////wAGr3SBAAAAAAEQAQOAIRV4Chz1l1hQjicnUFQAAAABAQEBAQEBAQEBAQEB
AQEBxxsAoFAgFzAwIDYAS88QAAAYAAAADwAAAAAAAAAAAAAAAAAgAAAA/gBBVU8KICAg
ICAgICAgAAAA/gBCMTU0RVcwOCBWMSAKAEM=
</data>
</dict>
</plist>

The ALC660 codec came up online after the VoodooHDA 0.2.6.2 installation.

The WiFi card does not work, the Atheros 5007 is not supported. There are rumors that there is a way to make it run but it appears to be very unstable. Guess I need to buy a new USB dongle for it or replace the internal card with some supported PCI-express option (Broadcom BCM94321MC).


The SleepEnabler.kext was installed to let the system go into the sleep mode correctly. Still cannot resolve the problem to make the video turn the display on after wake up....

Thursday, May 27, 2010

Custom SSL certificate for Apache

  1. Generate a Private Key:
  2. openssl genrsa -des3 -out server.key 1024
  3. Generate a CSR (Certificate Signing Request):
  4. openssl req -new -key server.key -out server.csr
  5. Remove Passphrase from Key:
  6. cp server.key server.key.org openssl rsa -in server.key.org -out server.key
  7. Generate a Self-Signed Certificate for 5 years:
  8. openssl x509 -req -days 1825 -in server.csr -signkey server.key -out server.crt
  9. Installing the Private Key and Certificate:
  10. cp server.crt /usr/local/apache/conf/ssl.crt cp server.key /usr/local/apache/conf/ssl.key
  11. Configuring SSL Enabled Virtual Hosts in Apache:
  12. SSLEngine on SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key

Tuesday, May 25, 2010

PHP XDebug set up on MacOS

We are going to use the pre-compiled binaries by Komodo. Copy the xdebug.so matching the installed php version to /usr/lib/php/extensions/no-debug-non-zts-200xxxxx directory.

The following lines should be appended to the /etc/php.ini :


[xdebug]
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-200xxxxx/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_aggregate = Off
xdebug.profiler_append = Off
xdebug.profiler_enable = Off
xdebug.profiler_enable_trigger = Off

Monday, May 24, 2010

Display hidden files in Finder

FinderHiddenFiles

#!/bin/sh
if [ "$1" == 'off' ]
then
  PARAM=FALSE
else
  PARAM=TRUE
fi

defaults write com.apple.finder AppleShowAllFiles $PARAM 
killall Finder 
 
to display the hidden files run
  FinderHiddenFiles

to display the hidden files run
  FinderHiddenFiles off

Wednesday, May 19, 2010

Canon MP-140 cartridge counter reset


Second time refilling the cartridge I realized how inconvenient it has become not seeing how much ink is left in the tank. Google suggested several ways of reseting the left ink counters but no one worked for my MP-140. Finally I found the method. AFAIK this is a standard factory reset operation and is absolutely harmless:

  1. Disconnect the printer’s power cord.
  2. Press and hold down the power button while connecting the power outlet back.
  3. While still holding down the power button press the reset button twice.
  4. Release the power button.
  5. Wait until the printer boot-up is complete. Usually it  takes up to 10-15 seconds. Copy counter display should come up with .
  6. Press "+" button to change the value on the display from 0 to 1.
  7. Press Colour button; this will light up two leds.
  8. Feed the printer with paper.
  9. Press the power button, the Colour button then the Reset button by turn. The device will print out a factory test page.
  10. After the test page is out the display returns to zero.
  11. Open the printer lid and remove the cartridges.
  12. With the printer still open, disconnect the power cord.
  13. Close the lid, re-connect the printer to the power and turn it on.
  14. Refilled cartridges may now be inserted back. The driver ink status window should display both cartridges full.
This method seems to be a complete factory reset which probably clears the waste ink absorber counter as well as the counter of the platen waste ink absorber.