Associate an iphone app for kml and kmz google earth files - ios4

I'm trying to write an iOS app that should be able to open kml and kmz files from google earth.
I have added the following lines in the cfg file , but should be wrong ( I can't see my application listed when I try to open a kml file from another app, i.e. Mail) :
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/vnd.google-earth.kml+xml</string>
</array>
<key>CFBundleTypeExtensions</key>
<array>
<string>kml</string>
</array>
<key>CFBundleTypeName</key>
<string>Google Kml</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
</dict>
</array>
Please help me to find the error...

Add these lines to Info.plist:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>CFBundleTypeName</key>
<string>Google Earth KML Document</string>
<key>LSItemContentTypes</key>
<array>
<string>com.google.earth.kml</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
</array>
<key>UTTypeDescription</key>
<string>Google Earth KML Document</string>
<key>UTTypeIdentifier</key>
<string>com.google.earth.kml</string>
<key>UTTypeReferenceURL</key>
<string>http://earth.google.com/kml/</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>com.apple.ostype</key>
<string>GKml</string>
<key>public.filename-extension</key>
<array>
<string>kml</string>
</array>
<key>public.mime-type</key>
<string>application/vnd.google-earth.kml+xml</string>
</dict>
</dict>
</array>

Related

OSX launchctl , how to stop a job upon unload

Currently I am starting aGhost npm server using forever and a LaunchAgent
<?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>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>rhino.forever.ghost</string>
<key>ProgramArguments</key>
<array>
<string>..../bin/node</string>
<string>..../bin/forever</string>
<string>start</string
<string>-w</string>
<string>..../index.js</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
starting it with :
launchctl load -w ~/Library/LaunchAgents/rhino.forever.ghost.plist
But it does not stop when unloading it :
launchctl unload ~/Library/LaunchAgents/rhino.forever.ghost.plist
Is there anyway to stop it when unloading ???
thanks for feedback
I resolved to start | stop | restart my ghost app 'rhino' with aliases in .bash_aliases
alias rhino.dev.start="nginx.start;
cd /Users/..../myghostapp;
~/.../bin/forever start -aw --uid 'rhino' index.js;
forever list"
alias rhino.dev.stop="forever stop 'rhino' ; nginx.stop"
alias rhino.dev.restart="forever restart 'rhino' ; nginx.restart"
running fine now

Running a node.js script with launchd

I'm trying to run a web scraper I made with node.js. node app.js runs the file successfully, but I cannot get launchd to run the script. Here is my plist file:
<?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>Label</key>
<string>com.username.kijijiscraper</string>
<key>Program</key>
<string>/usr/local/bin/node</string>
<key>ProgramArguments</key>
<array>
<string>/Users/username/documents/nodeprojects/scraper/app.js</string>
</array>
<key>StandardOutPath</key>
<string>/Users/username/documents/nodeprojects/scraper/launchdOutput.log</string>
<key>StandardErrorPath</key>
<string>/Users/username/documents/nodeprojects/scraper/launchdErrors.log</string>
</dict>
</plist>
I then load it with launchctl load /Users/username/library/launchagents/com.username.kijijiscraper.plist which is where the plist file is saved.
Eventually it will be run on an interval, but for now I'm trying to test it with launchctl start com.username.kijijiscraper.
The expected behaviour - receiving an email based on the result of the scrape - doesn't happen, and no errors are in the log file. Again, the webscraper works from the terminal.
You need start the service by:
launchctl start com.username.kijijiscraper
after load plist, or just append this:
<key>RunAtLoad</key>
<true/>
and this if you need:
<key>KeepAlive</key>
<true/>

Where is init folder in macs from where I can load my .conf file based jobs

I just migrated from linux, and trying to run one of my solutions in mac,
at my linux i had a .conf files while was used to change the "run level" and start a supervisor job at the start of machine.
Is there a similar implementation somewhere at the mac as well, if not then what's the alternative.
my .conf based job was used to look like this
description "myJob"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec supervisord --nodaemon --configuration <path to my config file>
The closest equivalent on OS X would be a launch daemon -- a property list file in /Library/LaunchDaemons that tells launchd when to launch your program. If I understand what your .conf file does, the equivalent would be something like this:
<?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>Label</key>
<string>local.myJob</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/your/script</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Name that local.myJob.plist, put it in /Library/LaunchDaemons, set the owner to root and permissions to 644, and then either reboot or load it with sudo launchctl load /Library/LaunchDaemons/local.myJob.plist.
See man launchd.plist and Apple's developer document "Creating Launch Daemons and Agents"for more info and options. You can also look at the Apple-provided daemons in /System/Library/LaunchDaemons for more examples.

Where is CRT in generated manifest for VC10?

I use Visual Studio 2010 Premium for create test binary console application project.
I use:
Functions from C-runtime like feof, getchar
Use Multi-threaded Debug DLL (/MDd)Code generation mode
But in output generated manifest I'm only receive this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
I want to force client use only version of CRT on which the application was built. And use for it
SxS feature.
Q1: How I can I append this version info to manifest ?
I don't see any *.manifest templates in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\"
Q2: Is it possible to view %windir%\winsxs with some tool like gacutil for .net ?

Running selenium bash script from an osx daemon

I have created a bash file that will kick off testing my website in Safari using selenium. I would like to have to instance occur every night at 5:55pm. To do so I have created a daemon in in /System/Library/LaunchDaemons. For some reason I never see the bash script start my selenium code. I'm wondering if anyone has had any experience with this? When I run my selenium bash script safari will open and my automated tests will run fine. I'm just a little confused why the same thing is not happening when calling the bash script from a daemon. I have already started the daemon using launchctl.
runselenium.plist
<?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>Label</key>
<string>com.runselenium.daemon</string>
<key>ProgramArguments</key>
<array>
<string>bash</string>
<string>/Users/admin/Desktop/workspace/runSelenium.bash</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>17</integer>
<key>Minute</key>
<integer>55</integer>
</dict>
</dict>
</plist>
runSelenium.bash
#!/bin/bash
source /Users/admin/Desktop/workspace/set-selenium-classpath.bash
java selenium.Main
The current error I am seeing in the console is com.apple.launchd: (com.runselenium.daemon[479]) Exited with code: 1
The deamon does not use your environment settings, specifically your user PATH. Make sure your script explicitly defines everything: PATH (or use only global paths), variables, etc. If this does not work, post your script and any errors.

Resources