Miscellaneous

How To Rotate Images or Pictures On Mac OSX

I was trying to rotate images on the Mac, and was getting annoyed at the apparent lack of functionality to do so. In Windows, you could rotate images in Explorer and in Windows Preview after you’ve opened up the file. On Mac OSX, the Preview app doesn’t come with the “rotate” buttons visible by default. What you need to do is to right-click on the Preview menubar (like in the screenshot), and select “Customise Toolbar”. There, you’ll find the elusive “rotate” button. Drag it on to your toolbar, and you should see it there. Now, you’ll be able to rotate images in Preview by clicking on that button!

mac-finder-preview-rotate-crop-images

If you’re a keyboard-kinda person, the keyboard shortcuts for rotating images are:

Apple + L or Apple + R

​Read More
Miscellaneous

10 Simple Steps How To Fix Mac Kernel Panic Errors

I’ve been trying to find out how to fix Mac kernel panic errors ever since I had the fantastic opportunity to be the lucky recipient of kernel panics on my Macbook Pro that happen once every 24-48 hours.  It’s a long process of troubleshooting because as you can imagine, it’s extremely counter-productive.

I gained so much experience on how to fix Mac kernel panic errors, and finally fixed my kernel panic by removing a wonky KEXT (kernel extension) that turned out to be the culprit. It turns out it was USBOverdrive’s KEXT, and this all started when I used USBOverDrive to configure my Bluetooth mouse because the default Apple configuration utility just couldn’t do a good enough job.

how to fix mac kernel panic

The whole process of finding this KEXT though was LONG and TEDIOUS. Most of these steps had to be performed when I was asleep, so it was usually a repetition of:

  • Try one method
  • Wait to see if the kernel panic happens
  • Actually experience the kernel panic
  • Curse
  • Repeat

How To Fix Mac Kernel Panic Errors

Here are just some steps that I took to try to fix the kernel panic that I was having. If you’re in the same shoes, this is a good guide on how to fix Mac kernel panic errors.

Test Your Macbook’s Memory

To EXTENSIVELY test your memory, a pretty good open-source tool is Rember. Load that up, and leave that running for a few loops at least. If there are any serious errors with your memory, this utility should be able to find them out.

Run Disk Utility

This is a utility that comes with Mac OSX that allows you to verify that your disk runs properly and that permissions are correct. To access this utility, go to Applications >> Utilities >> Disk Utility. Sometimes you might need to restart to use this tool, but if you do, just follow the instructions that it prompts you to follow.

If this step passes, you can be reasonably sure it’s not a permissions problem or a superficial disk error that’s causing your kernel panics.

Run Apple’s Hardware Test

Apple ships a DVD containing a bootable hardware test with all their Macs, and so you should have a copy of this in your Mac’s box. Load this DVD, and boot up following the instructions (typically by rebooting while holding down the D key). When you do this, you’ll be able to come to a hardware test utility that allows you to test your RAM/memory. Leave this test running for a few loops. This, however, is a pretty superficial tests and is well-known to NOT find more serious RAM errors.

Update Your Applications and Mac OS

Sometimes when kernel panics occur, they occur because of a conflict within your applications and your Mac OS. What you can do, is to update all applications and drivers to the latest version, and ensure that it’s fully compatible with your current version of Mac OS. At the same time, you should be updating Mac OS to the latest version as well. To do this, click on the Apple icon on the upper left corner of your screen, and click on “Software Update” – that’ll let you know if there are any updates for your system.

Uninstall Applications

At this step, you can be pretty sure that your hardware should be fine, so you should really be looking for non-hardware causes. You should be isolating the problem to either your operating system (Mac OS) or the drivers/applications that you’ve installed. So give your applications a good look-through to see if there are any applications that can potentially give you troubles. Typically, these are applications and drivers that modify with the kernel (kernel, kernel panic, heh), such as mouse drivers, keyboard drivers, webcam drivers, ANY sort of drivers, applications that modify your kernel’s run-time, power management, and so on.

Uninstall Any KEXTs

This is the absolute furthest that I got in terms of technical complexity when it comes to figuring out how to fix Mac kernel panic errors. To check the KEXTs that are running on your system currently, type this command in Terminal (Applications >> Terminal) and hit enter:

sudo kextstat

Again, look for any suspicious kextstats – ideally no extraneous third-party KEXTs should be installed. If they are, remove them with these instructions on how to remove KEXTs from Mac OS.

Reinstall Mac OS

The fault could be a problem with a corrupted Mac OS installation, which is more probable if you upgraded from a major version (e.g. Tiger to Snow Leopard). If so, reinstall this by booting up with your Mac OS DVD, and choosing to install Mac OS again. This will not affect your data and currently installed applications – but still, please do backups!

Format and Install Mac OS

The very last step. If you’ve exhausted all avenues at figuring out how to fix Mac kernel panic errors, you’ve got not much of a choice left. At this point, your hardware seems fine, and your software seems fine (or unrepairable), so you might be better installing a fresh copy of Mac OS, and starting off from there. Before you do this, you HAVE TO backup your data. If you’re unfamiliar with backups, this site teaches you how to backup data.

What you want to do is not to backup your full system, but to backup only the data and files that you want. That way, when you restore your data on to your fresh system, you won’t be copying over any corrupted files or buggy system data.

Once on your brand new Mac OS installation, be VERY selective on what you install, and keep your installations to only applications that are fully compatible with your version of Mac OS. It was only after a reformat that I found the root cause of my kernel panics, so you may have to resort to this step after all. What would help is to have a good, easily accessible backup so that restoration of your critical apps and data will be quick and easy.

Go to Apple

This is the absolute last step because while you might be covered under Apple Care, it takes so much time and effort just to get your laptop fixed (and it doesn’t guarantee that they might find the error too). Once you’re on this step, you can confidently say that you’ve done all the necessary steps to isolate the fault to something related to hardware, because you’ve pretty much done all you could.

Well that’s my 10 steps. Hope this helps you with your kernel panics.

​Read More
Miscellaneous

How To Remove/Uninstall KEXTs In Mac OSX

KEXTs are Kernel Extensions, and I realised that a program that I installed in the past (SteerMouse) had left its KEXT behind even though I uninstalled the program. You can see the list of KEXTs in your system at /System/Library/Extensions/, but do note that Mac OSX only loads whichever KEXT is needed.

As you can’t just delete the KEXT from within Finder, I had to find out how to remove it. Turns out it’s just one command in Terminal:

rm -rf /System/Library/Extensions/SteerMouse.kext

My KEXT is named SteerMouse.kext, but you can replace that with the KEXT name of your choice. Once you’ve got it deleted, reboot your system and the KEXT will be gone.

​Read More
Miscellaneous

4 Months After Switching Over From Windows To A Mac

Surprisingly, the transition from a Windows to a Mac wasn’t as jarring as I had thought, and it turned out to be pretty uneventful. It’s been 4 months since I bought my Macbook Pro, and the overall experience’s fantastic, save for 2 cases.

1. Windows-only Applications

I deal with Windows-only applications that do not have alternatives on the Mac, and the only way to run these is in a virtualised Windows environment on my Mac (I use VMWare for this). Problem is, it’s equivalent to running 2 systems on one machine, and I don’t like the performance hit that I’m taking because of this. One workaround that I use is to connect to my Windows server (I have a VPS that I use from Vodien), so all my processing is handled there.

2. Kernel Panics

I have NO idea why, but I’m getting kernel panics on my Mac. It’s annoying as heck, especially since I’m used to never ever shutting down my computer. I find it such a huge disruption in my workflow that I have to have everything reset when the computer boots up from scratch. Oh, and I like to call it BSOD – not Blue Screen of Death, but Beautiful Screen Of Death. Still a BSOD, still annoyingly infruriating. For the Mac though, the BSOD gently slides in from the top, and presents to you a multi-lingual description of what you must do (namely, reboot).

bsod windows mac

I checked the RAM on this Macbook Pro by running the memory test on extended loops (5 loops, no errors found), TechTools didn’t find anything, but then I suddenly had the haunch to try Disk Utility, and -gasp- I found disk errors. It’s something to do with invalid file counts and volume records. Doesn’t sound like something that would cause kernel panics, but I’m hoping badly that it is, and that I’ve seen the last of the kernel panics.

mac osx disk utility

So I fixed the disk errors by booting up with my Mac Snow Leopard Install DVD and running Disk Utility off it to repair the errors. If you need to do this too, just put in your DVD, and restart your computer while holding down the “c” button until you’re brought to the Mac OSX installation screen. Instead of hitting continue, just go to Utilities in the top menu bar.

I’m not sure if these disk errors are the root cause of all my kernel panics, but I’ll be monitoring this closely – hopefully I don’t get the BSOD anymore.

​Read More
Miscellaneous

How To Make and Run Batch Files In Terminal In Mac OSX

I use batch files sometimes when I was using Windows because it saves a lot of time when you need to run a batch of commands frequently. With a batch file, you save all the commands into one file, and just run the batch file, instead of your gazillion commands individually.

I was facing the same situation in Mac OSX when I realised that I didn’t know how to create a batch file in Mac OSX. Turns out it’s pretty easy. Mac OSX is unix-based, so I could use the unix equivalent (which is called a script too). What you need to do is to put all the commands you want into a plain text document, and save it with a name (without the .txt extension preferably, but that really doesn’t matter…it just looks more right that way).

In Windows, that’s all that you need to do, but for the Mac, you’ll need to make sure that you edit your batch file’s permissions so it is executable. So for example, if your batch file is named batchfile, one way to change its permissions is to right-click on it, click on “Show Info”, and then change the permissions under “Permissions” to show 755.

What 755 does is to give permissions of 7 to you, 5 to your user group, and 5 to everyone else. With a permission of 7, you can write to the file and execute it. With a permission of 5, you can execute the file but not write to it.

Another way is for you to change permissions of the file is to go into Terminal, and enter this command that changes its permissions. You’ll need to be in the directory that batchscript is in for the following command to work (or you’ll need to specify its full path):

chmod 755 batchscript

Now to run your batch file, you just need to either specify the full path to the batch file, or if you are already in the directory where it is located, you can type:

./batchscript

Note that you have to put the “./” in front of your filename, in order to tell Terminal to look for the file in the current directory.

And with that, you’ll have a working batch file in Mac OSX!

​Read More