Adding PECL Uploadprogress to 1&1 shared hosting for Drupal 7 (updated)

Drupal 7.x is the platform we use to build great websites. There are modules that allow the ability to update a progress meter when uploading a file. This requires installing a PECL extension to PHP called uploadprogress. Here is the process I used to get it working on a 1and1.com hosting package. You will need a hosting package with ssh support currently the Business and Developer packages do.

  • Download PECL uploadaccess to your 1&1 account
  • Extract the package
    tar xvzf uploadprogress-1.0.3.1.tgz
  • Go into the directory
    cd uploadprogress-1.0.3.1
  • Run phpize5.5
    phpize5.5
  • Change php-config to php-config5.5 in configure script
    sed -i 's/=php-config/=php-config5.5/g' configure
  • Run Configure
    ./configure
  • Change include directives in Makefile
    sed -i 's#-I/usr/include/php#-I/usr/include/php5.5#g' Makefile
  • Run make and make test
    make
    make test
  • Make new extensions folder for new extension to go in
    mkdir ~/extensions
  • Copy uploadprogress extension to new folder
    cp .libs/uploadprogress.so ~/extensions/
  • Create new php.ini under your main folder (or under a single subfolder for just that application) to add new extension_dir then add this code to the file
    extension_dir=/kunden/homepages/6/d87663654/htdocs/extensions/
    extension=uploadprogress.so

That should be it. You should now be able to see the “Upload progress Enabled (PECL uploadprogress)” on the admin/reports/status page in Drupal.

Links that helped me with the above info:

This is an update from the original Drupal 6 article. (http://jheslop.com/2009/05/27/adding-pecl-uploadprogress-to-11-shared-hosting-for-drupal-filefield/) Just thought I would pass along as it was a little different that the previous article.

Setting up a BJU Harddrive with a Mac using Parallels

appleWe have been homeschooling our oldest for two years now. My wife and I decided on using BJU as the homeschool curriculum which has been great. They have three options for accessing the teaching content: DVD, Harddrive and online. Each progressively getting less expensive. The first year we used the DVDs which were easy to use but they were prone to skipping and we had one that would not even play. When you have multiple lessons on one DVD it can set you back a few days until you can get a new one in. So this past year we decided to save a few dollars and go with the Harddrive option. Only one problem they do not work on a Mac (OSX). Windows only and we only have mac laptops in the house! Well nothing like that ever stopped me. So we made sure to get the unit early in case we had to return it and go to back to the DVDs. I was able to get things working so we could use the BJU Harddrive on a Mac and I wanted to document the process I went through here for others to follow.

  • First you will need a way of running windows on your mac. I used Parallels Desktop but I would imagine you could use VMware Fusion, Virtual Box (free!) or the software built into the mac called Bootcamp. However bootcamp requires you to repartition the harddrive and take dedicated space away from OSX.
  • Next you will need to install a copy of windows. I used Windows 7 64bit but any supported BJU OS will suffice (XP, Vista or 7). Installing is as easy as putting the Windows 7 disc into your computer and selecting the option to install from a disc under Parallels. It does the rest. Easy! (can take a little while to finish depending on your hardware specs)
  • Then you will need to plug in the BJU Harddrive and select that USB ATA Bridge under the Devices->USB menu under Parallels (or equivalent program). You need to tell windows to take over the USB device from the Mac.
  • Now we can install the software as explained in the install instructions (See the getting started guide on the Harddrive page) The drive should show up as E: if you don’t have additional drives plugged into your Mac.
  • That’s it!

You should now have a working BJU grade installed on the desktop all under a virtual windows on your mac. BJU harddrive uses a custom vlc player and portable firefox to access DRM’s files on the harddrive. So if you are used to using vlc player then it will be pretty straight forward.

    NOTES:

  • If you plug in and install the software on a 32bit operating system. Such as 32bit XP you will not be able to run it on a 64bit OS and vise versa. However the BJU technical team was more than happy to help me. After I called them I was instructed to email them a file which they converted and sent back. They walked me through the whole process. Just make sure you plan on installing it on the machine it will be used on first. You can however move from 32bit to 32bit machine and 64bit to 64bit machine without incident.
  • The volume on a MacBook Pro can be low and hard to hear some of the lessons. I used the Boom app to increase the Mac’s volume which has worked out really well. It can get very loud now.

If anyone has any questions on any of the steps please feel free to comment or email me. Thanks.

Drush on 1and1 Shared Hosting php cgi

I’ve had to search for setting this up so many times I figure I should write my own howto on setting up drush on 1and1 hosting packages. Because 1and1 only has php-cgi and not php-cli we will have to force the drush.php file to behave differently.

NOTE: This only works on 1and1 packages with ssh.

Syncing Keyboard Shortcuts from one iOS to another using ssh (needs jailbreak)

!!DISCLAIMER!! This process could potentially brick your phone if done improperly. Follow these steps at your own risk.


I have created many keyboard shortcuts on my iPhone 4S after learning about the new feature for iOS 5. They make filling out forms and logging into sites so much easier when you can type eml instead of your full email address. You can check out how to setup keyboard shortcuts in iOS at lifehacker or by seaching google for iOS keyboard shortcuts. Many good resources are out there. However the problem that I found myself with was also using my iPad for signing in and other tasks that required filling in forms. I googled around and could not find any methods of copying shortcuts from my iPhone to my iPad other than to restore the iPad from the iPhones backup. Less than an ideal solution. So I have come up with a way that depends on both devices being jailbroken. Since iOS 5.0.1 has recently been jailbroken I downloaded and applied Absinthe on my 4S and redsn0w on my original iPad. I installed openssh on both devices and copied my Keyboard info from one device to the other (remember to change the root and mobile user passwords if you install openssh!)

Here are the full steps I took for getting all my shortcuts assuming both devices are jailbroken:

  • Make an iTunes backup of each device in case something goes wrong!
  • Install openssh on both iOS devices using Cydia (check out the “OpenSSH Access How-To” on the ront page of the Cydia app)
  • ssh in to each device and change the password of root and mobile
  • ssh copy to the device that has all your keyboard shortcuts and copy the contents of /User/Library/Keyboard to your PC or Mac (ie ssh mobile@192.168.0.5:/User/Library/Keyboard ~/Desktop/keyboardshortcuts/)
  • ssh the contents of the /User/Library/Keyboard directory from your Mac or PC to the device you want the keyboard shortcuts copied to (ie ssh ~/Desktop/keyboardshortcuts/* mobile@192.168.0.6:/User/Library/Keyboard/) the dynamic-text.dat is optional
  • Reboot the device you just copied the Keyboard contents to.
  • Enjoy your awesome keyboard shortcuts!

If you know ssh well you could technically copy from one device to another directly, but I liked the idea of having a backup of all my shortcuts on my Mac.

This is the way I came up with. I would love for Apple to support this feature with iCloud or some other method of keeping them in sync. For now this will do even though it involves jailbreaking. Anyone else have an idea of how to do this differently?

Nerd info:
– I checked the contents of dynamic-text.dat and it doesn’t need to be copied
– The contents of UserDictionary.sqlite is what creates UserDictionaryWordKeyPairs.plist as just copying over UserDictionaryWordKeyPairs.plist does not do the job. I checked with sqlite command line the UserDictionary.sqlite file and it looks to only contain the keyboard shortcut data. Thus I feel this is a safe hack and shouldn’t mess up anything.
– I used mobile user above since the original files were owned by mobile and copied via root could mess up permissions.

Adding pdftk to 1and1 shared hosting

UPDATE 2010-09-03: I updated a couple links to reflect newer downloads. Because 1and1 shared hosting is on an older debian (etch) system I had to tweak the steps for using lenny based packages. ENJOY!

There are some cases where you might need a powerful pdf toolkit to use with php. 1and1 does not come with any built in pdf processors or pdf libraries built into php. Here is the process I used to integrate phptk into my 1and1 shared hosting account.

Requirements: 1and1 shared plan that has ssh support

– Download pdftk deb file for debian lenny:

wget http://ftp.us.debian.org/debian/pool/main/p/pdftk/pdftk_1.41-3_i386.deb

– Extract the pdftk deb file:

ar xv pdftk_1.41-3_i386.deb

– Extract the data.tar.gz file:

tar xvzf data.tar.gz

– Download libgcj deb file for debian lenny:

wget http://ftp.us.debian.org/debian/pool/main/g/gcj-4.2/libgcj8-1_4.2.4-4_i386.deb

– Extract the libgcj deb file:

ar xv libgcj7-0_4.1.1-20_i386.deb

– Extract the data.tar.gz file:

tar xvzf data.tar.gz

– Download libstdc++ deb file for debian lenny (backport file http://packages.debian.org/lenny-backports/i386/libstdc++6/download):

wget http://mirror.linux.org.au/backports.org/pool/main/g/gcc-4.3/libstdc++6_4.3.4-6~bpo50+1_i386.deb

– Extract the libstdc++6 deb file:

ar xv libstdc++6_4.3.4-6~bpo50+1_i386.deb

– Extract the data.tar.gz file:

tar xvzf data.tar.gz

– Create a script to link libgcj and libstdc++6 for pdftk (use nano or vi):

#!/bin/bash

LD_LIBRARY_PATH="usr/lib:$LD_LIBRARY_PATH" usr/bin/pdftk $*

– Chmod the pdftk script so it can run:

chmod 755 pdftk

Now you can run pdftk from your main directory and process files from php or cronjobs.

If you run into any problems try running the pdftk command with some test files. If you have any problems please leave a comment. Thanks!

Adding PECL Uploadprogress to 1&1 shared hosting for Drupal FileField

Drupal 6.x is the platform we use to build great websites. There are modules FileField and ImageField 3.0 that allow the ability to update a progress meter when uploading a file. This requires installing a PECL extension to PHP called uploadprogress. Here is the process I used to get it working on a 1and1.com hosting package. You will need a hosting package with ssh support currently the Business and Developer packages do.

  • Download PECL uploadaccess to your 1&1 account
  • Extract the package
    tar xvzf uploadprogress-1.0.0.tgz
  • Go into the directory
    cd uploadprogress-1.0.0
  • Run phpize5
    phpize5
  • Change php-config to php-config5 in configure script
    sed -i 's/=php-config/=php-config5/g' configure
  • Run Configure
    ./configure
  • Change include directives in Makefile
    sed -i 's#-I/usr/local/include/php#-I/usr/include/php5#g' Makefile
  • Run make and make test
    make
    make test
  • Make new extensions folder for new extension to go in
    mkdir ~/extensions
  • Copy uploadprogress extension to new folder
    cp .libs/uploadprogress.so ~/extensions/
  • Create new php.ini under your main folder (or under a single subfolder for just that application) to add new extension_dir then add this code to the file
    extension_dir=/kunden/homepages/6/d87663654/htdocs/extensions/
    extension=uploadprogress.so

That should be it. You should now be able to see the “Upload progress Enabled (PECL uploadprogress)” on the admin/reports/status page in Drupal.

Links that helped me with the above info:

Online Banking Setup for GnuCash 2.2.6 under Windows XP

gnucash-logo

Since my linux raid decided to futz up (read I screwed it up) I’ve been using my Windows partition out of necessity until I have the time to rebuild my software raid 5 and gentoo. Until then we’ve been using GnuCash under Windows which has worked ok, but it is not as nice as the linux version by far. We use GnuCash for our business and it is critical that we have all the functions working in it. One of the things that I really missed was online banking. I could pull in all the transactions and clear them under GnuCash as well as making reconciling alot easier. The reason that GnuCash could not connect to my online bank was that the version of libofx it was saying it was an older version of Quicken and thus was denied from my bank. I read some more online and …
Continue reading

Setting up Azureus and SafePeer in Linux

azureus_splash.png So there are tons of utilities to keep the SafePeer plugin up-to-date in Windows (like BlueTack’s Blocklist Manager), but Linux and the Mac have been left out in the cold. We’ll I found a way to get those 190k+ ips blocked in azureus without having to use Peerguardian or MoBlock (MoBlock is still safer in my mind) in Linux. First we need to download the lists like we would for MoBlock. Here is the script I use:
Continue reading