Monthly Archive for April, 2009

2 Libraries, 1 iPhone

My primary computer for syncing is my machine at work, but I occasionally want to add files from my home machines as well, and the iPhone will only sync with one library.

I found this: http://www.andrewgrant.org/2008/03/30/how-to-sync-an-iphone-with-two-or-more-computers.html

Leopard, sudo, proxies and environment variables

Wow, just ran into this problem. The sudoers file on leopard has some new settings as default, which means that if you have environment variables set, they will not be inherited as superuser unless they are explicitly set.

# Defaults specification
Defaults        env_reset
Defaults        env_keep += "BLOCKSIZE"
Defaults        env_keep += "COLORFGBG COLORTERM"
Defaults        env_keep += "__CF_USER_TEXT_ENCODING"
Defaults        env_keep += "CHARSET LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE"
Defaults        env_keep += "LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME"
Defaults        env_keep += "LINES COLUMNS"
Defaults        env_keep += "LSCOLORS"
Defaults        env_keep += "SSH_AUTH_SOCK"
Defaults        env_keep += "TZ"
Defaults        env_keep += "DISPLAY XAUTHORIZATION XAUTHORITY"
Defaults        env_keep += "EDITOR VISUAL"

At work I am behind a proxy, commands run as root from the terimnal are not inheriting my terminals proxy settings. MacPorts was failing.

There are 2 solutions.

Explicitly state the environment variable in the command line:

$ sudo env http_proxy=http://proxy.url:port/ command

or, add the environmant variable "http_proxy" to the list in /etc/sudoers.