Fix WordPress upload error – HTTP error

The inability to upload files in WordPress first showed up in version 2.5. The solution for me was to edit the .htaccess file in the root directory of my webserver (the directory where WordPress is installed). Add the following to the the .htaccess file after the “END WordPress”:

<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>

If you are having the problem of your .htaccess file losing its changes, you have most likely put something inside the WordPress block of the .htaccess file. Keep any custom changes outside of that block or they will be overwritten.

It seems that this problem still occurs in WordPress 2.6, but the error message is slightly different — “An error occurred in the upload. Please try again later.”

This fix is still necessary in newer versions of WordPress.

Now hosted at LiNode

I have finished moving my websites to LiNode (actually last Sunday, not today… )

I got the smallest plan but it performs better than MediaTemple’s (gs) service.

Here’s a snapshot of my linode status (btw, I blurred my linode number just in case) :

If want to use LiNode for your hosting needs, please consider using this link: Referral link

I’ll post more about as my journey progresses

Setting up kernel 2.6.33 on Slackware 13 on my Asus G1S

Download DVD iso

Burn to media

Install it

Install Slack Build Gnome

Download and install new kernel:

cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.33.tar.bz2
rm linux
tar -xvjf linux-2.6.33.tar.bz2
ln -s linux-2.6.33 linux
cd linux
make mrproper
make menuconfig

Append “-asus” to Local version

Change Processor family to “Core 2/newer Xeon”

Enable “Realtek 8169 gigabit ethernet support”

Disable “Ethernet 10000 Mbit support”, unless of course you have such a network card

Enable “Intel Wireless Wifi”

Enable “Enable Full Spectrum Measurement in iwlagn driver”

Enable “Enable full debugging output in iwlagn and iwl3945 drivers”

Enable “Enable device access tracing”

Enable “Intel Wiress Wifi Next Gen AGN (iwlagn)”

Enable “Intel Wireless Wifi 4965AGN”

Frame Buffer Support:

Enable “VGA 16-color graphics support”

Enable “Userspace VESA VGA graphics support”

Enable “VESA VGA graphics support”

Backlight & LCD device support

Enable “Lowlevel LCD controls”

Enable “Platform LCD controls”

Intel HD audio

Enable “Support jack plugging notification via input layer”

Enable “Support initialization patch loading for HD-audio”

Enable “MMC/SD/SDIO card support”

Be sure to enable whichever filesystem your installation needs

Enable “NTFS file system support”

Enable “NTFS write support”

Staging Drivers:

Disable”Exclude Staging drivers from being built”

Enable “Asus OLED driver”

X86 Platform Specific Device Drivers

Enable “Asus Laptop Extras”

Virtualization

Enable “Kernel-based Virtualization Machine (KVM) support”

Enable “KVM for Intel processors support”

Exit saving your configuration, and let’s compile it

#make -j7
#make modules_install

Copy new files to your /boot folder:

cp arch/x86/boot/bzImage /boot/bzImage-2.6.33-asus.bz2
cp System.map /boot/System.map-2.6.33-asus
cp .config /boot/config-2.6.33-asus

Now update shortcuts

cd /boot
rm System.map
ln -s System.map-2.6.33-asus System.map
rm config
ln -s config-2.6.33-asus config
ln -s bzImage-2.6.33-asus.bz2 bzImage

Update your lilo.conf file

#nano /etc/lilo.conf
lba32

image = /boot/bzImage
root = /dev/sda3
label = Asus
read-only
#lilo
Added Linux *
Added Asus

Cross your fingers and reboot 🙂

#reboot

If anything goes wrong, start with your previous kernel and do some debugging based on any kernel panic messages you have received (maybe some file system support?)

Making your server trust your laptop

To avoid copying and pasting my password (mostly in the wrong window), I thought it would be better to make my server trust my laptop by using public/private keys:
Here we go:

For Linux (or BSD, or OSX):

1. Open a terminal on your laptop and generate your keys:

ssh-keygen -t rsa

You may optionally choose a passphrase (which I didn’t since the I want to avoid typing).

2. Copy the public key to your server:

scp ~/.ssh/id_rsa.pub username@server_address:/your/home/folder/

3. SSH into your server and add your public key to the authorized_keys file:

cd ~/.ssh
echo "#Something to identify your key" >> authorized_keys
cat /your/home/folder/id_rsa.pub >> authorized_keys

4. Open another terminal and try logging to your server just providing your username:

ssh username@server_address

You should be granted with the shell command line from your server. If not, please review what you did. If still doesn’t work, drop me a line:

Some thoughts on installing Aptana 1.5.1

Last weekend I re-installed all my operating systems and had a lot of trouble installing/updating Aptana Studio on Windows and OSX, I am taking some notes just in case more people face the same situation:

1. Install Aptana 1.5.1

2. Choose your workspace

3. Add 2 new software locations:

  • Aptana Update Site: http://update.aptana.com/install/php/
  • Galileo Update Site: http://download.eclipse.org/releases/galileo

Test the connection for both locations

4.Install the following packages ( I do PHP development, so…. )

  • PHP Development Tools (PDT) – PDT SDK 2.1.2
  • PHP Debugger Binaries (Optional PDT)
  • Zend CE Features
  • Subversive – SVN Team Provider Plugin (Incubation)

5.Restart Aptana and you should have it updated correctly

6. Install SVN connector

  • SNV Kit 1.3.2 – so I have the same interface in all O.S.es

7. Restart Aptana again

8.Update your Aptana installtion

  • Aptana Database Explorer
  • Aptana Studio
  • Aptana Studio Professional
  • Aptana Subversion Support
  • Graphical Editing Framework GEF
  • PHP Development Tools (PDT) Runtime Feature
  • PHP Development Tools (PDT) SDK Feature 2.1.3
  • PHP Development Tools (PDT) SDK Feature 2.1.1

8. You’re done

Happy coding!

Kohana v3.03 reset

Download Kohana v3.0.3

Upload files to your server

Fix these paths inside index.php:

$application = '../application';
$modules = '../modules';
$system = '../system';

Try accessing to make sure you installed correctly:

http://kohanav3.portnumber53.com/

Some tweaks:

Inside application/bootstrap.php:

date_default_timezone_set('America/Los_Angeles');
kohana::init(array(
 'base_url' => '/',
 'index_file' => '',
));

Now create: application/classes/controller/layout.php

Now extend the previous controller: application/classes/controller/website.php

And create a controller to handle content: application/classes/controller/content.php

Trying my GSA-T20L optical drive with MCE usb 2.0 enclosure for the superdrive

After purchasing and using the MCE optibay on my white macbook 13″, I got really curious as it that would work for any regular laptop PC….

Having not asked any of the manufacturers involved, I put my brain to work and wouldn’t make any sense for Apple to create a totally different connector for its Super Drive (as it would shrink its market and make it worse/harder for consumers to get replacement parts); and would make even less sense for MCE to develop something that would not follow any standard.

People can always say that mixing parts of different manufactures is dangerous (that seems to be some Apple certified technician’s minds by the way); and there will be those asking why I would take a chance of frying stuff when Asus and other laptop PC manufacturers have models with raid support.

Well, I happen to be curious and I don’t have money to get one of those, so….

Again I don’t have a lot of spare money… so for now I just tried hooking up the optical drive from my Asus G1s to the MCE usb 2.0 enclosure that came together when I bought my MCE Optibay. So far my experiment works….

As soon as I finish transferring all my files to an external HD I will post more pictures and an update to this post. Stay tuned.

Great way to parse HTML content using PHP

Today I started improving a newsletter system in the company I work for. One of the things I wanted to change is to have images embedded in the email message.

The website uses CodeIgniter (http://www.codeigniter.com); for email handling I chose Swift mailer (http://swiftmailer.org/). Then for HTML parsing to replace all the relative image paths and encode/embedded the images in the message I found this parser: SimpleHTMLDOM (http://simplehtmldom.sourceforge.net/).

Really simple to use and now I’m working on the rest of the stuff… managing templates for newsletter, handling subscription etc etc.

I’m going to add some sample code later. Drop me a line if I take too long.