Category Archives: Mac

hombrew: brew install gxargs

The xargs utility on Mac is not the same as the one on linux. In particular, searching for files with the mdfind utility will not properly escape files to be processed. Using homebrew you can install the GNU version of xargs as gxargs, and you can use the syntax you’re accustomed to from GNU/Linux. For me this is equivalent to something like: mdfind -name “conflicted copy” | gxargs -d ‘\n’ -P 4 echo To remove the files you can then replace echo with rm – but be careful!

Posted in Mac | Tagged , | Leave a comment

Stay.app’s “Restore All Windows” command from Applescript

If you want to use applescript to run cordlessdog.com‘s Stay.app command “Restore All Windows” command from Applescript, here is how to do it: tell application “Stay” set resultBoolean to restore all windows end tell Stay.app supports 5 applescript commands which are: restore active application windows restore all windows store active application windows store active window store all windows

Posted in Mac, Tech Tips | Leave a comment

Chrome Breaks Custom Search Engines – version 37.0.2062.94

Google Chrome version 37.0.2062.94 breaks custom search engines. Yep, that’s right. If you had added custom search engines ( and custom shortcuts ) in your Chrome preferences they will not work in incognito mode with this version of Chrome, at least on Mac OS X. This has been an issue even with this version of chrome was in BETA mode, but now it is also affecting the “stable” version. It may be worth it to downgrade to an older version of Chrome. If you do this you may get the message about “Your profile is from a newer version of Google Chrome” but that can easily be remedied. ( just search for the message )

Posted in Mac | Leave a comment

strange error flushing buffer – solved

When trying to use some LAME libraries like the WAV2SWF from swftools I started gettin this error: strange error flushing buffer The file was still generated but it did not work. Here’s what I did to fix: Installed the latest version of swftools This was done on Ubuntu but you can probably do almost the same thing on Mac OS X. I tried using homebrew but was not able to get a new enough version of the software. Make sure you have zlib sudo apt-get install zlib1g-dev Or brew install zlib Next check the downloads page and get the latest version of the software, something like: cd /tmp wget “http://swftools.org/swftools-2013-04-09-1007.tar.gz” cd swftools-2013-04-09-1007 ./configure make You can then install this if you want, but to test I just continued without installing: cd src ./wav2swf ~/input.wav this gave me another error: Error: no mp3 soundstream support compiled in. So to get around needing support for that you can just specify some additional parameter so it doesn’t have to detect them: ./wav2swf -d -s 44100 -o ~/test.swf ~/input.wav And voila! it worked! Additional parameters are: Usage: wav2swf [-o filename] file.wav -h , –help Print short help message and exit -V , –version Print version info and exit -o , –output <filename> Explicitly specify output file. (Otherwise, output will go to output.swf) -r , –framerate <fps> Set file framerate to <fps> frames per second. -s , –samplerate <sps> Set samplerate to <sps> frames per second (default: 11025). -d , –definesound Generate a DefineSound tag … Continue reading

Posted in Linux, Mac | Tagged , , | Leave a comment

Fix Thunderbolt Display Static Noise on OS X Mavericks

(May also work on other versions of OS X) Premise: With a Macbook Pro Late 2013 running OS X Mavericks and a brand new Thunderbolt Display there is an issue where when the Macbook is connected to the Thunderbolt Display it emits a soft hissing sound – like static – or white noise. There seem to be a lot of people with this issue – one popular thread on the Apple Support Site has around 30k views to date. In a nutshell a few things that people are reporting that fix the issue for them include:

Posted in Mac, Tech Tips | Tagged , , , | 5 Comments

How to Allow Applications Downloaded from Anywhere – OSX Mountain Lion

Follow these simple steps to allow applications downloaded from anywhere to run on your OS X Mac: Step 1: Open System Preferences and then choose Security & Privacy Step 2 Choose the first tab: “General”: The bottom section may be grayed out: If so choose the “Lock Icon” in the bottom left: Under “Allow Applications Downloaded From” click the button to set it as “Anywhere” instead of “Mac App Store” or “Mac App Store and Identified Developers” Now try running your application and see if it works.

Posted in Mac, Security, Software, Tech Tips | Tagged | 1 Comment

brew install gnu-stat

The stat command on Ubuntu and OS X behave differently and I’d like to have the functionality of the GNU / Ubuntu version of stat available on OS X – if there is such a thing. I have already used homebrew to install gnu-sed and I see similarly that a lot of the GNU utilities are available from: brew install coreutils findutils gnu-tar gnu-sed gawk gnutls gnu-indent gnu-getopt I know stat on OS X might be very specialized because of the OS X file systems that may be present, but I’d ALSO like to have the linuxy version if it is available. As it turns out, it is. The GNU version of stat can be accessed on OS X by installing a package / keg called coreutils which includes the following utilities: base64 env mknod runcon touch basename expand mktemp seq tr cat expr mv sha1sum true chcon factor nice sha224sum truncate chgrp false nl sha256sum tsort chmod fmt nohup sha384sum tty chown fold nproc sha512sum uname chroot groups numfmt shred unexpand cksum head od shuf uniq comm hostid paste sleep unlink cp id pathchk sort uptime csplit install pinky split users cut join pr stat vdir date kill printenv stty wc dd link printf sum who df ln ptx sync whoami dir logname pwd tac yes dircolors ls readlink tail dirname md5sum realpath tee du mkdir rm test echo mkfifo rmdir timeout These GNU utilities are available on Mac OS X but the one caveat is that they are … Continue reading

Posted in Mac, Server Admin, Tech Tips | Tagged , , , | Leave a comment

What version of OS X do I have?

To check which version of Mac OS X you have, you can click on the Apple icon in the top left of your screen: Choose About this Mac For more detailed information, hold down the option key when clicking the Apple icon to make About this Mac change to System Information This will give you a panel that will show you many more details about your system hardware and software. You can also do this is many programs like Adobe Illustrator: Sometimes the names of the application or it’s folder will also include the version number, such as Adobe Illustrator CS6

Posted in Mac | Tagged | Leave a comment

Installing php apc with homebrew

I’ve been enjoying using the keg homebrew-php by josegonzalez in order to run the latest versions of PHP, like PHP 5.4 on Mac running OS X 10.8 Snow Leopard. I also like to use Ubuntu on some cloud web servers and have been noticing a huge improvement in performance when the php module apc is installed / enabled. Recently I learned that I can get this same performance boost on in my development environment on my mac by using apc here too. Just install it with homebrew: brew install php54-apc The module will be installed and enabled, and on my system it created a new config file called ext-apc.ini in the directory /usr/local/etc/php/5.4/conf.d and it has some great defaults: [apc] extension=”/usr/local/Cellar/php54-apc/3.1.10/apc.so” apc.enabled=1 apc.shm_segments=1 apc.shm_size=64M apc.ttl=7200 apc.user_ttl=7200 apc.num_files_hint=1024 apc.mmap_file_mask=/tmp/apc.XXXXXX apc.enable_cli=0 One key here is that apc.shm_size needs to be set, and that it also needs to have the suffix M or I guess you could use K if you wanted a really small shm_size but honestly 64M works pretty great.

Posted in Mac, Web Development | Tagged , | Leave a comment

Force application windows to a certain position when the application is launched in OS X

Many applications seem to launch in appropriate positions but I wish that some (like Chrome and Firefox) would always launch on the left half of the screen, while I would like others like SublimeText to launch on the right side of the screen. I have checked the application settings and can’t find a way to do this. I’ve explored several window managers and am able to move the windows into position after they launch with a keyboard shortcut – but I would like them to launch in pre-determined positions. How can I force application windows to a certain position when the application is launched in OS X? After much searching I didn’t find a specific answer. However I did start using Slate for Mac OS X which is a very advanced, free, and open-source window manager. It has a .slate config file that is in the home directory. There is a issue requesting command line support and I really hope that gets implemented soon – that would solve my issue of easily positioning windows programmatically. If that doesn’t help, I also found a great question on the Apple Stack Exchange listing the best window managers for OS X.

Posted in Mac, Software, Tech Tips | Tagged , , | Leave a comment