Archive for the 'technology' Category

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 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:

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:

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):

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!

1&1 tightens up Email spam rules

I use 1and1 for my personal and business websites as well as for our clients. We’ve had a client recently that was not receiving emails from one of their colleagues and of course the other company’s IT person said it was our problem. Having been an email administrator for many years I always like to look into the bounced back messages, smtp connection info, email headers, and more to track down a problem. This particular issue was perplexing because there where not many on the net about it. When someone was trying to send an email to a domain hosted at 1and1 it sent this error after the RCPT TO line:

421 invalid sender domain, possibly misconfigured

I tested at http://www.wormly.com/test_smtp_server (which is a great site btw) to get test the error.

So I sent an email to 1and1 support to see if they could help. This was the very speedy response:

The circumstances you have just described is caused by a RFC-non-compliant configuration of the despatcher-domain. The MX-Server
of the domain has no registered A-record, but merely a CNAME-record this is why the e-mail is rejected by our e-.

You can find some general information about this topic here:

http://www.faqs.org/rfcs/rfc2181.html

To provide the e-mail delivery as fast as possible again, we kindly advise you to inscribe the target domain of the CNAME-record as MX-record. For further information, please contact the provider of the despatcher-domain.

Looks like the 1and1 is blocking any non RFC compliant domains. In the rfc spec above it says:

10.3. MX and NS records

The domain name used as the value of a NS resource record, or part of
the value of a MX resource record must not be an alias.

Additional section processing does not include CNAME records, let alone the address records that may be associated with the canonical name derived from the alias.

So if you are a or setup DNS for clients make sure to have the MX record for your domains be A records (they directly resolve to an ip) not CNAME records. So far I have had to email a couple of hosting companies related to this issue. I applaud 1and1 for locking down their email servers even more to thwart spam, but it would have been nice to have had a link or faq on their site explaining what was going on. Thus the reason for this lengthy blog post.

Some other on the web about this issues:

Useful links to test out DNS and MX records:

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 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
  • 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 new extension_dir then 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 ( uploadprogress)” on the admin/reports/status page in Drupal.

Links that helped me with the above info:

All the good ideas are taken. Lost item locator.

Had a thought last night as I was searching for my daughters pacifier for more than 15min as she was upstairs crying her little eyes out. “Pink passy” she crys from atop the stairs as I rummage around the kitchen, living room and across every corner, nook and cranny. My thought was, “If there was an RFID tag on that stupid passy I could have already found this thing!” After I finally found said passy behind the pantry door I wondered if such as product existed that allowed you to place a small RFID tag onto any item and then locate it with a transceiver by walking around the house. Seems it was such as good idea that someone already patented it. Not that I should be suprised because all the good ideas are taken! Well not really, but any of the obvious ones I come up with seem to be. So maybe one day I’ll come up with something that no one has patented, copyrighted or otherwise thought up and do something really great.

Suggest topics for me to write about: Skribit

I would love for those who read this blog (all 3 of you lol) to suggest topics for me to blog about. I was alerted to a very kewl service called Skribit that allows people to suggest items. Please post your suggestions there or use the skribit box on the right. Thanks alot!

Paypal’s Security FOB

Yes this has been reviewed multiple times (here) as well as talked about on one of my favorite podcasts Security Now (transcript), but I just had to let the people who look at my blog (all 8 of you lol) how great it is. Here is a picture of it:

This hangs on my keychain and has a button that when I press on it gives me a 6 digit number which I can then use to log into paypal.

In fact I just used it to login to paypal to help my buddy Matt get his Dad a new wii at http://www.mydadneedsawii.com/. Please check it out and donate a dollar or two.

So here are the steps to using the Paypal Security device:

1) Goto http://www.mydadneedsawii.com/
2) Click on the Donate button on the right
3) Enter an amount (ie $5) and click Update Total
4) Enter your paypal email and password
5) Then instead of logging you in you are presented with a box to enter your 6 digit security code from your Paypal FOB.

So that is it. Pretty simple and makes your paypal account alot more secure. Check out more on the paypal site.. You also get to use the same key for your eBay login!

TextMate is the best editor evaaaaar!

Yeah, so I love TextMate. It is in my opinion one of the greatest text editors. It is easy to use, has great features (see below), makes it easy to program (especially in php) and is all around great. Yeah I know I could expound more, but I’m doing other things so read the features below or check out the site. Definitely worth the money (OSX only).

* Ability to Search and Replace in a Project
* Auto-Indent for Common Actions Like Pasting Text
* Auto-Pairing of Brackets and Other Characters
* Clipboard History
* Column Selections and Column Typing
* Completion of Words from Current Document
* CSS-like Selectors to Pinpoint the Scope of Actions and Settings
* Declarative Language Grammars for Graceful Mixing and Hacking
* Dynamic Outline for Working With Multiple Files
* Expand Trigger Words to Code Blocks With Tab-able Placeholders
* File Tabs when Working With Projects
* Foldable Code Blocks
* Function Pop-up for Quick Overview and Navigation
* Plug-able Through Your Favorite Scripting Language
* Recordable Macros With No Programming Required
* Regular Expression Search and Replace (grep)
* Run Shell Commands from Within a Document
* Support for Darcs, Perforce, SVK, and Subversion
* Support for More Than 50 Languages
* Switch Between Files in Projects With a Minimum of Key Strokes
* Themable Syntax Highlight Colors
* Visual Bookmarks to Jump Between Places in a File
* Works As External Editor for (s)ftp Programs
* Works Together With Xcode and Can Build Xcode Projects

Join twitter!!

Not on facebook and want a way to keep track of some musings and things I do throughout the day? Then check out twitter. My blog lists a daily snapshot of all my tweets, but why not get things immediately!?! :) You can also get tweets sent to IM or your phone. Schweet!

Apple Makes me Mad!

iPhone TouchOk well jealous with envy is more like it! They are releasing all kinds of new goodies today including the latest iPod Touch which is like an iPhone without the phone. You can even purchase songs straight off of iTunes. Crazy!

I was checking things out here for updates: http://live.gizmodo.com/

SuSE SLES 10 Migrating from NIS using MigrationTools

So we were moving a NIS database to LDAP under SUSE SLES 10 using the MigrationTools-47 scripts. It generated the ldif file, but would not import because it was failing on adding groups. This was the error we were getting:

(65) no structural object class provided

All we had to do is change this:

objectClass: posixGroup
objectClass: top

to this:

objectClass: posixGroup
objectClass: namedObject
objectClass: top

for each group in the ldif file. Then we redid slapadd -l file.ldif and everything worked.
Continue reading ‘SuSE SLES 10 Migrating from NIS using MigrationTools’




SEO Powered by Platinum SEO from Techblissonline