Posted on Leave a comment

Changing the behavior of WordPress’ Publish button

A long unrealized goal of mine has been to change the behavior of WordPress’ publish button when adding a new post. Today, I’ll spend a little time examining the underlying code.

obert- and pixolin in Freenode’s #wordpress gave me good pointers to the WordPress forum and the WordPress hook directory.

I narrowed it down to two functions: wp_insert_post() and wp_publish_post(). Turns out that the correct function is wp_insert_post(). The only thing that wp_publish_post() does is to transition the status. Looks like I should be able to alter wp_insert_post() in my functions.php file and achieve my goal.

Got it!

Relevant references:

Posted on Leave a comment

Updating Redmine

I use Redmine to manage my client’s projects at http://redmine.dougmccaughan.com. I just noticed that last week Redmine released version 2.0.0 so I excitedly decided to upgrade my version…from 1.1.1 (how embarrassing!) This post will track the process should it not go smoothly.

Update: My update ended up being a simple "SVN UPDATE" however, it only brought me to 1.1.3. I didn’t even make it to the 1.4 branch. Will try again later.

Posted on 1 Comment

If code is not property, are software patents invalid?

An appeals court has ruled that code is not property and therefore cannot be stolen. Wow! The potential ramifications are huge. The RIAA could find themselves unable to sue over copied media. More directly, this appeals court may have just invalidated every software patent ever filed. I personally despise software patents. Now, I’m not a lawyer as such I suspect my presumptions are very wrong. The undeniable result is that if you copy custom created software from your employer, you have not committed theft.

The 2nd Circuit Appeals Court ruled that since computer code cannot be physically obtained, it doesn’t fit the legal description of a stolen good. … The court was quick to point out that this decision should not be interpreted for all cases of electronic theft, however the legal recognition that code isn’t physical property (which people have been saying for years) is sure to make this case a focal point in future MPAA/RIAA wranglings.

[Source, Gizmodo, Appeals Court Rules Computer Code Is Not "Property" and Can’t Be Stolen]

Posted on Leave a comment

Wastin’ the day away in tech

Yesterday I wasted my time trying to move Windows 7 Ultimate from one machine to another. Techies know the chipset/driver problems that come with such an endeavor, but, none the less, we feel we can overcome these challenges. A day later, I feel I am so close yet I still do not have a machine to perform my coding duties upon so I succumb to allowing the new machine to having a fresh Windows 7 Professional installation and prepare myself to spend the day reinstalling software. This is such a waste of time. Operating systems should accommodate moving a hard drive from one machine to another, realizing the chipset and hardware drivers are wrong, and fix itself seamlessly. Ugh!

Posted on Leave a comment

Cross-domain communication

If I have an aspx site on one server, let’s call it foo.com and I have a php site on another server, let’s call it bar.com, and I want to use an iframe to include data from foo.com within the bar.com site, security for iframes prevents this correct?

So, if I instead create a subdomain of foo.com, let’s call it bar.foo.com and use bar.foo.com for the aspx site, does that overcome the cross-domain security issue since both sites are now part of the foo.com domain or does the nature of bar.foo.com being a tertiary domain still create the security issue since bar.foo.com is technically different than foo.com?

Posted on Leave a comment

Repeat after me

I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.
I will not upgrade my client’s dedicated server in the middle of the night during the middle of the week.

Posted on Leave a comment

WordPress Hooks, Actions and Filters – Modifying the Publish function

I’m writing a child theme to twentyeleven and want to modify the administrative post "Publish" function to do some additional processing during the saving of a new post. Does anyone know if there is a hook, action or filter that will allow me to extend the Publish function?

Posted on Leave a comment

How to Fix iOS5 Restore Error 3200

UPDATE: Mashable and other sites are reporting that Apple’s servers are being overwhelmed and only about half the requests are getting through. The error is related to authentication and there is nothing we the users can do to fix it. Simply keep trying to get your update. As demand settles, the error will go away.

To anyone getting “An internal error occurred.” (3200) while installing iOS 5.0, Apple’s servers are swamped, and failing half the requests.

[Source, TheNextWeb, iOS 5 Error 3200 or “internal error” update issues? Apple’s servers are getting slammed.]

Word in the Ether is that you must update iTunes before updating your iPhone, iPod, or iPad to iOS5! If you are experiencing this error, I personally would try updating iTunes and try syncing again before doing any of these steps. I personally have not tried anything in this post.

xiphone.org has been hammered and is over its resource limit so I’m reprinting their instructions here.

  1. Install newest version of iTunes while do not connect your iPhone, iPod or iPad yet.
  2. Once installed, run new iTunes for a while then close it.
  3. Windows users simply go to folder
    C:\Documents and Settings\Application Data\Apple Computer\iTunes\iPhone Software Updates (replacing C: with the appropriate drive letter)
    Mac users need to locate it. I don’t really sure where it is.
  4. Cut and paste files there to somewhere else.
    Do not delete them in case the steps does not work for you, you can still copy them back to the folder. You can find out your username by pressing Ctrl+Alt+Del.
  5. Put your iPhone into DFU Mode (alternate link)
  6. Finally, proceed with iOS 5 restore procedure

[Source, xiphone.org, HOW TO Fix iOS 5 beta Restore Error 3200]

To enter DFU mode:

DFU stands for Device Firmware Update. Unlike Recovery Mode, DFU Mode doesn’t load the firmware/OS currently installed before restore attempt. DFU mode will be considered as a last resort to restore if a restore using Recovery Mode doesn’t work and you are getting error while restoring you device.

  1. Open iTunes and connect the iPhone via USB.
  2. Press and hold the Home button and the Sleep/Wake button at the same time.
  3. Continue holding the both buttons for exact 10 seconds. Then release the Sleep/Wake. Keep holding the Home button until iTunes pops up that it has found an iPhone in Recovery Mode.

It may take a few attempts to get your iPhone into DFU mode. Generally, I hold down both buttons then release the Wake/Sleep button just before I think the Apple logo would appear. If you are still holding both buttons down and you see the Apple logo you are holding them down for too long!

[Source, iphoneheat.com, How to Put iPhone in DFU Mode]

See also How to put an unresponsive iPhone into DFU mode

Posted on Leave a comment

Which XBOX 360 replacement DVD drive should I buy?

My xbox 360 dvd drive has died. I’ve found reasonably priced replacements but each seems to be a different brand. For instance, one is a Samsung Toshiba MS25 TS-H943 while another is a Hitachi LG 59DJ 79FX GDR-3120L and http://www.xboxslave.com/ has Beng, Samsung, Hitachi, and Phillips ‘Lite On’ Does the manufacturer matter? I’m aware of the daughter board replacement or flash update need.

Posted on Leave a comment

Subversion Error Message On Branch/Tag

Today’s tech problem:

I am trying to create a new baseline for my code. I have checked my code out of my repository, updated individual files to the proper version for the baseline, and then when I try to tag or branch the working copy, I get an error.

Error Commit Failed (details follow):
Error File
Error ‘/svn/foo/bar/branches/blah/snafu/path/to/file/file.cfm’
Error already exists

Because of the failure, the branch attempt, or tag attempt, fail leaving the branch/tag empty.

How can the file already exist if the branch/tag starts out completely empty?

Posted on Leave a comment

Down the ‘recover dead hard drive’ rabbit hole

So I’ve had a friend’s computer for what must be 4 weeks now. Fortunately, he has other computers on which he can do his work. His hard drive failed badly. I said I could work on it in the evenings and weekends. We bought a 1.5TB hard drive and I proceeded to fight to get the data from the old drive to the new. I succeed in recovering most if not all the data by installing Ubuntu 11.04 on the new drive, installing Gnu’s ddrescue, using GParted to resize Ubuntu and create a partition to hold Windows Vista, the used ddrescue to recover the dying drive to the new partition. Data saved!

Unfortunately, GRUB2 detects both operating systems but fails to boot to Vista, ergo, a crazy path of chkdsk and recovery console nonsense that eventually led to GRUB2 not even coming up. So, after 4 weeks or so, I decided this post will chronicle the recovery moving forward.

Sunday, 1:10pm: Grub fails to load. The last repair of Ubuntu says it couldn’t load a boot manager and one will have to be installed manually. fdisk claims "partition[s] do not end on cylinder boundary” but supposedly this doesn’t matter. GParted has been used to resize Ubuntu partition to end on cylinder boundary but Vista partition could not be resized at this time. GParted reports 3 bad sectors on the Vista partition. Running chkdsk again but it looks like I may have to blow away the partition and start again. Fortunately I have a backup on a good drive.

Update Saturday, August 27: My friend has grown irritated at the length of time this has taken. I have grown frustrated at the near pointless hours upon hours put into this machine. However, I have had several near successes. I feel like we are right at the finish line and giving up. I have reformatted the 1500GB hard drive and reinstalled Ubuntu 11.04. I’ve checked the firmware on the hard drive to confirm it is the latest. I’ve checked the motherboard bios to confirm it is the latest. I’m now using GParted to resize Ubuntu so that I can do the final copy of the Windows data so that even if I cannot get the machine to boot to windows, my friend will be able to read his data.