Skip to main content

Posts

S3FS + UpdateDB = Billing Increase

If you are using s3fs  to mount an S3 bucket to your server and have noticed a huge increase in ListBucket and HeadObject calls in your Billing. The calls will increase you AWS bill and depending on how many objects you have in your bucket, it could be significant.  Day over day I saw "Requests-Tier2" - The number of GET and all other non-Tier1 requests - go from 399 thousand to 9 million. That's a  2155% increase and my bill went from 17 cents per day to 4 dollars per day. Requests-Tier1 - The number of PUT, COPY, POST, or LIST requests for STANDARD, RRS, and tags - also increased, but not as much. 90 thousand per day to 325 thousand per day. It took some digging, but I found the culprit by running the following command: $ lsof | grep S3_DROP_ZONE which gave the following output [root@ip-999-99-9-999 ec2-user]# lsof | head -1 && lsof | grep S3_DROP_ZONE COMMAND    PID  TID           USER   FD    ...

Dyson AM09 Fan & Heater H2 Error

No idea what the actual error is and I couldn't find anything useful on the web, so hopefully this will help someone else. I assumed that the H2 error meant that something was dirty, clogged up or that it was overheating because it was dirty or clogged up because the error only showed up when it was in Heater mode. The heater would run for about 30 seconds, then it would show the error and switch over to the high speed fan , I assume to try to blow out the dust. I proceeded to open it up to give it a deep clean because the Dyson instructions for cleaning this thing are ridiculous and don't help at all. Gently wiping down the outside and vacuuming the intake holes....really Dyson, really?! I used cotton swabs and 91% alcohol to clean everything I could get to, starting at the base (in hindsight, this part may not be necessary at all). Then I got to the top of the device where the actual air comes out of and noticed that there was a lot of build up on the heater coils. I could...

Replacing your HDD with a SSD in a Mid-2009 Mac

What you'll need: T6 screwdriver PH000 philips screwdriver SATA to USB connector ( or SATA to Thunderbolt if you feel like spending the cash) Apples DiskUtility Application 2.5 inch SATA SSD (e.g. Samsung 850 EVO), size is up to you Before we swap the drives out we want to test our speeds so that we can compare with what we get afterwards. You can run the below commands a few times, then take an average if you want a better representation. Write Speed (16GB file, lower the values of the bs and count params for a smaller file) 52.872 MB/sec write speed Read Speed 50.6726 MB/sec read speed Also, in the Disk tab of the ActivityMonitor you can see a real-time measurement of reads/writes per second, which where an approximate match to the values I got above. Hook up the new drive The next thing to do is clone the current disk over to the SDD. I used a SATA to USB connector I found online to connect it to the Mac and I used the DiskUtility app to clone the disk. Onc...

ColdFusion to Sails.js Conversion : Find/Replace Tips/Tricks

Use your IDE of choice, I prefer Sublime Text because it uses the Perl Compatible Regular Expressions (PCRE) engine from the Boost library and I love me some regex. I will show examples for .js syntax, but if you need this in .ejs format just add <% to the beginning and %> to the end like in the first example below.  I always have the case sensitive button off in Sublime, so if you are using a different editor make sure you use the proper ignore case flag or you may get mixed results. These examples are meant to speed up the conversion, some additional refactoring may also be necessary. more to come...

ColdFusion to Node.js Conversion : Setup Part 1

This multi-part post will be community comment driven, which basically means that in an effort to not spend too much time on details that might not matter to the viewers out there, I am only going to share the details which I think are important at the time of publishing the posts. If people (or bots) comment and want more details, I will add them to the original post. As always, constructive criticism is always welcome. Since I am currently using the CFWheels framework (which is inspired by Ruby on Rails or RoR), I chose to try out the Sails.js framework for Node.js (which is also similar to Rails). 1st thing I did was get Node and Apache working together by adding this to my Apache vhost(VirtualHost) block: ProxyRequests on ProxyPass / http://localhost:8124/ And adding this to my hosts file (/etc/hosts): 127.0.0.1 mynewapp.node www.mynewapp.node This allows me to setup an alias in my host file and reference the URL as you normally would without adding the portnumber o...

Bitnami WordPress htaccess Redirect for Author Pages

As their page notes, for security purposes, the htaccess configuration has been moved outside of the webroot and AllowOverride is set to "None" https://wiki.bitnami.com/Components/Apache/htaccess_configuration . In this instance I have an EC2 instance spun up from a BitNami (HVM) AMI. The default file to edit is /opt/bitnami/apps/wordpress/conf/htaccess.conf Make a backup of the file before you edit. Add this block anywhere in the file to redirect all author landing pages to the home page. <Directory /opt/bitnami/apps/wordpress/htdocs/> RedirectMatch 301 "^/author/.*" http://www.yourdomain.com/ </Directory> Customize to your liking if you would rather redirect to a different page. When you're done editing, run this to restart apache, then test your changes. sudo /opt/bitnami/ctlscript.sh restart apache /* Joey */

CfWheels and Controller Init Caching Gotcha

I recently discovered an issue where logic inside of a controllers init gets cached when your environment is set to production. By default, when in the production environment the cfwheels setting of  cacheControllerInitialization defaults to true. At the time I had logic in the init method that checks if the user agent is CFSCHEDULER and the remote address is localhost/127.0.0.1. I used this logic to authenticate scheduled tasks that run on a secure section of the site. I found this when sporadically the authentication would pass even though the logic returned false and I noticed the init method was _never_ being called, which led me to find that caching setting. The fix was to extract the logic out into another method and add that to the list of filters. /************** Before **************/ <cffunction name="init"> <cfif CGI.remote_addr EQ "127.0.0.1" AND CGI.HTTP_USER_AGENT EQ "CFSCHEDULE"> <!--- let the CF ScheduledTas...

ColdFusion Invalid Image Format Solution

For those who have gotten the following error: "java.awt.color.CMMException: Invalid image format" and tried the solutions posted here with no avail. We are going to use the power of Java's JAI (Java Advanced Imaging) library to tackle this one. <cfscript> //path to image imagePath = "pathToImage"; //create java file object, passing in path to image imageFile = createObject("java","java.io.File").init(imagePath); //create a FileSeekableStream, passing in the image file we created fss = createObject("java","com.sun.media.jai.codec.FileSeekableStream").init(imageFile); //create ParameterBlock object and initialize it (call constructor) pb = createObject("java","java.awt.image.renderable.ParameterBlock").init(); //pass in FileSeekableStream pb.add(fss); //create JAI object that will ultimately do the magic we need JAI = createObject("java","javax.media.jai.JAI"); //...

Show hidden files on Mac

To temporarily toggle hidden files, you can use this keyboard shortcut: Shift+Command+.(period) To make hidden files visible in Finder permanently, run this command in Terminal defaults write com.apple.finder AppleShowAllFiles -bool true To hide hidden files again in Finder, run this command in Terminal defaults write com.apple.finder AppleShowAllFiles -bool false Run this command to restart Finder, so that either one of the above commands will take effect ( Don't worry, Finder should restart with all of your previous windows open again ) killall Finder

Fixing DNS issue on MacBook Pro

This may be an issue with 10.6(Snow Leopard) altogether or just with the MacBook Pros, but every once in a while the internal DNS settings get hung up or crap out or just stop working! You're connected to the internet, you've checked the connections, you've got on other devices , you've asked co-workers if they are having issues with the internet, you've pulled your hair out, banged your head against the wall, you get my drift. Whatever you do or try your $2000 MacBook Pro will not do one simple thing CONNECT TO THE INTERNET!! Hopefully this solution will work for some of you and save the hair on your head. Run these commands from terminal(copy command from sudo to plist): sudo launchctl unload /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist THEN sudo launchctl load /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist and bingo bango everything is just peachy again!

CFBuilder 2 Tour comes to Nashville this week!

WHEN: Thursday, April 21st, 2011 at 6:00pm CDT WHERE: Russ Carroll Financial Peace Conference Center,1749 Mallory Lane, Brentwood, Tennessee 37027 Map of Location SPEAKER: Greg Wilson - Adobe evangelist for AIR, ColdFusion, Flex and LiveCycle ES WHAT: Greg Wilson from Adobe will be here to talk about CFBuilder 2, ColdFusion, and even some Flex on mobile stuff, including Flex on iPad/iPhone! We are SUPER excited to have the opportunity to get the surrounding ColdFusion and Flex communities together for this event. Greg Wilson is an AIR, ColdFusion, Flex, and LiveCycle ES evangelist at Adobe, and many of you may remember him from the ColdFusion 9 tour a couple of years ago. HOW: Register at the Nashville ColdFusion User Group site. RSVP for this meeting ...

Flex getItemAt() function vs Array Notation

Just a quick tip I found while doing some debugging on a Flex project I am working on. While myArray.getItemAt(0).firstname and myArray[0].firstname return the same value, the getItemAt() function will save you ten steps. By ten steps I mean that 10 steps after the compiler hits the line that says myArray[0].firstname, it will run the getItemAt() function anyway. It is doubtful that you will see any significant performance gains out of this. So, it may take more time to type out the getItemAt() function over array notation, but it processes quicker.

Adobe ColdFusion tour coming to Nashville!

WHO: Greg Wilson (an AIR, ColdFusion, Flex, LiveCycle ES evangelist      at Adobe) WHAT: Greg will be discussing new features in ColdFusion, how      ColdFusion integrates with other Adobe technologies like AIR, Flex      and LCDS.      Also, Greg will be showing some demo's of the new features that      are going to be in the next ColdFusion release.      There will be food, drinks and of course prizes/giveaways that you      don't want to miss.(<cfhint = you have to be registered to be      eligible for giveaways!>) WHERE: Russ Carroll Financial Peace Conference Center,1749 Mallory      Lane, Brentwood, Tennessee 37027       Map of Location WHEN:Thursday, June 18, 2009 at 7:00pm CDT HOW: Register at the Nashville ColdFusion User Gro...

Try/Catch in OnError function of Application.cfc

So you're stoked that you switched to application.cfc and you wont have to see those hard ColdFusion errors since app cfc has the OnError function? Sorry to bust your bubble, but what if your OnError function throws an error(referencing a variable that isn't present for example)? Then what? That's right, a hard ColdFusion error will be shown and hopefully you were smart and turned off the Robust Exception option in the ColdFusion Administrator! :) To remedy this situation you could add in a try/catch block right there in the OnError function. A more generic process could be put in the catch block that perhaps should never throw an error, something very simple that doesn't reference any variables that may not be present.

State of Tennessee Pays $135M for Edison Program

This is one of the top stories in Nashville right now, because the program is so horrible and so much money was spent on it. 135 million dollars!!! I would have happily done it for $1 Million and I would have made sure it was done right! Also, this could be one of the main contributors to State employees not getting a raise this year. They are not even getting a cost of living raise this year! Think about how far $135M can go. Even if you divide $135M 40,000 ways, that is still $3,375 that could be going towards someones raise and potentially back into the economy.

ColdFusion Val() function Gotcha.

Try this and you will see what i am talking about <cfdump var="#Val(08234)#"> <cfdump var="#Val(80234)#"> You will see that in the first dump strips the 0 off of the number leaving you with 8234...not good for people that believe in wrapping Val() around everything that should be numeric. NOTE: It doesn't matter if there is one 0 or 20 at the beginning of the number, they will all be stripped off.

Want to view a summary of your ColdFusion Components

If you need a quick overview of one of your ColdFusion components for documentation purposes for example, here is how you do it. Go to your browser of choice and type in the URL you use to get to your CF Administrator. For example, I access my CF Administrator with: http://127.0.0.1:8302/CFIDE/administrator/index.cfm Next delete everything after the CFIDE/ and copy and paste: componentutils/cfcexplorer.cfc?NAME=CFIDE.adminapi.datasource& METHOD=getcfcinhtml This will show you all the details about the datasource.cfc that is used in the coldfusion administrator. you can replace the 'CFIDE.adminapi.datasource' with any cfc you want to view. just replace that string with the component_name of your choice.