osx

Determine physical mem size programmatically on OSX

We're trying to find out how much physical memory is installed in a machine running Mac OS X. We've found the BSD function sysctl(). The problem is this function wants to return a 32 bit value but some Macs are able to address up to 32 GB which will not fit in a 32 bit value. (Actually even 4 GB won't fit in a 32 bit value.) Is there ano...

Compile OpenCV on Mac with FFMPEG instead of Quicktime

...

Problems on select module on Python 2.5

I have an application in Python 2.5 that listens to a beanstalk queue. It works fine on all machines I tested so far, except from my newly acquired MacBook Pro. On that computer, when I try to run it I get this error: Traceback (most recent call last): File "jobs.py", line 181, in <module> Jobs().start() File "jobs.py", line 1...

How would I get a cron job to run every 30 minutes?

I'm looking to add a crontab entry to execute a script every 30 minutes, on the hour and 30 minutes past the hour or something close. I have the following, but it doesn't seem to run on 0. */30 * * * * What string do I need to use? The cron is running on OSX. ...

Differences in the Mac system_profiler

I am using system_profiler to view the USB hardware details connected to a Mac, however there are some differences between running this on Mac OS X 10.4 and 10.5. For example, in 10.5 the keys for various attributes have an alphabet letter prefix. More importantly, I can't get the location_id attribute (in the SPUSBDataType dataType) in ...

Platforms for running memcached

Is there any reason in particular why it's recommended to run memcached on a Linux server? Is it really that bad an idea to run it on a Windows Server box? What about an OS X Server box? The biggest reason that I read is about TCO. In other words, for each windows box that we run memcached on, we have to buy a copy of Windows Server ...

Why does lseek return 0?

lseek() is supposed to return the position of the file descriptor. The documentation says: Upon successful completion, lseek() returns the resulting offset location as measured in bytes from the beginning of the file. Otherwise, a value of -1 is returned and errno is set to indicate the error. Trouble is, not even ...

Is it possible to get the output of ioreg in a more easily parse-able format?

I need to get the output of ioreg in Mac OS X for further processing, however the tree like structure it uses is difficult to parse? Is there any way to get the output in XML or something easier to parse (like system_profiler)? +-o Root <class IORegistryEntry, retain 12> | { | ... | } | +-o MacBookPro5,1 <class IOPlatform...

Best VM software for Mac OS X?

What is considered the best VM system under Mac OS X for running Windows and Linux? I'd like to setup a MacBook as a one stop shop for OS testing and light purposes, primarily for cross OS/browser web testing and related tasks. Currently using Bootcamp to support Windows 7 and Mac OS X, but if I want to add more OSes, what is the best ...

How can I perform the equivalent of shellexecute() in Lazarus for a Mac?

How can I perform the equivalent of shellexecute() in Lazarus for a Mac? ...

It really looks like OS X has a bug when using poll() on a named pipe (FIFO)... can an expert confirm?

I'm been trying to poll from a set of named-pipes for a little while now and i keep getting an immediate response of POLLNVAL on any named pipe file descriptor. After finding this blog post about broken polling in OS X I'm pretty certain that this is a b-u-g bug in OS X. I'm already planning on switching my code to using UDP sockets, b...

mprotect API on tiger!

I'm trying to use mprotect API on MacOSX 10.4 (tiger), I tried every possible way i know , it always returns -1, with errno 13, which means "permission denied" while I'm trying to add the write permission to some executable code. The same code exactly works on MacOS X 10.5 (leopard). the code is pretty simple int ret = mprotect((void*...

Can SVN handle case sensitivity issues?

Is there a way to force SVN to be case insensitive? We have an issue where a user commits from a linux environment with files say "file.ext" and "File.ext". Works just fine. The problem, however, is when a user on a MAC OSX or Windows attempts an update/checkout. The two files are considered the same and the action fails in error. ...

register a protocol on mac osx?

I have done it in windows, how do i register a protocol on mac osx. I want to click links in firefox (a href="somename://mylinkAndData") and launch a binary? ...

Creating dtrace probes for plugins using single provider name

Note that this is for Mac OS X, although I imagine my problem would exist on any dtrace-capable OS. I have an app that utilizes a lot of plugins. I'm adding userland probes to it, in both the core application and in the plugins themselves. The issue is that if I use the same provider name in the plugins that the main app is using, tho...

Recommendations for Python development on a Mac?

I bought a low-end MacBook about a month ago and am finally getting around to configuring it for Python. I've done most of my Python work in Windows up until now, and am finding the choices for OS X a little daunting. It looks like there are at least five options to use for Python development: "Stock" Apple Python MacPython Fink MacPor...

Finding usb drive paths in Mac OS 10.4

The system_profiler command in Mac OS 10.5 shows the mounted volume paths for the associated USB drives. In 10.4, however, they are not shown. Any ideas on how I can get the mount location for USB drives in 10.4? ...

Command line command to auto-kill a command after a certain amount of time.

I'd like to automatically kill a command after a certain amount of time. I have in mind an interface like this: % constrain 300 ./foo args Which would run "./foo" with "args" but automatically kill it if it's still running after 5 minutes. It might be useful to generalize the idea to other constraints, such as autokilling a process ...

How to spoof an ethernet MAC address of the wired ethernet interface coming with MacBookPro and Leopard 10.5.6?

With OSX 10.5. it's no longer possible to spoof MAC addresses of your wired interface (e.g. en0) with "ifconfig en0 laddr/ether XX:YY:...." a/ why is that? b/ how is it notwithstanding done by e.g. VMware "vmnet-xxx" deamons? c/ does anyone know wether the Apple Developer package contains detailed and useful information regarding t...

Fonts for Carbon OpenGL app on OS X

Hi, I'm trying to add text rendering to a Carbon OpenGL app I'm developing for OS X. Since the aglUseFont is now deprecated, I'm looking for another way to add text as well as be able to query the glyph properties (i.e. width, height, spacing, etc) So far I've investigated CoreText and ATSUI but both without much luck. Please help me...