osx-yosemite

Mac Apache web server won't start anymore and can't find any web directories

别说谁变了你拦得住时间么 提交于 2019-12-06 01:38:49
问题 I'm on Mac Yosemite 10.10.5. Apache web server suddenly no longer starts. I tried changing the port to 8080. Also tried sudo apachectl stop and sudo apachectl start. Still won't open. I thought this may have happened after adding a new printer and enabling print sharing. I turned that off and it still won't start. I can't remember which command I ran that gave me this message with some more details. UPDATE: When I use sudo apachectl start , I noticed the server is accessible through the

OS X Applescript to Check if Drive Mounted and Mount It If Not

左心房为你撑大大i 提交于 2019-12-06 00:18:55
I am trying to write an AppleScript that will check if a network drive (in this case, my Time Capsule) is mounted and, if not, mount it. I've figured out how to mount the Time Capsule, but I am at a loss over how to have the script check whether it is mounted first and just exit if it is, or mount it if not. tell application "Finder" mount volume "afp://AirPort%20Time%20Capsule._afpovertcp._tcp.local" end tell Does that the job? set mountedDiskName to "AirPort Time Capsule" set diskIsMounted to false tell application "System Events" to set diskNames to name of every disk if mountedDiskName is

Preserving aliases over OSX ssh rsync

折月煮酒 提交于 2019-12-05 22:51:07
I'm having a devil of a time preserving aliases with rsync over ssh on OSX (Yosemite) rsync -av -e ssh me@N.N.N.N:/Users/me/stuff/ /Users/me/stuff does not preserve aliases. It makes an alias on the destination... but it doesn't point to the original file (on the destination). Firing up a Finder window, turning on File Sharing on the source, and drag and dropping preserves aliases, but that's the only way I've figured out how to do this so far, and I would prefer a non-GUI solution. Would something besides rsync work over ssh? I've tried both native OSX rsync as well as Homebrew's. Thanks

nohup doesn't work with OS X Yosmite - get error “can't detach from console no such file or directory”

坚强是说给别人听的谎言 提交于 2019-12-05 19:13:48
问题 I use nohup to run a command from a php application (I have a web page that sends POST request to php server to start a shell script in background). It's something like exec('nohup /home/user/test.sh > /home/user/test.log 2>&1 &') This worked fine when I was using OS X Snow Leopard (OS X 10.6). However, recently I upgraded my MAC to OS X Yosemite (OS X 10.10) and now it doesn't work any more. In the test.log, I always get the message: nohup can't detach from console: no such file or directory

NSURLThumbnailDictionaryKey empty for local file

怎甘沉沦 提交于 2019-12-05 17:39:54
I want to get a thumbnail representation of a file I have to display in my app. I'm using NSURL here: NSDictionary *thumbnails = nil; BOOL success = [fileURL getResourceValue:&thumbnails forKey:NSURLThumbnailDictionaryKey error: &error]; This works fine if I am connected to iCloud, and the URL is a link to a file stored in iCloud. The fileURL is something like: file:///Users/me/Library/Mobile%20Documents/BJXXGLR9R3~com~myapp~icloud/FileStorage/contact-page%20copy.png If I use the same code with a NSURL pointing to a local file, however, the thumbnails dictionary is empty. Here is an example of

How do I change the WKWebview's user agent in OS X Yosemite?

余生颓废 提交于 2019-12-05 17:12:28
问题 How do you change the user agent used by WKWebview ? With the older WebView , I could write the following to change the user agent: [myWebView setCustomUserAgent:@"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.77.4 (KHTML,like Gecko) Version/7.0.5 Safari/537.77.4"]; 回答1: Very simple in Swift. Just place the following into your App Delegate didFinishLaunchingWithOptions . NSUserDefaults.standardUserDefaults().registerDefaults(["UserAgent" : "Custom Agent"]) If you want to

How does Mac OSX determine which dylib to load?

烂漫一生 提交于 2019-12-05 16:19:30
I'm trying to run Apache in Mac OSX Yosemite using MacPorts' PHP (mod_php53.so). Note that I'm not using MacPorts' Apache but Yosemite's Apache with MacPorts' PHP. This was working fine with OSX Mavericks and Mountain Lion in the past. I get this error when running /usr/sbin/apachectl -t in Yosemite: httpd: Syntax error on line 228 of /private/etc/apache2/httpd.conf: Cannot load /opt/local/apache2/modules/mod_php53.so into server: dlopen(/opt/local/apache2/modules/mod_php53.so, 10): Library not loaded: /opt/local/lib/libaprutil-1.0.dylib\n Referenced from: /opt/local/apache2/modules/mod_php53

Alien::wxWidgets install fails on OSX10.10

爱⌒轻易说出口 提交于 2019-12-05 15:40:32
I'm trying to install Alien::wxWidgets version 0.67 with wxWidgets version 3.0.2, but no matter what I do, I get the following error: checking if C compiler (clang -mmacosx-version-min=10.5) works with SDK/version options... configure: error: in `/Users/David/.cpan/build/Alien-wxWidgets-0.67-GGkXTu/wxWidgets-3.0.2/bld': configure: error: no. Try a different SDK See `config.log' for more details system: echo exit | sh ../configure --prefix=/Users/David/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/Alien/wxWidgets/osx_cocoa_3_0_2_uni --with-osx_cocoa --with-opengl --disable

M2_HOME not working in IntelliJ on OSX 10.10.1 Yosemite

孤街醉人 提交于 2019-12-05 14:43:23
ive tried : echo $M2_HOME /usr/local/apache-maven-3.2.3 seemd like M2_HOME is set and the file /etc/launchd.conf looks like this: setenv $M2_HOME /usr/local/apache-maven-3.2.3 ive restarted the mac and still nothing works ... any idea ? checkout : "and the file /etc/launchd.conf looks like this:" change : setenv $M2_HOME /usr/local/apache-maven-3.2.3 to setenv M2_HOME /usr/local/apache-maven-3.2.3 Create new file /Library/LaunchDaemons/setenv.M2_HOME.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

NSWindowController Autosave using Storyboard

爱⌒轻易说出口 提交于 2019-12-05 13:52:56
问题 I have a Swift application that is launching a simple NSWindow , like so: func applicationDidFinishLaunching(notification: NSNotification!) { let storyboard = NSStoryboard(name: "MainStoryboard", bundle: NSBundle.mainBundle()) windowController = storyboard.instantiateInitialController() as? NSWindowController windowController?.showWindow(self) } This works great, my app launches and the window appears. However : The size is always the same. In the storyboard, I have specified an Autosave name