Critter’s Code

This is a picture of a bridge and a city. I like bridges and cities. They make me smile.

Jun-6-2010

MBP trackpad stops working due to battery expansion.

Just a quick thing.

I’ve had odd occasions where the trackpad button on my mac book pro seemed to stick. The other day it wouldn’t click. It seemed stuck in the down position. I ran a small blade along the edge of the button. I thought about attempting to pry it off, but not knowing exactly how it all went together, I opted to take it into Apple.

I made an appointment for 3:45 pm this past Saturday. I was detained on my way by one of Apex’s finest, and missed my appointment. They were able to get me in after a 1/2 hour wait.

The guy look at it. Pushed down on the trackpad button a couple of times. He then flipped the computer over and removed the battery.

Trackpad button now goes clicky clicky.

My battery had slowly expanded. Just a hair, but expanded none the less. The expansion of the battery was keeping the button pressed up from the bottom.

The pricing of a new battery was kind of interesting. If I bought it through the ‘Genius Bar’ it would cost $99.00 and come with a 30 day warranty, and I would have to turn in my old battery. If I bought it through the Apple store, it would cost $129, come with a 1 year warranty, and I could keep the old battery. *shrug*

so there… if your trackpad button seems to be stuck.. and it doesn’t look like it’s crammed with peanut butter or something… check the battery.

My good deed for the day is done. I have shared information that might at some point be valuable to… someone . ha. *shrug*

VN:F [1.9.1_1087]
Rating: 8.0/10 (1 vote cast)
VN:F [1.9.1_1087]
Rating: +1 (from 1 vote)
Posted under mac
Dec-16-2009

Case sensitive keys in ColdFusion structures

I know this is old news, but this one bit me last night.

I needed to loop over a structure and return the keys and values in a case-sensitive xml format. Creating my structure like this:

1
2
3
4
5
<cfscript>
qHolder = structNew();
qHolder.userName = "Critter";
qHolder.firstName = "Critter";
</cfscript>

was returning the keys in all caps. (USERNAME, FIRSTNAME)

I had forgotten that if you need to preserve the case of the keys you need to create them like this:

1
2
3
4
5
<cfscript>
qHolder = structNew();
qHolder["userName"] = "Critter";
qHolder["firstName"] = "Critter";
</cfscript>

That will result in (userName, firstName). You can reference them with dot notation and the case will be preserved, so long as they are created using the [""] format.

As you were.

VN:F [1.9.1_1087]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.1_1087]
Rating: 0 (from 0 votes)
Posted under ColdFusion, Samples
Dec-5-2009

Carbonite won’t go away (OSX)

I had Carbonite installed as an online backup solution for a little bit, but ended up uninstalling the trial (via the preference panel) due to a lack of extra funding to throw their way.

I noticed this morning that the cpu kept jumping on my mac, so I popped open the Console and saw this:

1
2
3
12/5/09 5:33:04 AM    com.apple.launchd.peruser.501[288]    (com.carbonite.carbonitestatus) Throttling respawn: Will start in 10 seconds
12/5/09 5:33:14 AM    com.apple.launchd.peruser.501[288]    (com.carbonite.carbonitestatus[10584]) posix_spawn("/Library/Application Support/Carbonite/<a class="linkification-ext" title="Linkification: http://CarboniteStatus.app/Contents/MacOS/CarboniteStatus" href="http://CarboniteStatus.app/Contents/MacOS/CarboniteStatus">CarboniteStatus.app/Contents/MacOS/CarboniteStatus</a>", ...): No such file or directory
12/5/09 5:33:14 AM    com.apple.launchd.peruser.501[288]    (com.carbonite.carbonitestatus[10584]) Exited with exit code: 1

I searched around online, but couldn’t really find anything that helped. I searched around to see where things were launched from, and found that /Library/LaunchAgents/ had these two plist files in it:

1
2
com.carbonite.launchd.carbonitestatus.plist
com.carbonite.launchd.carbonitealerts.plist

I do know that you need to unload a plist that has been launched, so I typed the following into Terminal

1
2
launchctl unload /Library/LaunchAgents/com.carbonite.launchd.carbonitestatus.plist [enter]
launchctl unload /Library/LaunchAgents/com.carbonite.launchd.carbonitealerts.plist [enter]

You will have to authenticate after each command. After doing that I was able to delete the files and all was well.

I do want to throw in that I much prefer Carbonite over Mozy. Mozy after a bit of time always seemed to just stop working for me. I’d have to re-install and then it would be good for a bit, etc, repeat. The only reason I uninstalled Carbonite was the inability to dish out the extra cash (side effect of the unemployment movement)  meh.

VN:F [1.9.1_1087]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.1_1087]
Rating: +1 (from 1 vote)
Posted under Stuff, mac, osx
Nov-12-2009

Urgent: Protect your jailbroken phone

Have you jailbroken your iphone? It’s easy to do, and quite a few people have done it. Have you changed the default password for your SSH access on your iphone? It’s easy to do, but not many people have done it.

If you do not change the default SSH password on your iphone, your phone is at risk and so is your data! When you stop to get your coffee, and your iphone connects to the network, I can login and take what I want. Worms can automatically spread from phone to phone.

First you will need to know what the IP for your iphone is, assuming it is connected to a network. You can easily get the IP from drilling down into into your network settings.

Now that we have the IP address, just open up a terminal window (or command prompt on windows, IIRC). You can see from the image that my IP is ’192.168.1.104′. So to connect to my iphone I type:

ssh root@192.168.1.104

You will be prompted to enter a password. (note: you will not see your password as you type it)

alpine

Once you are logged into the phone, you will need to type:

passwd

You will then be prompted to enter your new password twice. That’s it. Your iphone is now safe from any worm or malicious attacks that will utilize the default password.

That’s it. Your jailbroken iphone is now protected from any worm or malicious attack that could use the default login/pass combination for SSH.


VN:F [1.9.1_1087]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.1_1087]
Rating: 0 (from 0 votes)
Posted under Iphone, Stuff
Nov-3-2009

I rake leaves and do other stuff

I am a good great raker. I can rake leaves into pretty piles. I can rake leaves into pretty piles and then pickup said piles. I can rake leaves into pretty piles and then mulch said piles.

I am a great raker. If you need a great raker, well, I can travel, but it would be best to keep that local to Cary, NC. I have great kids, too. I can travel, but not relocate (telecommute… not available with raking)

I am a good great awesome hawesome coder. I love what I do. I absolutely LOVE working with ColdFusion/Flex/AIR, and on top of that… I am pretty damned good at it too.

I am a hawesome coder. If you need a hawesome coder, well, I can travel, but it would be best to keep that local to Cary, NC. I have hawesome kids, too. I can travel, but not relocate (telecommute… is available with coding)

I’m available for either. Actually, I am available for anything, and you can bet whatever it is, I’ll be pretty damned good at it. (if not I shall google my way through it!)


VN:F [1.9.1_1087]
Rating: 5.2/10 (5 votes cast)
VN:F [1.9.1_1087]
Rating: 0 (from 0 votes)
Posted under AIR, ColdFusion, Flex
Sep-8-2009

Bring Back the Bolt — CFinNC!!


VN:F [1.9.1_1087]
Rating: 8.6/10 (8 votes cast)
VN:F [1.9.1_1087]
Rating: +5 (from 5 votes)
Posted under ColdFusion, Presentations, User Group
Sep-7-2009

Free CeeFood at CFinNC


VN:F [1.9.1_1087]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.1_1087]
Rating: 0 (from 0 votes)
Posted under Presentations, Stuff, User Group
Aug-13-2009

Ctz-Prowl updated

I made a couple of updates to the files. I added the attributes for proxyservers and proxyport. I also separated out the two examples so they are easier to use.

I’ve updated the zip file on ctzProwl.RiaForge.


VN:F [1.9.1_1087]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.1_1087]
Rating: 0 (from 0 votes)
Posted under CF9, ColdFusion, CtzProwl, Projects
Aug-11-2009

Push notifications on your iPhone via ColdFusion

There’s an app you can purchase in Itunes App Store that will allow you to send push notifications to your Iphone. The iphone application is called “Prowl: Growl Client” You can download a plugin that integrates with Growl on the MAC (and I believe windows too) allowing you to receive copies of growl notices from your computer to your phone.

While this is all fine and dandy. Prowl also exposes an API, which allows for 1,000 notifications sent per hour per IP. The API allows for easy integration and access via ColdFusion. The possibilities of what this could be used for are endless.

I’ve created a CFC that will allow you to easily send notifications to your iphone via the Prowl servers. Actually… I’ve created two CFCs. One for ColdFusion v9.0 using (scripting FTW!1!) and a version of the CFC that uses tags.

Set your account variables and create your object:

1
2
3
4
apikey = "ei4irkfkddkdkdkdke3ie9r9r9";
providerkey = "";
callto = "<a class="linkification-ext" title="Linkification: https://prowl.weks.net/publicapi/" href="https://prowl.weks.net/publicapi/">https://prowl.weks.net/publicapi/</a>";
appname = "Critter's Code'";

// connect to the prowl cfc //
p = createObject(“component”,”ctzprowl”).init(_apikey=apikey, _callto=callto, _providerkey=providerkey, _appname=appname);

and our calls to the service:

1
2
// verify account (it does count against your 1,0000 requests per hour)
x = p.verify();

if(x.complete and x.code eq 200)
{
// send notification to devices registered to our account. //
y = p.add(priority=’0′,event=’CF9′,description=”I’m in your phone via CF9′”);
}
// dump x (our verification call)
writedump(var=x,label=’Verification results’);

if(isDefined(“y”))
{
writeoutput(‘
‘);
writedump(var=y,label=’Add Notification results’);
}

Below is a screen of the dumps:

and the notification on my phone:

Basically.. for $2.99 you can program your server to send you notifications based on whatever..

I just need to finish packing a few things up with it.. and I’ll throw it up on RiaForge.

UPDATE:

I’ve uploaded the code to http://ctzprowl.riaforge.org

Itunes Link
Prowl Website (signup and generate API key)


VN:F [1.9.1_1087]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.1_1087]
Rating: 0 (from 0 votes)
Posted under CF9, ColdFusion, CtzProwl, Iphone, Projects
Jul-24-2009

Unzipping multiple files in a directory on MAC OSX

I can neither confirm nor deny the fact that from time to time I might allegedly download TV shows or movies from the internetz.

Theoretically when one would supposedly do this, one might be presented with a directory full of zip files:

HypotheticalTVSHOW1.zip
HypotheticalTVSHOW2.zip
HypotheticalTVSHOW3.zip
HypotheticalTVSHOW4.zip
HypotheticalTVSHOW5.zip

If one should stumble upon this situation. Rather than double-clicking each *.zip file (which most of the time creates folders for each file extracted)… you can run a command via Terminal which will extract all the files in the same directory. So.. fire up Terminal and navigate to the directory where all the zip files are stored.

Theoretically in this case, I might have them stored in a zip folder on my desktop.

cd “/Users/critter/Desktop/zips” [Return]

Once there you just need to type this:

unzip \*.zip [Return]

You will then be presented (if there are any duplicate files being uncompressed with the following:

replace duplicatefile.avi? [y]es, [n]o, [A]ll, [N]one, [r]ename:

Just type either ‘y‘, ‘n‘, ‘A‘, ‘N‘, or ‘r‘ and hit [Return]

done.. if that’s what might possibly, sorta, kinda be happening.
Allegedly.


VN:F [1.9.1_1087]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.1_1087]
Rating: +1 (from 1 vote)
Posted under mac, osx