[Main] [Photos] [Resume]

Recently in Apple Category

Stupid Tricks: sleep_monitor

| | Comments (0)

Some of you know that I'm a hackintosh user. I've been an Apple fan for a long time, but nothing in their lineup currently works for what I want out of a machine. My last Apple machine was a black MacBook with the original Intel Core Duo. It went in for service three times, and finally, Apple just denied anything was wrong with it. I ended up selling that machine, and the hard drive that was originally in it died a week later.

Huh.

Right now, I use a Lenovo/IBM ThinkPad T61 14" Widescreen edition, with a Core 2 Duo at 2.2GHz, 2gb RAM, a 100gb drive, and DVD-RW DL drive. The screen resolution is a comfortable 1440x900, I have some wireless, and life is good. I'm also running OS X 10.5, licensed but violating EULA, because it's one of the greatest operating systems we currently have available. There are a few little issues with running Leopard on this machine. Most things work, but I don't currently have a driver for the built in ethernet, the machine won't sleep if I have bluetooth enabled, the machine won't wake up if I enable the PC card slots, I can't control the brightness of the LCD, and when the laptop runs out of battery, it shuts off instead of going to sleep.

There are a few people working on two of the issues, namely the brightness issue with the Intel X3100 graphics controller, and a driver for the Intel 82566M Gigabit Ethernet controller. No sense in duplicating their efforts. The only kext I've ever written was a small driver to enable the tablet serial port on the X61 tablet that I had before this, so people could use TabletMagic and get full tablet functionality in OS X. Ethernet driver creator, I am not.

But, hey, I give you one little turd to make your life easier, and you may even find it useful if you're on a real Mac. This little package, 'sleep_monitor', installs a LaunchDaemon and a binary on your machine to keep track of how much battery you have left and put your machine to sleep at a certain threshold. It's a simple idea, but most Mac authors would charge $20 for the privilege. I give you it for free, but you don't get a GUI. Sorry.

When you install the package, it immediately starts. It will wait until you have 4% of your battery remaining, and puts your machine to sleep. On my T61 with the 4 cell battery, that usually kicks me into sleep when I have about 5 minutes of use left in the menu bar, and that will give me many hours of sleep to find an outlet to charge things up. Want to change the threshold? Edit /Library/LaunchDaemons/com.abstractwankery.sleep_monitor.plist and change the second ProgramArgument to the percentage you'd like to kill out at. Have an 8 cell battery? 2-3% is fine. Have a nearly dead battery? Maybe 15% is more your thing. Leave the % sign out of it, it will only cause problems.

SleepMonitor 0.1
Mac OS X 10.4, 10.5

Do as I say, not as I do

| | Comments (0)

Anyone who has been involved with the "forbidden" osx86 scene, or the ability to run Mac OS X on generic PC hardware, likely knows the name netkas. Netkas created the EFI firmware emulator that brings the osx86 distribution of OS X closer to the real thing by emulating the EFI Apple uses in their modern hardware. EFI is Intel's replacement for BIOS, closely resembling OpenFirmware, that allows both the interface to hardware from the software layer as well as providing direction and configuration for said hardware. The EFI emulation layer has opened the doors for more graphics hardware support, booting from GUID Partition Table hard disks, and more. It also allows osx86 users with compatible hardware (Intel chipsets and Core Solos or higher) to use Apple's OS X kernel, rather than waiting for a hacked and patched version from the community.

A company called Psystar recently exploded into the news by openly announcing a commercially sold "hackintosh". They're offering what is essentially a white box PC, with off the shelf parts that match or closely match what Apple is offering in their hardware, pre-installed with Mac OS X 10.5. Their sales pitch is that they're effectively selling an expandable Mac, with more power than an iMac, for less than half the cost. They're bundling a legal copy of Leopard, the Netkas EFI v8 emulator, and Apple's bundled software, as a complete package. It's a license violation to do this, as Apple's EULA specifically forbids using Leopard on hardware that is not Apple-branded.

The funny part to this story is that Netkas is all pissed off that Psystar is using his EFI emulator in a commercial product. He has since re-released EFI v8 with a new license forbidding the use of the software for commercial purposes. Now, if anyone just noticed that, Netkas is pissed off that Psystar is violating his license agreement by bundling software that allows people to violate Apple's license agreement.

Right, then.

Apple's new Touch SDK

| | Comments (0)

Yesterday morning, Apple introduced what they're calling the Cocoa Touch SDK, otherwise known as the iPhone SDK. This development toolkit allows developers familiar with Objective-C the ability to create applications for the iPhone or iPod Touch platform, and provides a distribution method through Apple's App Store.

sim-settings.jpg The development kit includes beta of the updated XCode, supporting "iPhone Application" as a development target, supporting libraries and frameworks, documentation, and "Aspen Simulator", a virtual iPhone for testing purposes. I played around with the new development environment for about 30 minutes, successfully creating a little "Hello, world!" application, and then toyed around with the simulator for a while. I'm surprised at how complete the simulator is, especially compared to the virtual device given with the Maemo development toolkit (the underlying platform for Nokia's Internet Tablet devices, the 770, N800, and N810). You have full access to Mobile Safari for testing web applications, as well as the Photos application and the Contacts application, presumably for developers to be able to test integration with core Touch services. Through option-clicking the interface, you're able to emulate the pinching feature of the multi-touch interface, and really able to exploit many of the features without using the actual device. I think it provides a really great interface to piece together a good application, requiring an actual device only later on in the development process, so you don't mar a phone from the getgo. Quite a bit easier than Symbian or Maemo development, and roughly equivalent to Windows Mobile development. The only thing WinMo has on them at this point is that their interface development features within Visual Studio are far more mature -- Interface Builder is not yet available in the development kit beta. You're drawing canvasses on your own. ;)

Last night, Apple released something like 20 videos over iTunesU at the iPhone Dev Center on getting started with iPhone development. I'm hoping to start going through them this weekend, and see what I can come up with. I'm not necessarily chasing the millions in VC funding that is being offered, I just like to create cool things. I don't actually have a device yet, but this has moved me to think about picking up an iPod Touch in the next few weeks.

I still can't bring myself to leave T-Mobile to get an iPhone, and having to reunlock my device every time there's a software update really doesn't do it for me. :)

Next Step for MacBook

| | Comments (1)

Sure enough, they didn't call me by the end of the business day, so I called them. They found one of the screws wasn't set right, and it's a known problem from the factory, so they ordered a new bottom case from Apple. Estimated shipment is tomorrow, so I guess we'll see. Maybe I'll have a new MacBook from them in parts. *sigh*

MacBook, MacBook, MacBook, ARR

| | Comments (0)

I forgot to mention, my MacBook went into the hands of Apple for the, uh, fourth time on Thursday, due to random kernel panics and kernel_task going insane once in a while. After arguing with the genius on what kernel_task actually does, they agreed to take it and run 'diagnostics' on it at the local store. They said it would be about three days.

So, here we are, four days later. I give them a call and ask to see what the status was. They weren't sure, really. I had reinstalled the OS, but evidently they did it again to no avail. They're going to put in a new logic board tonight to see if that helps, and give me a call tomorrow with some kind of status update. Maybe. If they get a chance to do the logic board replacement tonight.

I keep telling myself that I really like Macs. I kinda wish they'd just give me a credit for a different one, because honestly, it seems MacBooks don't like me at all.

Catalyst Studio, anyone?

| | Comments (1)

I've been toying with the fantastic idea of a "Catalyst Studio" type of application. Not saying I would or could write such a thing -- I likely could, it's merely a matter of a "serious lack of time".

A quick and dirty back story: I've been finishing off the newest revision of whatthefuck.com in Catalyst 5.7 on Perl. It's really quite a neat tool, really designed for large scale web applications that require the ability to scale, and will likely have many hands on it. It lacks the (relative) simplicity of your average PHP script, as well as the elegance and niceties that go with other object oriented web application servers such as WebObjects.

WebObjects, for those who don't know, is one of the modern founding fathers of MVC web application development. Large companies used WebObjects to create high availability, large scale applications and paid anywhere from $5,000 to $50,000 for the privilege to do so. WO was originally developed by NeXT Software, was written using Objective-C, and ran on NeXT Server software. As time went on, it ran on Solaris and Windows, and converted completely to Java between version 4 and 5. After Apple bought NeXT, WebObjects became a part of Apple Enterprise. Now, you can't write a WO app in Objective-C, and development is free with any copy of Mac OS X 10.4, and deployment is free with any copy of Mac OS X Server 10.4. Unfortunately, you can't even pay them money to deploy or develop on any other platform. It's simply end of life.

History lesson being complete, I can finally rejoin my train of thought, 200 miles down the track. WebObjects was really cool in that you never had to touch a database, and sometimes, never had to touch code. You would use an application called EOModeler to design a database schema, creating the data sets you need, designing relationships to other tables, and creating a data map. This is a lot easier than it sounds -- if you've ever organized a database, even an Excel spreadsheet, you can use EOModeler. Now here's the cool part. EOModeler will then create the tables in any of its supported JDBC databases, and generate Java classes for you to add, remove, modify, or delete data, so you never really have to write any SQL unless you absolutely have to.

The ORM features in Catalyst allow the same type of system to happen. You can tell Catalyst to generate some classes based on your existing MySQL, or Postgres, or whatever database, and you can use those classes to do the same add/remove/modify/delete as above. Except for the fact that you have to manually declare relationships within each class. The references to them are kinda odd as well, but I can go into that later.

The other issue with Catalyst is the fact that it's written in Perl, so there are twelve different ways to do the same thing. Catalyst is the perfect microcosm of perl culture. When I first looked at Catalyst, early in 2005, there was a certain recommended way of creating your application, and a certain database model (Class::DBI or Class::DBI::Sweet if you were on the edge), and most tutorials had you manually creating classes anyhow. Now, it's all DBIx::Class::Schema and RenderView, and this will probably all be replaced in 5.8. On top of that, many of the handy perl IDEs won't help you much with your Catalyst object ($c), or render the standard Catalyst tree very well. Java users have all sorts of fun tools, and WebObjects users have a whole IDE that work very well. Sure, we have TextMate or Komodo, but they aren't the whole shebang, and I want the whole shebang.

Maybe I will take on a project that works like EOModeler, but works with DBIx::Class::Schema and Catalyst. Maybe we can go from there.

Technorati Tags: , , ,

Spawn of MacBook, Part 3

| | Comments (1)

Some things never change. As I've said earlier, I absolutely love my MacBook. It is also the worst Apple product I have ever owned. The display bezel bends in and makes a snappy sound when you press on it. It smudges everywhere. Little things don't work quite how you expect. The software is still a little finicky due to the Intel transition. And the damn thing keeps breaking.

My MacBook, over the past week or two, has started to randomly shut off. Not a graceful shutdown, nothing to warn you of its impending demise, all temperatures normal, just shut the hell off. Screen goes blank, I hit the power button, machine turns on again. Most of the time. After looking around Google and the Apple Support stuff, it seems that a few people have run into the same thing. I did everything I could think of. Ye Olde Mac Standarde PRAM-reset, did a full PMU reset, reinserted the battery, reinserted RAM, and nothing. 2-5 times a day, in the middle of work, in the middle of a CD burn, in the middle of idling next to me while I used a desktop machine, black screen. I save early and often just because of the number of times I've lost power while working on something SuperImportant™, but you can't catch everything. After losing a particularly nice piece of code, in my humble opinion, I made the decision that I had to take it in.

Back in the old days, before the shiny Apple Stores and when we had to slum it with mail order and CompUSA, you could call Apple Support, and they'd send you a box to send your laptop in. Not the case anymore, they tell you to go see a Genius, and they'll set you up for repair. I roll into the Bellevue Square Apple Store around 8:55pm on Friday (35 minutes before closing), and just like the last time I went to an Apple Store, they said that no geniuses were available at this time. We moseyed up to the bar anyway, and waited for some lovin'. Someone was nice enough to help us take a look, and after he futzed with his computer for a while, he told me that my MacBook was eligible for 'capture', as my serial number matched the range on his machine. Capture is different than a repair -- usually, this means that Apple knows of an issue, but doesn't know why the issue is happening, so they want to take your laptop and stare at it for a while. This likely means that I'm getting a new MacBook, and all the BS that entails: OS reconfigure, restore home directory from backup, whine a lot.

In short, I have a link to track my repair status now. It's still waiting to arrive at the repair depot. The guy said it could be a week or a week and a half. I hope I get it back in time for my trip to Minnesota for our big wedding reception.

Sometimes, I'm tempted to get a PC laptop and stick Ubuntu on it.

I get over it, though.

Spawn of MacBook, Part 2

| | Comments (0)

It took me a day longer than I thought, as I ran out of time before I could make it to the Apple Store, but I finally went to complain about the MacBook last night. Color me absolutely impressed.

See, one thing I didn't think about was that I purchased it on May 26th: 14 days later is June 9, and yesterday was the 14th of June. I figured I'd give it a shot anyway, and arrived at the Southcenter Apple Store at 8:50pm. When attempting to sign into the Concierge for the Genius Bar (don't even get me started), they said that there wasn't any room for people to speak to a Genius, and to come back again tomorrow.

Uh, no. I just drove down here with a fresh formatted MacBook.

So, we hung out at the bar for a bit. Eventually, someone came to speak with us, and I explained a few of the things that were ticking me off about the machine. He managed to find a Genius, and a manager as well. The Genius asked me to demonstrate some of the things that were wonky, but the only thing I could reliably demonstrate was the narcolepsy. I powered it up, and flopped the machine shut. True to form, the white Apple burned bright, he saw it, and talked to a manager. Because it was only five days since the cutoff, they agreed to just exchange the MacBook instead of sending it off for repair wankery. I am so happy that it didn't turn into an ordeal, and I am so happy that I bought the MacBook locally rather than heading down to Portland or ordering it online.

Then again, I might have received a working one from the getgo. :P

And now, my new RAM came in, so I'm going to install it. Huzzah!

Dytara

http://www.dytara.com
My little shell and holding company, currently under construction.

My Projects

Twitter Updates

    About this Archive

    This page is a archive of recent entries in the Apple category.

    Database is the next category.

    Find recent content on the main index or look in the archives to find all content.

    Pages

    Powered by Movable Type 4.21-en