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.