MikeRapin.com Your average geek who happens to be a cynical college student

17Jun/080

A cool AppleScript to resize your wallpaper

I'm a total wallpaper whore. Seriously. I have nearly 1GB of wallpapers (766MB) and I need them to work with my MacBook completely. In order to scale a mass amount of wallpapers at a time, I was trying all sorts of methods to do so... Photoshop, Automator, Skitch, and a few other programs until I ran across some information almost a year and a half ago about the Image modifying tools built into Mac OS X. After some reading up on some AppleScript how-tos and browsing some forums I started to work on my original imageresize.scpt and for a while it worked for me.

The original concept was to just scale the images and move the original files to the trash then have me move the modified files to my wallpaper folder, and it did just that, plan and simple. But given my need to make things more and more complicated to make life easier and less complicated I decided to take my AppleScripting to the next level.

What my AppleScript now does is scales the images you drag onto it, moves them to a specific folder based on the month (I seriously have a ton of wallpapers and need to sort them by month...), then moves the original image to another folder. From how I see it, I may want the original image at some point...

To get things set up, download one of the two versions below (or copy the source, it's up to you), and then drag your pictures you wish to resize to the .app version of the imageresize/imageresize-original script and it will do the rest (as I described above).

So, given how happy I am with my new AppleScript, I thought I'd offer it to everyone... hell, I'll even offer my original AppleScript for those who just want to scale an image and delete the original.

--

Source of imageresize <- the new one that moves files and such

Download imageresize.app and imageresize.scpt as a ZIP

--

Source of imageresize-original <- the old one that deletes the original file and such

Download imageresize-original.app and imageresize.scpt as ZIP

--

I hope you can enjoy and find as much of use of these AppleScripts as I do...

Let me know what you think or if you have any questions in the comments!

-Mike

3Jun/080

An AppleScript to turn the brightness of your laptop display on/off

Yesterday at work, Eric was asking me if I knew of a way to immediately make the screen of his MacBook go straight to off (0 brightness). The only way I could think of doing such a thing was just holding down the button to dim the brightness or perhaps via AppleScript. He, of course, didn't want to just hold down the brightness key, and asked me to write an AppleScript to be triggered via QuickSilver to turn the brightness off and then back on.

And of course, there was a way to do it via AppleScript.

So, after much searching and reading on various sites (I forget them all or I would definitely credit them) here is what I got:

Link to brightnesskiller code

Now, what the code here does is simply this:

First, it checks to see if "TextEdit" is open, sets a boolean accordingly, then checks to see if the logfile "brightness--.txt" exists in your Documents folder and sets another boolean accordingly. Next, it opens System Preferences and opens the Displays pane. Using very dirty code, it grabs the current brightness level and stores it into 'brightness'. It checks to see if 'brightness' is over 0 then it sets your display brightness to 0 and follows that by storing 'brightness' into the logfile "brightness--.txt". But if your brightness is at 0, then it opens up "brightness--.txt" and reads the value it previously had stored and sets your display to that value.

This all of course assumes that you've used this script when your display was on or had a brightness greater than 0. But other than that works pretty well.

In case you didn't want to create the script/application, I've bundled a .scpt and .app of this script into a zip file which can be downloaded by following this link:

brightnesskiller.app & brightnesskiller.scpt

Feel free to modify it and such so long as you give me some kind of credit in the code (I leave a claiming comment at the top). I hope someone finds some use out of it.

--Edit: 06/04/2008 3:45PM--

Found an error with my original code. Made a small update. Check the source ^^ :)

21May/080

A near mishap involving my suP3r_5eCuRe password

Given I am a web geek, I know the importance having a good password when it comes to sites like PayPal, eBay, Facebook, etc. all for the sake of not wanting my shit to get stolen, but every now and again I find myself doing something really stupid: beginning to type my password as soon as I see a dialog box asking for my password.

Now, if you didn't know, I use a Mac and like any Mac user I have a Keychain which holds all of my passwords for applications and such, easing my mind as I don't have to remember all of my amazing passwords for various sites and applications (which I usually end up remembering anyways). The thing about having a Keychain is that occasionally (or very often in my case) you are prompted by applications like Dreamweaver or Cyberduck to 'unlock' your keychain to grant access temporarily to the application to use a stored username/password of some sort. My problem is that when those dialog boxes pop up asking for my password, I sometimes don't think and just start typing my password no matter what application I'm currently using.

And that's the problem. A lot of the time I'm using applications like Adium, Dreamweaver, Twitterrific or some other application that has a text field to which I can type and once in a strange while I'll see a prompt for my password and just start typing. Given that I'm such an awesome typist, I usually fly through my password in a snap and just slam on the return key and what do you know, my password just got sent in an IM or just got sent to Twitter (dear Christmas that could be bad) or I just typed my password right on my screen for all at work to see. It's a (possible) nightmare.

See, I've done this twice now. You can ask my friend Nate. I've sent him two different and equally secure and awesome passwords. He's a pal of mine, but for the sake of security I had to change my password... twice.

Now, I have to ask: Has anyone out there had any mishaps or horror-based stories invovlving their password(s)?

7Feb/080

Mike Rapin’s Guide to Web Searching via Quicksilver

So, there I was in my chemistry lecture, too lazy to reach into my backpack on the floor and pull out my calculator to solve a simple problem written on the board by my professor (who is a bad ass, seriously):
'Find the square root of 2.3x10^-18'

Lo and behold, I was on my beautiful MacBook, and BOOM I popped open Quicksilver (Ctrl + Space). "Ha!" I thought, "Square roots can be solved by the calculator plug-in I have!" So, I typed =sqrt(2.3*10^-18) in, hit enter and the Quicksilver plug-in did its job. I was satisfied with the answer (.00000000151657508881 ~= 1.5x10^-9). But it was at that moment that my friend sitting next to me, who is a Windows/Linux user but wants a Mac really bad yet can't afford one, said this to me:

"Dude, in Launchy, calculates on the fly... why doesn't Quicksilver do that?"

And I replied, "Damn I don't know... I know Spotlight does."

The conversation ended there as the lecture continued, but I was baffled as to why Quicksilver couldn't actively update calculations... I was searching and searching on Google when I came across this guide to Quicksilver on the MacRumors.com.

Now, this article didn't answer any of my questions outside of explaining that ascii math notation (ex. sqrt(16) or 10^8) work in Quicksilver's calculator function, but what drew my eye and made me forget about the whole calculator deal was the part about web searching.

15Jan/081

Liveblog: 1.1.3 firmware for the iPod Touch

So here we have it guys, my restore of my hacked iPod and and trying out the normal 1.1.3. Lets see how this works... (Mind you I paid for the extra awesome apps: Mail, Stocks, etc.)

3:48PM - Seeing that I started this baby late, I already got the iTunes update to 7.6 and the 1.1.3 firmware installed. I have been able to easily move icons around and have fun with all of that.

3:50PM - Not sure if this was available for the iPhone before 1.1.3, but apparently you can sync your Mail accounts with your iPod/iPhon. I did this, but can't get my mail to show up. I'm using GMail's IMAP, so I'm not sure if that's the problem...

3:53PM - Checking my internet connection... working slowly. Hitting google.com... a whole lot of nothing. Going to set up IMAP manually.

4:07PM - Took a break to watch this: http://www.break.com/index/funny-kid-isnt-sorry-about-huge-party.html

4:11PM - Manually added GMail and have been sitting at the 'Verifying IMAP account information' stage for a minute or so...

4:13PM - Was asked if I wanted to use SSL, said yes... I'm thinking my internet connection is shotty, but things are working... slowly...

4:17PM - dumb me, I don't know how to type my e-mail address... trying again.

4:20PM - Asked for SSL again... still verifying...

4:22PM - aaaaand Nothin'... going to try again.

4:25PM - Retried everything and it looks like it's working... well, it's verifying, again.

4:27PM - Asked for SSL again...

4:30PM - Okay. Mail isn't working. Moving on...

4:54PM - After a phone call and some messing around on my iPod, everything works fine. No hassles. No lag. Bookmarklets on the main 'board' and moving icons works flawlessly. Though, I can't seem to view lyrics on my iPod... anyone have any clue? Mail is still giving me troubles. I'm going to try on a better Wifi signal and see what fixes what.

--------------------

Final Update (Jan 29) - For the record, I managed to get everything to work including IMAP through GMail. I had to set it up through 'Other' and IMAP when running through the setup and of course following the Google Help instructions as to setting it up. And also for all you readers out there, I have found that my iPod Touch now gets less time per full battery charge. A twitter user and I noticed this was happening to both my iPod and his iPhone. We assume it was the 1.1.3 update and maybe a 1.1.4 will be rolled out when the official applications through iTunes is released...

3Jan/080

Back to Firefox

So, as I said a while ago, I had switched over to Camino until Firefox 3 came out... I lied.

I managed to stick with Camino 100% for about 2 days before I started using Safari and Firefox. Why? Because I couldn't stand the change. As sad as that is, I wanted my plugins to do my job and to simply function more efficiently on the web--this doesn't mean I need the Firefox plugins, but they made not-working more efficient.

Really, in the end it comes down to dealing with the SEVERE sluggishness of Firefox out of sheer habit. Sure, if I took Firefox off of my computer and forced myself to deal with Camino/Safari/Opera I could easily do that. Hell, before I even discovered Firefox, I was using Opera hardcore (I'm talking version 8) over IE on my old Windows tower (circa 2004-2005).

Just wanted to keep you kiddies updated.

13Dec/070

3 advantages and disadvantages of Camino

As of yesterday (12/12/07) I have decided to switch over to Camino (I'm writing from it right now!) from the ever-so-wonderful-but-not-so-Mac-or-Leopard-ready Mozilla Firefox. Mind you, I have only been using Camino for a little over a day, but I used to use it back in Tiger about 8 months ago and boy have there been improvements. Yet, even with the improvements there are some disadvantages to using Camino over Firefox, and so I give you:

Mike Rapin's Official 3 Disadvantages and 3 Advantages of Camino
in comparison to Firefox

Advantages
1. Super fast; Camino,for the most part, runs blazing fast. Compared to Firefox this thing runs at mach 3, especially when opening and closing. Pages load about the same speed (except for the login page for my university, which loads terribly slow in Firefox)
2. Sleek interface; The look of Camino is simple and elegant. Things aren't too cluttered, yet I manage to have ALL of my bookmarks showing, which leads me to...
3. Amazing bookmark bar; Camino's awesome bookmark bar allows multiple lines of bookmarks whereas Firefox only allows for 1 line. This is awesome simply because now I don't need to use folders and I can have all of my bookmarks available WITH their favicons showing--a feature the Mac version of Camino doesn't have without an add-on.

Disadvantages:
1. No undo-close tab; for me, this feature, added in Firefox 2, is a HUGE deal. I am constantly opening and closing tabs for work and when simply browsing and having the ability to undo a closed tab makes life easy for me, especially when I accidentally close a tab.
2. No add ons; Surprisingly, I can live without add-ons (in Firefox), but the luxury of add-ons (such as the 4chan tool, Web Developer Bar, Better Gmail 2, and Google Sync) made life much easier at times, but also slowed down the browser at the same time. I like being able to customize my browser, but at the same time, I really don't NEED all of those add-ons. Besides, if I wanted AMAZING customization, I'd switch to Opera.
3. No re-arranging tabs; I don't know why, but being able to re-arrange my tabs is a big deal for me. Hell, tabbed browsing is a big deal for me, but when I'm working, I like to have similar tabs next to each others and Camino does not allow moving of tabs, which really kind of irks me. I can live without it, I just may have to plan my tabbing (hehe). Let's just hope the guys at Camino are planning on adding this feature. I mean, Safari, Opera, Firefox and even IE has rearrangeable tabs!

13Dec/070

syslogd got you down? Try this fix

So, I was having a serious issue this morning with my CPU on my MacBook running at around 120% for the first hour of work (actually this was happening last night while I was away from my computer too) and I was getting tired of my computer running slow as hell, and therefore I investigated.

Now, the reason why my processor was running so hot was because of a system process called syslogd. This process basically logs all sorts of cool stuff for our computer in the background, and shouldn't take up much processor usage, but here was where my problem began.

I did some searching around and found this thread in the Apple Support forums. It turns out I'm not the only one this is happening to. What appears to be happening is simply a pre-backup preparation for Time Machine that ends up erroring during logging and causes your CPU to go haywire. The problem here is that even after force quitting syslogd, the daemon opens up again and picks up where it left off, even after a restart of the machine.

Luckily enough, there is a fix for this. In the thread from the Apple Support forums, user 'fredrikhw' managed to find a somewhat simple way to fix this along with some help from this MacOSXHints.com post (yes, this did work for me).

How to fix a maniac syslogd:
(You will need admin access to perform this)

  1. Open System Preferences
  2. Click on Time Machine
  3. Turn Backups OFF
  4. Open Activity Monitor (Applications -> Utilities -> Activity Monitor)
    • If you don't have it set already in Activity Monitor, above where it says 'Show', above, make sure All Processes is selected.
  5. Find syslogd and then click Quit Process (upper left corner of Activity Monitor)
    • You'll be prompted for an admin password, and after you type one in and press OK, syslogd will be 'dead'
  6. Finally, open Terminal (Applications -> Utilities -> Terminal)
  7. When Terminal opens, type this (you can copy & paste this):
    sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist

    • This command turns system logging OFF
  8. Press enter, and you will, again, be prompted for an admin password. Type the password in and press enter and voila! all fixed!
  9. Edit (10:45AM): After searching a bit more online I came across this post in the MacRumors.com forums and in case you want to turn logging back ON (which you may want to do to in case you have any other system-based problems) by typing this command:
    sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plis

    • Also, as mentioned in that forum post, you may want to check your system.log file located in /var/log/ as it may be taking up some extraneous space (mine is 31.5MB, but in the forum post the poster's system.log was 500MB)
      • To navigate to this file, open a new Finder window and press Command (the Apple button) + G and type
        /var/log/
        and press Enter. Scroll down to the system.log file and press Command + I to get the info on the file and check it's size. Now I'm no expert, but if it's over 500MB, I would trash it IF you need the space. I can't guarantee this won't cause any problems if you delete this file, so proceed with caution.

Now, I have only just done this today and I'm not 100% sure on if this is a permanent fix and I don't know if this means I need to have Time Machine OFF from now on or not, or if it simply needs to be off for when syslogd is getting killed or whatever, but for now, I know that syslogd is no longer effing up my computer and I can be happy about that.

28Oct/070

Leopard; likes and dislikes

So, as I go along this week I'm going to update this post with my likes and dislikes of Leopard. Here's my initial list:

Likes:
1. The look of the default Mac Installer program
2. Stacks
3. The amazingly smartness of Spaces
4. Being able to see/modify Expose.app, Front Row.app, and a bunch of those previously hidden applications from my Applications folder.
5. Stacks
6. The fact that all of my applications (so far) work flawlessly
7. The new icons for my network drives and for my Time Machine drive
8. Tons of minor, yet noticable changes in the OS throughout the Finder
9. Menubar transparency.
10. How easy it is to run Time Machine... seriously, it's so easy.
11. Stacks
12. My MacBook runs SUPER cool.

Dislikes:
1. After installing the Adobe CS3 suite that my .torrent files didn't initially open in Transmission, but intstead in Opera which was hidden inside of Adobe bridge (not necessarily Leopard, but I thought I would let you in on that weird deal)
2. Not being able to unmount my external drives because they are in use (I did turn off Time Machine, don't worry. It has to be something other than that.
3. First app not to work for me: MagiCal. Kind of pissed...

As I said, I'll add more as more comes (and as I have more free time and less homework.)

-Mike

Tagged as: , , , No Comments
26Oct/070

Leopard is upon us

Ladies and Gents! It has begun.

Leopard, Apple's newest installment of Mac OS X (10.5) is here and I, Mike Rapin (aka Gambit), am going to install... today.

I'll be 'live blogging' this experience as I go along, so keep watching for updates!

First off it's 5:32PM and since I do not have any Dual-Layer DVDs I'm going to install via an external hard drive. I'm currently restoring this external HD with the Leopard DMG I have and we'll see what happens from here.