Wednesday, November 7, 2007

self-signed certificate with multiple DNS names (aka subjectAltName)

following [1] and adding
subjectAltName = DNS:PROBABLY_YOUR_COMMONNAME,DNS:*.SOME_DOMAIN_NAME
to the [ v3_ca ] section of your openssl.cnf file should do the trick.

unfortunately, the DNS:copy:commonName didn't work for me...


references:
  1. http://www.debian-administration.org/articles/284
  2. http://reductivelabs.com/trac/puppet/wiki/MultipleCertificateAuthorities
  3. http://wiki.cacert.org/wiki/VhostTaskForce

Tuesday, November 6, 2007

OS X Leopard and broadcasted cups printers - no Shared Printers

for whatever reason - and it might be that bonjour should become the preferred method - printers broadcasted from a cups print server don't show up in OS X 10.5 it is annoying in case one just wants to print (without fiddling around with the cups server)...

for the moment the solution seems to be to add
BrowseProtocols cups
to /etc/cups/cupsd.conf (e.g. after BrowseAllow all). in case you know what you are doing
sudo killall -HUP cupsd
restarts the printing service (aka cupsd). the references also show a way of doing all this via cups' web interface (on http://localhost:631)...

nevertheless, you will have to add the 'Shared Printer' via 'Printer & Fax' - just that now the printers from the cups server will show up.

references:
  1. http://mcdevzone.com/2007/10/28/printer-fix-for-leopard
  2. http://discussions.apple.com/thread.jspa?threadID=1203691
  3. http://forums.macrumors.com/showthread.php?t=382577

Sunday, November 4, 2007

Matlab: Undefined function or method 'propertyeditor' for input arguments of type

launching matlab, typing 'figure', menu: View->Property Editor, and then
> ??? Undefined function or method 'propertyeditor' for input arguments of type
> 'double'.
> Error in ==> viewmenufcn at 43
> propertyeditor (hfig, 'toggle')
> ??? Error while evaluating uimenu Callback
found a thread - and a solution: http://groups.google.com/group/comp.soft-sys.matlab/...

> [...] In my case the following folder was missing:
> "$MATLAB\toolbox\matlab\plottools"
>

did help here, too. strangely enough the error occurred only for certain users - even after they had deleted their ~/.matlab directory...

iSync.app (or rather SyncServices) doesn't sync CalDAV calendars

i have some calendars on an Apple CalendarServer and edit them via iCal.app, Thunderbird/Lightning, and a Web Interface - all fine - and synchronization with my phone is done on the mac via iSync.

problem is that i cannot select any of the CalDAV calendars as target to "Put events created on my phone into". as long as i have no dummy local calendar i cannot select to sync calendars at all.

might be a shortcoming of the SyncServices...

references:
  1. http://discussions.apple.com/thread.jspa?threadID=1213588&tstart=0

iSync.app dosn't show calendars (or shows them but won't sync 'em)

i was playing around with the CalDAV support in Leopard's new iCal.app - subscribing to CalDAV servers, WebDAV servers, publishing, deleting them again, etc. in the end i could see, edit, and update most of the calendars i wanted to. unfortunately, i couldn't sync them to my phone...

because:
calendars didn't show up in the iSync dialogue for my phone or
calendars showed up in the dialogue but just didn't sync


i cannot say i have a 'real' solution but at least things work again...

as the data of the calendars was not (i repeat NOT) stored locally i could just delete everything that seemed faintly related to iCal.app, iSync.app, my phone or SyncServices, i.e. i deleted the following files/directories...
~/Library/Preferences/com.apple.iCal*
~/Library/Preferences/com.apple.isync*
~/Library/Preferences/iCalExternalSync.plist
~/Library/Preferences/ByHost/com.apple.syncservices*
~/Library/Preferences/ByHost/com.apple.iCal.helper*
~/Library/Calendars
~/Library/Phones
~/Library/Application\ Support/iSync
~/Library/Application\ Support/SyncServices

...logged out (hm, i even rebooted) and started all over again: hooked up the CalDAV calendars into iCal.app, setup the phone for iSync.app and tried again. calendars are back and sync just fine.

Sunday, October 7, 2007

reverse lookup of names with Apple Script in Address Book.app

thought with an asterisx server on the network it should be possible to get incoming calls signaled on the mac - with Address Book.app lookup for names and pictures...

incoming (ISDN) calls are handled by the chan_capi module and then notified via app_notify
  • at the end of extensions.conf something like the following has to go (put in values for MSN and HOSTNAME_TO_BE_NOTIFIED)
[capi-in]
exten => MSN,1,Notify(${CALLERID(num)}|${CALLERID(name)}|${EXTEN}/HOSTNAME_TO_BE_NOTIFIED)
exten => MSN,2,Wait(120)
exten => MSN,3,Hangup()

update (9/11/2007):
i had a wrong Notify call in my extensions.conf and that was why the notification part didn't work... the AppleScript, still, exemplifies a lookup in Addressbook.app for a given number.
 
the OS X client comes from the same page, however for me the notification part with Address Book.app lookup didn't work. to have growl notification i then put an AppleScript into Library/Application Support/AsteriskNotifier/Scripts

global callerName, callerNumber, callerImg

-- notification("01792259314||4066585")
-- notification("||4066585")

on notification(message)
  
  -- message comes in "${CALLERID(num)}|${CALLERID(name)}|${EXTEN}"
  set the text item delimiters to {"|"}
  
  -- first the number
  set callerNumber to text item 1 of message
  
  -- second the name - if available
  if (text item 2 of message) is not equal to "" then
    set callerName to text item 2 of message
  else
    set callerName to "Unknown"
  end if
  
  -- third the number that was called
  set calledNumber to text item 3 of message
  
  -- for further reference...
  set callerImg to null
  
  set the text item delimiters to {" "}
  
  if callerNumber is not equal to "" then
    
    -- this is necessary if the number in Address Book.app is in a different format
    -- e.g. "034567890" doesn't match "+12 (345) 67890"
    set lookForNum to callerNumber
    set lookForNum to my trim_line(lookForNum, "00", 0)
    set lookForNum to my trim_line(lookForNum, "0", 0)
    
    tell application "Address Book"
      
      set found to false
      set phoneNums to {}
      
      repeat with loopPerson in people
        
        set PhoneNumsCount to (count every phone of loopPerson)
        repeat with i from 1 to PhoneNumsCount
          set phoneNum to (get value of phone i of loopPerson)
          
          set newString to my remove_specialChars(phoneNum)
          
          ignoring white space
            if newString contains lookForNum then
              -- beep
              -- display dialog phoneNum as string
              set phoneNums to phone i of loopPerson
              set callerNumber to phoneNum
              
              if callerName is not equal to "Unknown" then
                set callerName to first name of loopPerson & " " & last name of loopPerson
              end if
              
              if image of loopPerson exists then set callerImg to image of loopPerson
              exit repeat
            end if
          end ignoring
          
        end repeat
        
        if phoneNums is not {} then
          set found to true
          exit repeat
        end if
      end repeat
      
      -- if found then
      --  activate
      --  set selection to loopPerson
      -- end if
      
    end tell
    
  end if
  
  tell application "GrowlHelperApp"
    -- Make a list of all the notification types
    -- that this script will ever send:
    set the allNotificationsList to ¬
      {"Incoming Call"}
    
    -- Make a list of the notifications
    -- that will be enabled by default.
    -- Those not enabled by default can be enabled later
    -- in the 'Applications' tab of the growl prefpane.
    set the enabledNotificationsList to ¬
      {"Incoming Call"}
    
    -- Register our script with growl.
    -- You can optionally (as here) set a default icon
    -- for this script's notifications.
    register as application ¬
      "Asterisk Notification" all notifications allNotificationsList ¬
      default notifications enabledNotificationsList ¬
      
    -- Send a Notification...
    
    if callerImg is not null then
      notify with name ¬
        "Incoming Call" title ¬
        callerName & " @ " & (time string of (current date)) description ¬
        callerNumber as string application name ¬
        "Asterisk Notification" image (callerImg)
      -- callerNumber & " on " & calledNumber
      
    else
      notify with name ¬
        "Incoming Call" title ¬
        callerName & " @ " & (time string of (current date)) description ¬
        callerNumber as string application name ¬
        "Asterisk Notification" image from location "~/Library/Application Support/AsteriskNotifier/phone.jpg"
    end if
    
  end tell
end notification


on remove_specialChars(this_text)
  set copy_flag to true
  set the clean_text to ""
  repeat with this_char in this_text
    set this_char to the contents of this_char
    if this_char is not "(" and this_char is not ")" and this_char is not "+" and this_char is not "x" and this_char is not "-" and this_char is not "_" then
      set the clean_text to the clean_text & this_char as string
    end if
  end repeat
  return the clean_text
end remove_specialChars


on trim_line(this_text, trim_chars, trim_indicator)
  -- 0 = beginning, 1 = end, 2 = both
  set x to the length of the trim_chars
  -- TRIM BEGINNING
  if the trim_indicator is in {0, 2} then
    repeat while this_text begins with the trim_chars
      try
        set this_text to characters (x + 1) thru -1 of this_text as string
      on error
        -- the text contains nothing but the trim characters
        return ""
      end try
    end repeat
  end if
  -- TRIM ENDING
  if the trim_indicator is in {1, 2} then
    repeat while this_text ends with the trim_chars
      try
        set this_text to characters 1 thru -(x + 1) of this_text as string
      on error
        -- the text contains nothing but the trim characters
        return ""
      end try
    end repeat
  end if
  return this_text
end trim_line

references:
  1. Notify application module for the Asterisk PBX: http://mezzo.net/asterisk/app_notify.html
  2. AppleScript Support for Growl: http://growl.info/documentation/applescript-support.php#usingImages

  3. http://www.apple.com/applescript/guidebook/sbrt/pgs/sbrt.07.htm
  4. http://www.faqintosh.com/risorse/en/othutil/addrbook/lookupphn/
  5. http://www.mactech.com/articles/mactech/Vol.21/21.10/ScriptingAddressBook/index.html
  6. http://www.mumbles-project.org/
  7. http://www.acm.uiuc.edu/macwarriors/workshops/applescript/1999/nutshell/control.html

Friday, October 5, 2007

Modify iWeb sites to work with Google Analytics

wanted to use Google Analytics together with iWeb & didn't want to use BBEdit, someEdit, someOtherEdit or an Automator action... as i have to sync the iWeb content anyway - why not use a little (python) script to integrate the Google snippet?

use somthing like
find iWeb/ -iname '*.html' -exec ./iWeb.py "</body>" iWeb.analytics {} {} \;
with iWeb.analytics beeing the Google snippet and iWeb.py the follwoing script. after that i use sitecopy --update [SITENAME]...
#!/usr/bin/env python
import sys,os
usage = "usage: %s searchText insertText_file [infile [outfile]]" % os.path.basename(sys.argv[0])

def init():

stext = sys.argv[1]

replaceTextFileIn = open(sys.argv[2],'r')
replaceTextFileContent = replaceTextFileIn.readlines()
replaceTextFileIn.close()

# print replaceTextFileContent

input = sys.stdin
output = sys.stdout
if len(sys.argv) > 3:
input = open(sys.argv[3])

inputContent = input.readlines()
input.close()


if len(sys.argv) > 4:
output = open(sys.argv[4], 'w')

for s in inputContent:
output.write(s.replace(stext, ''.join(replaceTextFileContent) + stext))

output.close()

if __name__ == "__main__":
if len(sys.argv)

the latest version of this script might be available from (something like):
https: / / iiegn.dyndns.org / svn / de.iiegn / _stuff / iWeb.py

references:
  1. http://www.macosxhints.com/article.php?story=20061220033306772
  2. http://www.apple.com/downloads/macosx/automator/addgoogleanalyticsaction.html
  3. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52250

ever wanted to buy a Mac...

http://www.pizdaus.com/pics/MC3KUw7uCDtL.jpg - still?

Sunday, September 30, 2007

debian, ampache, and xspf player

installed ampache (https://ampache.bountysource.com/wiki/Ampache_on_Debian) and after local play was working wanted to try xspf player:

but it seemed like the link for the temporary playlist-id did not transfer correctly - solution was to modify the trunk version of show_xspf_player.inc.php from the svn repository.

<div id="mp3player">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="400" height="170" id="xspf_player" align="middle">
<param name="pluginspage" value="http://www.macromedia.com/go/getflashplayer" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="/modules/flash/xspf_player.swf?autoplay=true&playlist_url=" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="type" value="application/x-shockwave-flash" />
<param name="width" value="400" />
<param name="height" value="170" />
<param name="name" value="xspf_player" />
<param name="align" value="middle" />
<embed src="/modules/flash/xspf_player.swf?autoplay=true&playlist_url=" quality="high" bgcolor="#ffffff" width="400" height="170" name="xspf_player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</div>

Sunday, September 9, 2007

i've been simpsonized

Have you ever wondered what I would look like as a character on The Simpsons? Never? Not even once? D'oh! Well, anyway, I would look like this:

you can give it a try at http://www.simpsonizeme.com

however, you might wonder what Burger King is going to do with all the photos, DOBs and e-mail addresses...

Thursday, September 6, 2007

port install fails with 'checksum mismatch'

wanted to install Coin with
sudo port -v install coin
but only got
---> Verifying checksum(s) for Coin
---> Checksumming Coin-2.4.6.tar.gz
Error: Checksum (md5) mismatch for Coin-2.4.6.tar.gz
Portfile checksum: Coin-2.4.6.tar.gz md5 17f9a941cec7a1b69693d240e4ac308d
Distfile checksum: Coin-2.4.6.tar.gz md5 30efbdb9c761dd9fea7a7f4a0f01a50d
Error: Checksum (sha1) mismatch for Coin-2.4.6.tar.gz
Portfile checksum: Coin-2.4.6.tar.gz sha1 8595fcc9b4669b8c58490637d577f061589dbdbb
Distfile checksum: Coin-2.4.6.tar.gz sha1 662cde2c7fd06e79f95e02aa23325d283d3294a1
checked whether my download was 'broken': downloaded Coin-2.4.6.tar.gz from different sites and - consistently - found one other checksum...

...then changed the checksum in
/opt/local/var/macports/sources/rsync.macports.org/release/ports/graphics/Coin/Portfile
(for other ports the file will be different - but somewhere in that direction...)


references:
  1. http://blog.codefront.net/2007/05/29/imagemagick-port-broken-temporarily/
  2. http://groups.google.com/group/mailing.freebsd.questions/
  3. http://trac.macports.org/projects/macports/ticket/12618 - now, that's only the bug report...

Wednesday, September 5, 2007

Umlaut characters (and others) display strangely in Terminal.app

Terminal.app behaves a bit strange - lately...

  1. äöüÄÖÜ etc. are not displayed correctly
  2. deleteing one character of the above deletes two in the terminal (i.e. hitting the keyboard once and deleting this last character moves the cursor to position -1)

some help for 1. may be found on:

GNU development under Mac OS X - TECH.inhelsinki.nl,
http://www.macosxhints.com/article.php?story=20060825071728278 and
http://groups.google.com/group/

for 2. one might have to change the Character Set Encoding for the Terminal.app (Terminal/Window Settings...) to something other than UTF-8

Saturday, September 1, 2007

booting from the network with GRUB

http://en.opensuse.org/SDB:Booting_from_the_Network_with_GRUB

SSH handler for Firefox

linux


add the following lines to user.js (in the profile folder):

user_pref("network.protocol-handler.external.ssh", true);
user_pref("network.protocol-handler.warn-external.ssh", false);
user_pref("network.protocol-handler.expose.ssh", true);
user_pref("network.protocol-handler.app.ssh", \
[noLineBreak] "/PATHTO/NAME_OF_SSHHANDLER_HELPER_SCRIPT");
ssh handler helper script
#!/usr/bin/env bash

xterm -e ssh `echo $1 | sed -e "s/ssh:\/\///"`
#
# don't forget to set the script's exectuable flag
#


windows

execute (or combine) ssh.reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ssh]
@="URL:ssh Protocol"
"URL Protocol"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ssh\DefaultIcon]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,75,00,72,00,\
6c,00,2e,00,64,00,6c,00,6c,00,2c,00,30,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ssh\shell]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ssh\shell\open]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ssh\shell\open\command]
@="c:\\Program Files\\SSH Communications Security\\ \
[noLineBreak] SSH Secure Shell for Workstations\\Sshhandler.cmd \"%1\""

save ssh.cmd in (e.g.) c:\Program Files\SSH Communications Security\SSH Secure Shell for Workstations\Sshhandler.cmd

@echo off
@FOR /F "tokens=2,3 delims=/@" %%a IN ("%~1") DO \
"c:\Program Files\SSH Secure Shell for Workstations\SSH Secure Shell for Workstations\ \
[noLineBreak] SshClient.exe" -u "%%a" -h "%%b"

rem ...DO start SshClient.exe - without quotes - works better;
rem but how does the path go into there without quotes...?

in case it doesn't work add the following lines to user.js:

user_pref("network.protocol-handler.external.ssh", true);
user_pref("network.protocol-handler.warn-external.ssh", false);
user_pref("network.protocol-handler.expose.ssh", true);

i happily give credit for this - and particularly the windows integration - to martisch_AT_uos.de (www.waldwolf.net)