Categories
System Software Notes Unix Notes

Rename the blog?

Rightfully (moving forward) I should rename this to OS X Things and remove the Mac.

Of course almost all of the posts really do refer to “Mac OS X Things”, so I should leave it alone.

There is a post about postfix getting stepped on.

There should be a post about the removal of /private/etc/apache2/users/* which sort of messed up my web serving since I actually included those files. Well, not me, the apache2 port in MacPorts caused them to be included.

I am back up and running pretty much completely in OS X (as opposed to Mac OS X) not server.

 

Categories
System Software Notes Unix Notes Utilities Notes

Fix for postfix in Mac OS X 10.8 Mountain Lion

After installing OS X 10.8 Mountain Lion, a few things in our web development environment stopped working (namely Apache with multiple vhosts, BIND/wildcard DNS, Phusion Passenger and the rmagick2 gem, and postfix). The reason being is that Apple overwrites all of the configuration files that those tools rely on (although the old ones are all backed up with an appended ~previous, so fixing is relatively straightforward). We rely on postfix for sending mail locally via smtp using PHP’s mail() (i.e. sendmail) or Rails’ ActionMailer.

Fix for postfix in Mac OS X 10.8 Mountain Lion.

I didn’t find the backup copy of the plist – mine were just, simply, blasted.

Categories
System Software Notes Unix Notes

Advanced readline settings for bash in Terminal – Mac OS X Hints

The bash shell used in the Terminal application can be tweaked a little for better interactive experience, by saving the following lines as .intputrc in your home directory:

via Advanced readline settings for bash in Terminal – Mac OS X Hints.

The behavior of ‘bash’ is changed by more files that .bash_profile. In particular, the ‘readline’ settings are found in .inputrc – bashed my head against the wall for a while on a system that didn’t ignore case on filename completion.

inputrc

completion-ignore-case

Categories
Unix Notes

Prevent a given partition from mounting at boot

There are several hints on this site for unmounting a partition at login, but a better way to make this happen can be used. You need to create an entry point in your filesystem table to tell the OS not to mount that specific volume, and this is relatively easy. In Mac OS X, and under Linux and others unix systems, the volume mounting configuration file is located in /etc/fstab. This file in Mac OS X Tiger is empty in Panther, its commented, but type man fstab in Terminal to read some important information.

via Prevent a given partition from mounting at boot – Mac OS X Hints.

Categories
Unix Notes

List functions defined in shell

I defined a function in bash. I forgot what it was, specifically. I wanted to see all of the functions.

declare -f - functions+body
declare -F - functions

Categories
Unix Notes

clone media

sudo rsync –dry-run –verbose –archive “/Volumes/black-hole/Clones/” “/Volumes/Media”

Categories
System Software Notes Unix Notes

Terminal Tips: Enable path view in Finder

Terminal Tips: Enable “path view” in Finder:

defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES

(Via The Unofficial Apple Weblog.)

Categories
System Software Notes Unix Notes

Receive syslog log info from router on iMac (Leopard)

THIS DOESN’T WORK. Logs get confused (logging stops). Haven’t figured out a way to make it *really* work on Leopard.

Receive syslog info from router on iMac (Leopard)
Posted: Nov 28, 2007 6:51 AM in response to: YamaLuha
Solved

To enable your Leopard system to receive network syslog submissions edit /System/Library/LaunchDaemons/com.apple.syslogd.plist and uncomment the lines specified in the comments so that the end of the file looks something like this.

<key>NetworkListener</key>
<dict>
  <key>SockServiceName</key>
  <string>syslog</string>
  <key>SockType</key>
  <string>dgram</string>
</dict>

NB – the NetworkListener is part of the Socket dict entry!!!

Then execute the following commands (wait a few seconds between commands):
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist

That is enough to get an apple base station to dump it’s log into the system log.

Categories
Unix Notes Utilities Notes

Sed – An Introduction and Tutorial

Sed is the ultimate stream editor. If that sounds strange, picture a stream flowing through a pipe. Okay, you can't see a stream if it's inside a pipe. That's what I get for attempting a flowing analogy. You want literature, read James Joyce.

Anyhow, sed is a marvelous utility. Unfortunately, most people never learn its real power. The language is very simple, but the documentation is terrible. The Solaris on-line manual pages for sed are five pages long, and two of those pages describe the 34 different errors you can get. A program that spends as much space documenting the errors than it does documenting the language has a serious learning curve.

Do not fret! It is not your fault you don't understand sed. I will cover sed completely. But I will describe the features in the order that I learned them. I didn't learn everything at once. You don't need to either.

Sed – An Introduction and Tutorial.

Categories
Unix Notes Utilities Notes

howto/ccache – MacPorts – Trac

howto/ccache – MacPorts – Trac

This HOWTO covers how to enable building with ccache. It is a compiler cache. It uses the gcc -E switch and a hash to detect when a compilation can be satisfied from cache. The effect is that packages frequently compile 5-10 times faster than they would otherwise.

We’ll see how this changes behavior – installed 2008-06-06 05:00:00