Index:


OS X

  • Making Avocent KVM work under OS X.

    The promise of Java was “Write once, run anywhere” (WORA), or more aptly, “Write once, run everywhere” (WORE).

    Unfortunately, because Oracle, it is more “Write once, spend days beating head against the latest random platform changes, curse, poke at random things, eventually get it to kinda work.”

    There is a definite correlation to things made by the Sirius Cybernetics Corporation:

    It is very easy to be blinded to the essential uselessness of them by the sense of achievement you get from getting them to work at all

    In other words – and this is the rock solid principle on which the whole of the Corporation’s Galaxy-wide success is founded – their fundamental design flaws are completely hidden by their superficial design flaws.” — Douglas Adams.

     

    Anyway, if you are still reading and determined to get your Avocent DSR1030 / DSR2030 / DSR4030 / DSR 8030 working under OS X, this worked for me (under the specific build of Java on the specific version of OS X, etc. YMMV):

    Edit: “/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/security/java.security”

    Comment out:

    jdk.certpath.disabledAlgorithms=MD2, MD5, SHA1 jdkCA & usage TLSServer, \
    RSA keySize < 1024, DSA keySize < 1024, EC keySize < 224
    jdk.tls.disabledAlgorithms=SSLv3, RC4, MD5withRSA, DH keySize < 1024, \
     EC keySize < 224, DES40_CBC, RC4_40, 3DES_EDE_CBC

    and insert:

    jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024, DSA keySize < 768, EC keySize < 224
    jdk.tls.disabledAlgorithms=SSLv3, RC4, DH keySize < 768, EC keySize < 224, DES40_CBC, RC4_40, 3DES_EDE_CBC

    Note that this changes the DSA keySize parameter from requiring 1024bit or longer to allowing 768 bit. This is not great security practice, but I only use Java for this app, and so I’ve decided it is a tradeoff I’m willing to make. In theory, this could be configured with a wrapper script (or possibly handing in -D options on the CLI), but Java (and Avocent) has made my sufficiently annoyed that I’m not willing to spend more time on this.

     

  • Making OpenVPN Connect Client allow profile import

    OpenVPN Access Server gives users a nice, preconfigured .dmg, which includes a profile for connecting to the server. Unfortunatly this client is configured to be very basic, and does not allow for importing profiles.

    This can be configured from the access-server, but it is often nicer to be able to do this on a per-client basis (with the “basic_client” parameter). This is how to do it on OS X.

    To get status: 
    /Library/Frameworks/OpenVPN.framework/Versions/Current/bin/capicli GetPreferences

     

    To allow adding profiles:
    /Library/Frameworks/OpenVPN.framework/Versions/Current/bin/capicli -k basic_client -v false SetPreference

  • OS X: Making certain folders / files visible in the Finder

    There are some files and folders that OS X hides by default in the Finder. You can still get to them by chosing Go -> Go to Folder… and then typing the folder path (because Macs rule, Tab Completion works here!). You can also toggle all visibility on and off in the finder (see Showing all files in Finder), but sometimes you’d like a specific folder or file to be visible.

    SetFile to the rescue!

    From the man page:

    DESCRIPTION
    /usr/bin/SetFile is a tool to set the file attributes on files in an HFS+ directory. It attempts to be simi-
    lar to the setfile command in MPW. It can apply rules to more than one file with the options applying to all
    files listed.

    So, 

    sudo SetFile -a v /Volumes

    will make the /Volumes folder visible in the finder.

  • OS X: Showing or hiding all files in the Finder

    OS X / Mountain Lion hides a number of files from you, to help keep things tidier, and help make sure you don’t accidentally delete anything too important.  Most of the time this is useful, but sometimes it would be more convenient to be able to see all files.  

    The view all files Finder option can be change by setting the com.apple.finder option, called, unsurprisingly AppleShowAllFiles
    I have a short shell script:

    #!/bin/bash
    defaults write com.apple.finder AppleShowAllFiles TRUE
    killall Finder

    and to turn it off:

    #!/bin/bash
    defaults write com.apple.finder AppleShowAllFiles FALSE
    killall Finder

     
  • Making OS X Lion use search paths.

    Apple changed the behavior of DNS search list processing in Lion (OS X Lion: About search domains and name lookups). 

    This makes it differ from the behavior listed in RFC1536. If you need / prefer the RFC-compliant search path processing, add the -AlwaysAppendSearchDomains argument to the /usr/sbin/mDNSResponder process in /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

    So:

                <key>ProgramArguments</key>
            <array>
                    <string>/usr/sbin/mDNSResponder</string>
                    <string>-launchd</string>
                    <string>-AlwaysAppendSearchDomains</string>
                    <string>-NoMulticastAdvertisements</string>
            </array>
    
  • OS X: Displaying an alert box on command completion

    In order to pop up an alert box on a Mac when a command finishes running, you can use this little bit of Applescript:

    ssh devbox longrunningcommand && osascript -e 'tell application "Terminal" to display dialog "Your job is done"'