Showing posts with label Tiger. Show all posts
Showing posts with label Tiger. Show all posts

Sunday, January 13, 2008

Allow your Mac to sleep after a DVD has finished playing.

I find it easiest for me to go to sleep while watching something on TV or a DVD. If I'm watching TV, I have a very conveniently located "Sleep Timer" button where I can specify how much time I want the TV to remain on before automatically turning off. I find this great for so many reasons. This saves my Samsung 23" HDTV from possibly getting image burn-in (if say it was left on an annoying, non-animated, or slightly animated DVD menu). This also saves my TV from the possibility of it overheating (and yes flat panels tend to get VERY hot over extended uses). And lastly, plain-and-simple, this is a very energy-saving-friendly feature.

Over break, I've been living back at my Mom's house and have been without my beloved TV. Unfortunately, Apple has created Mac OS X so that the Mac DOES NOT sleep at any time that a DVD is playing. Now this make sense for quite a bit of reasons, it'd be rather annoying to have to switch the power settings whenever you wanted to watch a DVD, or use something like Caffeine. However, it appears that, by default, Mac OS X's DVD Player goes back to the looping DVD Menu (as does most Standalone DVD players) after the episode(s) or movie is over. Since this means that DVD player is still technically "running," OS X does not put the display nor computer to sleep at all.

For obvious reasons, this can both be annoying, and could possibly cause image burn-in, so I searched for a solution! First I wanted to investigate HOW Mac OS X does it's Autmoated Tasks.

Possible solution #1: A "cron" is a time-based scheduling service for Unix based computers. I first heard of crons back in October when many Mac sites released a Mac OS X Trojan Warning. I then planned on learning how to correctly schedule one of these cron jobs to tell my Mac to Quit the DVD Player at a certain time of my choosing. Soon after doing a little more googling I found this little app that had a funny name (CronniX), but after a quick look at the comments, I found out that Apple actually recommends the use of "launchd," saying that it supersedes previous commands such as cron. This led me to possible solution #2.

Possible solution #2: ANOTHER comment found on that Lifehacker post was one that directed me to an app called "Lingon," that simply gives you a GUI to help you create these "launchd's." Anxious and excited, I quickly downloaded this and ran it. I was a little scared and overwhelmed since this app showed you the tons and tons of system related launchd's that had been previously set. I was scared that I was going to mess something up, and thought this was a little bit overkill just to do something as simple as closing DVD Player at a specified time. However I'll definitely keep this app in mind, when the day comes that I DO want to mess around with some more powerful automated tasks.

Possible solution #3: A little more googling around led me to a way of scheduling an automated task by using iCal, creating an event, and then setting an alarm for that event. You can then set the alarm to do one of multiple things; prompt you a message, message with sound, email, open a file, or run a script. I was pretty excited about this! This would be much easier to configure quickly, and it wouldn't be dealing with such important core files, just to schedule DVD player to turn off. So I created a quick little Automator Workflow App (save as... Application) that simply "Stopped the DVD Player." Tested it out, and it worked perfectly! This was great and I was excited to finally have closure on this problem that had long annoyed me!

Possible solution #4: While ranting on to my friend Dave about how ridiculous I thought it was that I had to go to all this work just to get my Mac to sleep after watching a DVD he sent me a URL to an app he found in about 2 seconds. iSleep was EXACTLY what I needed. It was simple a Mac Sleep Timer and Alarm clock. The app allows you to fall asleep listening to music in iTunes, or watching a DVD, and then after a certain amount of time, will sleep your Mac. I was all excited, and was so close to downloading until I noticed one thing... it said that iSleep was shareware, and that you are allowed to try it for 30-days, and then if you like it, you can register it for about $9 USD. This isn't a bad price, but I absolutely despise shareware. It reminds me of those crappy trials often found on Windows. Whether or not iSleep FORCES you to register or if it pulls a "WinRAR" and just pops up an annoying "Register Me!" window that can simply be exited out of, I wasn't sure. However, the fact that iSleep was shareware was a huge turn off for me.

Possible solution #5: I had about had it, I googled one last time, in hopes that I'd find something new. Sure enough I did. In this thread, posted just a few days ago, someone asked this exact question that has been bugging me for quite some time. I read the responses and discovered the easiest solution yet. A million kudos goes out to "Jory," who states that Tiger (or later) contains a Sleep Timer (Command + T) that allows you to; Quit DVD Player, Sleep, Shut Down, or Log Out at either a specified time, OR (and this is the best part yet) at the end of the current title. Tested it out, and sure enough, works perfectly!

Sometime's it's funny how you'll go to such great depths to find an app or a way to do something, when Apple has already thought it out and included it in their Operating System.

Wednesday, January 9, 2008

Add a "Message Of The Day" to Terminal.

This one is super simple and can be done in both Tiger and Leopard. I was curious how to do this because I wanted to add the "Welcome to Darwin!" that I missed so much from Tiger's Terminal.

To add a Message of the Day:

1.) Open Terminal and enter the following command.

sudo vim /etc/motd

Since we are not logged into the Root User, we have to precede the command with a sudo, this then prompts you, asking for your administrative password.

(Also Note: that you can use any editor of your choice, now that I know a few of the shortcuts for vim, it is starting to grow on me. "Nano" is also a very easy Text Editor, and the shortcuts are all displayed at the bottom of the screen for your convenience.)

2.) Once you have entered vim, press "i" to enter the "Input mode" and type whatever you'd like for your message of the day. Example: "Welcome to Darwin!"

3.) Push Esc to exit out of "Input mode" and type: ":wq" (explained in this post) to save the file.

4.) Now close and re-open Terminal and you'll now see your new Message of the Day!

Tuesday, January 8, 2008

Spoofing your MAC Address in Tiger.

Spoofing your MAC (Media Access Control) address can be a very handy tool. Most people argue that it is only used for not-so-legit things, but I beg to differ. A very common case where spoofing your MAC address could be both helpful and education is in the area of network trouble-shooting.

Many ISPs (Internet Service Providers) tie the customer's IP address to the MAC address of the computer (or router) connected to the modem. The Physical Layer (Layer 1) is always the first layer that you should check when trouble-shooting a network. This layer includes, modems, routers, computers, cables, etc. So in order to be able to more thoroughly test your network, being able to swap out your current device connected to your modem is key. This can obviously be very tricky when the ISP has locked the IP address to a single MAC address.

Here's where spoofing your MAC address comes extremely handy, and doing it on Mac OS X Tiger, (unfortunately this command does not seem to work in Leopard) and I'm assuming most Linux/UNIX system, is by far the easiest I've ever seen.

1.) Simply open Terminal and type in the following command:

sudo ifconfig en0 lladdr aa:bb:cc:dd:ee:ff

(where aa:bb:cc:dd:ee:ff is the new desired MAC address)

After entering that command, Terminal will ask for your password and now all connected devices connected to the wired ethernet connection should see this new MAC address. And as if this tutorial couldn't get any easier, to revert, simply restart your Mac.