MacOSX network connections and activity
To list all open network connections:
sudo lsof -i | grep LISTEN
To list all open network connections:
sudo lsof -i | grep LISTEN
To find non-apple kernel extensions:
kextstat | grep -v apple
To flush DNS cache
Tiger:
sudo lookupd -flushcache
Leopard:
dscacheutil -flushcache
I found this great technote and linked documentation on Apple’s site: “Mac OS X 10.5: Terminal command changes in Leopard.” It all has to do with UNIX 03 conformance.
UNIX 03 Conformance Release Notes
General Command-Line Tool Differences
Now I know why this doesn’t work..
ps -auxww
The replacement would be:
ps -el
More notes as I have time to dive in.
The good folks at Code42 have made some changes to the way that CrashPlan is loaded and controlled at the system level. After a bit of digging, I’ve got it figured out.
They are now using launchd to control the engine. So at boot, the following is executed by kernel_task (with root perms):
launchctl load -w /Library/LaunchDaemons/com.crashplan.engine.plist
This means that launchd is constantly monitoring the process to make sure that it is running. Should make the software even more reliable.
To unload the software as a mere mortal, I issued:
sudo launchctl unload -w /Library/LaunchDaemons/com.crashplan.engine.plist
The -w flag adds the “disabled” key from to plist to keep launchd from immediately relaunching the process.
All loaded processes can be listed per user and sudo can be adding to list the system-level processes.
launchctl list
My final crontab:
30 7 * * * root launchctl unload -w /Library/LaunchDaemons/com.crashplan.engine.plist
30 9 * * 1,2,3,4,5 root launchctl load -w /Library/LaunchDaemons/com.crashplan.engine.plist
0 18 * * 1,2,3,4,5 root launchctl unload -w /Library/LaunchDaemons/com.crashplan.engine.plist
30 23 * * * root launchctl load -w /Library/LaunchDaemons/com.crashplan.engine.plist
I’ve been using the excellent CrashPlan software from Code42 pretty ever since I saw it demoed at MacWorld. CrashPlan allows you to do nearly effortless secure, offsite backup.
Each release of the software brings more control to the operation of the backup engine, but I wanted more control. I wanted to completely turn it off while I was at home so that it wouldn’t be using any of my precious bandwidth.
After a bit of investigation, I found that the java engine was controlled with SystemStarter. By issuing certain the following commands, I was able to start and stop the engine at will.
sudo SystemStarter start “CrashPlanService”
sudo SystemStarter stop “CrashPlanService”
Using this knowledge, I put together my final system crontab:
30 7 * * * root SystemStarter stop “CrashPlanService”
30 9 * * 1,2,3,4,5 root SystemStarter start “CrashPlanService”
0 18 * * 1,2,3,4,5 root SystemStarter stop “CrashPlanService”
30 23 * * * root SystemStarter start “CrashPlanService”
At long last I’ve managed to configure dual network interfaces on my mac. With the help of split-routing and Alberth Matos, I’ve managed to get two interfaces working simulataneously.
Interface 1: Airport Extreme (my fast internet connection)
Interface 2: Gigabit Ethernet (for lan connections)
The order of the interfaces is set in the Network Preferences as above.
Each interface is configured as it would be to access its respective network. DNS for the local network is entered in both configs and the following command is used to configure the routing table:
sudo route add 10.0.0.0/8 10.2.204.20
Where 10.0.0.0 is the local netmask and 10.2.204.20 is the local router address.
The route tables need to be updated upon network location change or reboot. I’m now investigating the best way to handle this.