Showing posts with label MacBook. Show all posts
Showing posts with label MacBook. Show all posts

Friday, 5 September 2008

Leopard upgrade and kernel crashes/panics

I just upgraded from Tiger (which I was very happy with) to Leopard - which has crashed no lees than four times since I installed it?!! I was going to do a clean reinstall but apart from not wanting to sink more time into I did some Googling and found some possible cures - basically due to older (non-Leopard compatible) versions of software - particularly kernel modules (kext stuff). You can have a look at the kernel modules loaded by running kextstat and looking out for non apple ones. Or better you can use the following incantation to show you all non apple kernel modules (including from the Startup folder) on your system (shows you their bundle name, ID and path):
kextfind -e -f /Library/StartupItems/* -not -bundle-id -i -substring 'com.apple.' -report -b -B -print
Or to do the same for loaded modules only (which are a possible immediate problem):
kextfind -e -f /Library/StartupItems/* -loaded -not -bundle-id -i -substring 'com.apple.' -report -b -B -print
To cure suspect (if you see them in a crash report or seeing nasty logs about them) kext modules - either find an appropriate upgrade, uninstall them or unload and remove them (e.g sudo kexunload /Library/Extensions/Dodgy.kext && rm /Library/Extensions/Dodgy.kext) and reboot.

You should also go and have look at the system logs (Console app) to see if there's nasty messages in there about dodgy goings ons.

Here's s of the known ones that cause issues:
  • Doublecommand - Upgrade or uninstall it - The old version seemed to be the cause of a some USB related crashes.
  • SmartSleep - Seems not to work properly and leaves quite trail in the log files.

Tuesday, 12 August 2008

sshfs using ssh-agent on OSX

The FUSE based sshfs app is pretty nice - but it's even slicker if it imports your ssh-agent keys automatically (as mentioned here) - then it just connects automatically if you're logged into your agent. To do this you need to set up your ssh-agent and the setup sshfs: basically you open the sshfs package and rename the "Contents/Resources/sshfs-static" to "Contents/MacOS/sshfs-static.bin". (Doing the same for sshfs-static-10.5). Then create a new file called sshfs-static (and with sshfs-static-10.5) with the following content:
#!/bin/sh
SSH_AUTH_SOCK=/Users/your-username/.ssh/ssh-agent.pipe $0.bin $*

Now make sure you've installed and set up the ssh-agent according to my instructions then you can start sshfs. Then add a machine you've got a key installed on and it will automatically connect.

[updated] Otherwise now in Leopard ssh-agent works properly and you don't need to follow my instructions - you can use the one here - use this in your sshfs-static:
SSH_AUTH_SOCK=`launchctl getenv SSH_AUTH_SOCK` \
$0.real "$1" "$2" "$3" "$4" "$5" "$6"


Saturday, 9 February 2008

Google Sketchup install problem on OSX

A friend tried to install Google's latest Sktetchup 6 and despite the fact he's running Mac OSX 10.4.11 it failed to install and complained that "Google SketchUp requires Mac OS X 10.4 or above"?? So I thought I'd take a look...

It turns out that the installer does a check for the OS version which apparently fails - I'm not quite sure why as it looks like an ok check - anyway if you want to install it then you can tweak things to get it going. Basically you can eliminate the check:
1) Download and mount the GoogleSketchUpMEN.dmg image
2) Copy the install package (named something like: FM101326ENA.mpkg) to your desktop
3) Locate the package on your desktop and open it using the Control-click (or right-click) menu 'Show Package contents' - open the 'Contents' folder and locate the info.plist file.
4) Edit the info.plist file - using a text editor (or plist editor), or just use the command line : vi ~/Desktop/FM101326ENA.mpkg/Contents/info.plist and remove the lines starting here:
<key><IFRequirementDicts</key>
<array>
<dict>
........
And finishing here:(about 22 lines)
</array>
5) Locate the installer on your desktop and run it - and it should just work!

Tuesday, 25 September 2007

Even cooler Linux MacBook

When running Linux the MacBook it gets pretty warm (that's just NOT Cool) - so one thing that Ekiga's Damien Sandras recommends is to use this utility to control the speed of the ATI graphics card - It can save around 8 Watts (The graphics don't need to run in 3D capable mode at all times).

Also there's the Mactel Linux site that's working on enhancing Linux on the Mac - they've got a bunch of patches for the kernel - some of these patches also provide for coolin' down...

Wednesday, 29 August 2007

MacBook temperature monitor

To get temperature info from your MacBook's temperature (SMC) monitor on the command line go get InCrew's speedit kernel extension. From the Terminal go the downloaded directory and run their install program:
% sudo sh install.sh
It should say:
kextload: speedit.kext loaded successfully

To read out the temperatures from the loaded kernel extension use the systctl command:
$ sysctl kern.cpu_temp
kern.cpu_temp: 52


or to read all speedit monitored info try:
$ sysctl speedit
speedit.currentfreq: 1000
speedit.minfreq: 1000
speedit.maxfreq: 2000
speedit.temp_is_valid: 1
speedit.temp: 52

Wednesday, 22 August 2007

Getting ssh-agent going on Mac OSX

It seems irritating that OSX doesn't have an easy way to get ssh-agent running for a login session. However it can be done using launchd and a bit of scripting.

Before you start you'll need to have an /Users/username/.ssh directory (where username is your username) - or alter the scripts appropriately below. Create file /Users/username/Library/LaunchAgents/ssh-agent.plist containing:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.ssh.ssh-agent</string>
<key>OnDemand</key>
<false/>
<key>Program</key>
<string>/Users/username/.ssh/ssh-agent.sh</string>
<key>RunAtLoad
</key>
<true/>
<key>ServiceDescription</key>
<string>Launch ssh-agent</string>
</dict></plist>

Then create a file /Users/username/.ssh/ssh-agent.sh containing:
#!/bin/sh
rm /Users/username/.ssh/ssh-agent.pipe
exec /usr/bin/ssh-agent -a /Users/username/.ssh/ssh-agent.pipe -d

Note: ssh-agent has to be started using -d option as launchd doesn't like processes to fork off into 'daemons'...probably why a few people don't like it.

Make the script executable:
$ chmod +x /Users/username/.ssh/ssh-agent.sh

Then ssh-agent will get started next time you login by launchd, or you can start it immediately by running:
$ launchctl start com.ssh.ssh-agent

Now you need to set the following environment variable (you can use RCEnvironment to set ~/.MacOSX/environment.plist) - probably easiest to add the following line to your /Users/username/.profile:
export SSH_AUTH_SOCK=/Users/username/.ssh/ssh-agent.pipe

You can then add your keys (assuming you've set 'em up using ssh-keygen or whatever) to the agent using:
$ ssh-add