Wednesday, March 10, 2010

Alfresco Notes - installing pdf2swf

From alfresco.log:
12:34:14,358 ERROR [org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker] Failed to start a runtime executable content transformer:
Execution result:
os: Linux
command: [/opt/Alfresco/bin/pdf2swf, -V]
succeeded: false
exit code: 1
out:
err: Cannot run program "/opt/Alfresco/bin/pdf2swf": java.io.IOException: error=2, No such file or directory

You will need to install pdf2swf.
You can get the tar.gz from here: http://www.swftools.org/download.html
I used the newest development snapshot.
You will need a bunch of devel packages as dependencies, something the swftools doesn't tell you in their FAQ. THe FAQ will tell you that you need freetype and jpeglib, but you will need others too. http://wiki.swftools.org/index.php/FAQ
Download the tar.gz and run:
# tar -zvxf swftools-0.x.x.tar
# cd swftools-0.x.x
# ./configure

You will need gcc, gcc-devel, gcc-c++, gcc-c++-devel, gdb, freetype, freetype-devel, libjpeg, ligjpeg-devel, giflib, giflib-devel, giflib-utils, make, gd, gd-progs, gd-devel, fontconfig-devel, libpng, libpng-devel, libgomp and whatever dependency that might pop up.
At that point, when ./configure runs cleanly without any errors, will you be able to run:
# make
# make install

Then you will need to update /opt/Alfresco/tomcat/shared/classes/alfresco-global.properties
and update:
swf.exe=/usr/local/bin/pdf2swf (or where you installed pfd2swf)


Alfresco Notes - correcting ImageMagick on RedHat/Centos/Fedora

Alfresco Notes
From /opt/Alfresco/alfresco.log:
12:34:14,295 ERROR [org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformerWorker] ImageMagickContentTransformerWorker not available: 02080000 Failed to perform ImageMagick transformation:
Execution result:
os: Linux
command: [/usr/local/bin/convert, /opt/Alfresco/tomcat/temp/Alfresco/ImageMagickContentTransformerWorker_init_source_5773432174191933902.gif[0], /opt/Alfresco/tomcat/temp/Alfresco/ImageMagickContentTransformerWorker_init_target_2492752320130895971.png]
succeeded: false
exit code: 1
out:
err: Cannot run program "/usr/local/bin/convert": java.io.IOException: error=2, No such file or directory

To fix:
yum install ImageMagick ImageMagick-devel
cd /usr/local/bin/convert
ln -s /usr/bin/convert .

This will create a symlink to /usr/bin/convert and fix the error.

Wednesday, March 18, 2009

Office 2007 on Fedora 9

yum install wine wine-core wine-tools wine-desktop cabextract

will run dependency check and will probably also download and install wine-jack, wine-capi, wine-nas, wine-ldap, wine-cms, wine-pulseaudio, wine-twain

Install winetricks:

Winetricks is a small SH script which will go on the internet and automatically fetch and install Microsoft DLLs and Libraries into Wine with almost no hassle at all! To download it directly, type the following commands:

wget http://www.kegel.com/wine/winetricks

chmod +x ./winetricks

this will install a whole slew of .dll's and other MS related stuff in your home directory.


Utilize winetricks:

This will setup all necessary libraries and DLLs that Office 2007 will need to run properly:

./winetricks gdiplus riched20 riched30 msxml3 msxml4 msxml6 corefonts tahoma vb6run vcrun6 msi2

Insert Office 2007 Disk and Run Setup!

Now that we have all of the DLLs necessary to run the Installer, let us do so!

wine pathToCD/setup.exe

From here on out, you should be good to go! The installer should run and install everything just as if it was a Windows system!


Tuesday, March 17, 2009

Using PEAR behind a proxy

pear config-set http_proxy http://{username}:{password}@{yourproxy{:{your port}

Thursday, January 29, 2009

Centos5 error

Whenever I install Centos5, I always forget to do two things:
1. edit /etc/yum.conf and include
proxy=http://{ip address of proxy}:{port number}

2. import gpg key
cd /etc/pki/rpm-gpg
rpm --import RPM-GPG-KEY-CentOS-5

This will allow me to run:
yum -y update

without "GPG key retrieval failedL [Errno 4] IOError:

This is a lot easier than added http_proxy to your .bashrc file and exporting, and all the other solutions others guess at on internet forums.

Monday, December 1, 2008

Installing Laconica

Installing PEAR modules thru proxy:
[root@localhost trx]# export http_proxy=http://{proxy server}:{port number}
[root@localhost trx]# pear channel-update pear.php.net
sudo pear install DB_DataObject
sudo pear install Mail
sudo pear install Net_SMTP
cd /opt
mkdir xfers
cd xfers
curl -O http://openidenabled.com/files/php-openid/packages/php-openid-2.1.1.zip
curl -O http://michelf.com/docs/projets/php-markdown-1.0.1m.zip
curl -O http://oauth.googlecode.com/svn/code/php/OAuth.php
curl -O http://xmpphp.googlecode.com/files/xmpphp-0.1beta-r21.tar.gz
unzip php-markdown-1.0.1m.zip
cp 'PHP Markdown 1.0.1m/markdown.php' ../extlib/
unzip php-openid-2.1.1.zip
cp -r php-openid-2.1.1/Auth ../extlib/
cp OAuth.php ../extlib/
tar -zxf xmpphp-0.1beta-r21.tar.gz
cp xmpphp/*.php ../extlib/


mysql -uroot -p -e 'create database laconica';
mysql -uroot -p -e "grant all privileges on laconica.* to laconica@localhost identified by 'PASSWORD'";
mysql -uroot -p laconica < db/laconica.sql

Configure Laconica

So far, I’ve found at least two config files that need tweaking—namely config.php and dataobject.ini.

The first thing I did to config.php was to add the following at around line 6 to account for my extlib/ directory:

#If you have downloaded libraries in random little places, you
#can add the paths here
define('INSTALLDIR', dirname(__FILE__));
set_include_path(get_include_path() . PATH_SEPARATOR . INSTALLDIR . '/extlib');

The rest of the settings in config.php are somewhat self-explanatory. These are the ones I changed for my installation:

$config['site']['name'] = 'cafeonica';
$config['site']['server'] = 'decafbad.com';
$config['site']['path'] = 'laconica';
$config['site']['fancy'] = true;
$config['site']['theme'] = 'stoica';
$config['site']['email'] = 'l.m.orchard@pobox.com';
$config['site']['broughtby'] = '0xDECAFBAD';
$config['site']['broughtbyurl'] = 'http://decafbad.com/';
$config['db']['database'] = 'mysql://laconica:PASSWORD@localhost/laconica';
$config['db']['ini_laconica'] = $config['db']['schema_location'].'/stoica.ini';

After this, I tweaked the first few settings of dataobject.ini to the following:

database = mysql://laconica:PASSWORD@localhost/laconica
schema_location = /www/decafbad.com/docs/laconica/classes
class_location = /www/decafbad.com/docs/laconica/classes
require_prefix = /www/decafbad.com/docs/laconica/classes/

Be sure to substitute your own web server paths and passwords in all the above. And finally, in order to allow the upload of avatar images, you’ll need to tweak the permissions on the avatar/ directory, like so:

sudo chown -R www-data avatar
sudo chmod -R ug+rw avatar/

Configure Web Server

There isn’t really much to configure if you’re using Apache. There’s a file htaccess.sample that needs to be copied to .htaccess—this will put in place all the mod_rewrite rules necessary to support “fancy” URLs.

On the other hand, if you’re okay with uglier URLs with query parameters and whatnot, leave .htaccess alone and use $config['site']['fancy'] = false in your config.php.

For comparison, here are examples of non-fancy and fancy profile URLs:

* http://decafbad.com/laconica/index.php?action=showstream&nickname=lmorchard
* http://decafbad.com/laconica/lmorchard

One catch to the non-fancy and fancy thing, though—if you start off with non-fancy URLs and later switch to fancy, all of the profiles registered before that switch will appear with non-fancy URLs in the timeline. This is because the profile table stores the original URLs at registration in the profileurl column. You could change these if you like, but there be dragons.
Configure Lighttpd for “fancy” URLs (optional)

If you’re like me, though, you’re using something other than Apache for your main web server. Personally, I just got up and running with lighttpd not too long ago. Alas, that means the .htaccess rewrite rules won’t work directly.

Admittedly, I am a novice to configuring lighttpd, so the following rules I added to my config could probably use some help:

url.rewrite-final += (
"^/laconica/index.php(.*)$" => "$0",

"^/laconica/$" => "/laconica/index.php?action=public",
"^/laconica/rss$" => "/laconica/index.php?action=publicrss",
"^/laconica/xrds$" => "/laconica/index.php?action=publicxrds",

"^/laconica/doc/about$" => "/laconica/index.php?action=doc&title=about",
"^/laconica/doc/contact$" => "/laconica/index.php?action=doc&title=contact",
"^/laconica/doc/faq$" => "/laconica/index.php?action=doc&title=faq",
"^/laconica/doc/help$" => "/laconica/index.php?action=doc&title=help",
"^/laconica/doc/im$" => "/laconica/index.php?action=doc&title=im",
"^/laconica/doc/openid$" => "/laconica/index.php?action=doc&title=openid",
"^/laconica/doc/openmublog$" => "/laconica/index.php?action=doc&title=openmublog",
"^/laconica/doc/privacy$" => "/laconica/index.php?action=doc&title=privacy",
"^/laconica/doc/source$" => "/laconica/index.php?action=doc&title=source",

"^/laconica/main/login$" => "/laconica/index.php?action=login",
"^/laconica/main/logout$" => "/laconica/index.php?action=logout",
"^/laconica/main/register$" => "/laconica/index.php?action=register",
"^/laconica/main/openid(?:\?(.*)|$)$" => "/laconica/index.php?action=openidlogin&$1",
"^/laconica/main/remote(?:\?(.*)|$)$" => "/laconica/index.php?action=remotesubscribe&$1",

"^/laconica/main/subscribe$" => "/laconica/index.php?action=subscribe",
"^/laconica/main/unsubscribe$" => "/laconica/index.php?action=unsubscribe",
"^/laconica/main/confirmaddress$" => "/laconica/index.php?action=confirmaddress",
"^/laconica/main/confirmaddress/(.*)$" => "/laconica/index.php?action=confirmaddress&code=$1",
"^/laconica/main/recoverpassword$" => "/laconica/index.php?action=recoverpassword",
"^/laconica/main/recoverpassword/(.*)$" => "/laconica/index.php?action=recoverpassword&code=$1",

"^/laconica/settings/avatar$" => "/laconica/index.php?action=avatar",
"^/laconica/settings/password$" => "/laconica/index.php?action=password",
"^/laconica/settings/profile$" => "/laconica/index.php?action=profilesettings",
"^/laconica/settings/openid$" => "/laconica/index.php?action=openidsettings",
"^/laconica/settings/im$" => "/laconica/index.php?action=imsettings",

"^/laconica/notice/new$" => "/laconica/index.php?action=newnotice",
"^/laconica/notice/(\d+)$" => "/laconica/index.php?action=shownotice¬ice=$1",

"^/laconica/user/(\d+)$" => "/laconica/index.php?action=userbyid&id=$1",

"^/laconica/(\w+)/subscriptions$" => "/laconica/index.php?action=subscriptions&nickname=$1",
"^/laconica/(\w+)/subscribers$" => "/laconica/index.php?action=subscribers&nickname=$1",
"^/laconica/(\w+)/xrds$" => "/laconica/index.php?action=xrds&nickname=$1",
"^/laconica/(\w+)/rss$" => "/laconica/index.php?action=userrss&nickname=$1",
"^/laconica/(\w+)/all$" => "/laconica/index.php?action=all&nickname=$1",
"^/laconica/(\w+)/all/rss$" => "/laconica/index.php?action=allrss&nickname=$1",
"^/laconica/(\w+)/foaf$" => "/laconica/index.php?action=foaf&nickname=$1",

"^/laconica/(\w+)$" => "/laconica/index.php?action=showstream&nickname=$1"
)

Wednesday, November 5, 2008