Tag Archives: homebrew
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
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.
I was having an issue on Mac OS X – this is probably because I installed it with homebrew a few months back and forgot about these instructions. $mongodb MongoDB shell version: 2.0.6 connecting to: test Sat Jun 16 09:11:43 exception: connect failed Error: couldn’t connect to server 127.0.0.1 shell/mongo.js:84 I search for a solution but didn’t easily find one, so I ended up uninstalling it and reinstalling it, which then gave me the very valuable notes below about where config files and data paths are stored on OSX, and also let me know that I needed to start the service if I wanted to use it. Here are those notes: Downloading http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.0.6.tgz Already downloaded: /Users/me/Library/Caches/Homebrew/mongodb-2.0.6-x86_64.tgz Caveats If this is your first install, automatically load on login with: mkdir -p ~/Library/LaunchAgents cp /usr/local/Cellar/mongodb/2.0.6-x86_64/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist If this is an upgrade and you already have the homebrew.mxcl.mongodb.plist loaded: launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist cp /usr/local/Cellar/mongodb/2.0.6-x86_64/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist Or start it manually: mongod run –config /usr/local/etc/mongod.conf The launchctl plist above expects the config file to be at /usr/local/etc/mongod.conf Summary /usr/local/Cellar/mongodb/2.0.6-x86_64: 18 files, 122M, built in 2 seconds You might want to run brew update and brew upgrade to update / upgrade all of your homebrew packages, or brew update and brew upgrade mongodb to update mongodb to the latest version. A few other notes if you’re using homebrew: # updates the database of available software and what the latest # available version for each is. run this … Continue reading