Seja bem-vindo

Espero que as dicas apresentadas aqui sejam úteis para você.
Se gostar de alguma coisa, não esqueça de comentar e recomendar, caso ache importante.

Currículo

domingo, 1 de junho de 2014

How to install ImageMagick from sources on Ubuntu 14.04

I was running an Alfresco Community 4.2.f instance on Ubuntu 14.04, but thumbnails and avatar were not working.
When the server started, I got the following error message about ImageMagick:

no decode delegate for this image format

The solution I've found was to remove the ImageMagick installed using apt-get, which at the time of writing was, 6.7.7.10, and install the latest version available at the ImageMagick site from source.

Below are the steps I've followed:

Removing ImageMagick package:
$ sudo apt-get remove imagemagick

Installing the build dependencies:
$ sudo apt-get update
$ sudo apt-get install build-essential checkinstall libx11-dev libxext-dev zlib1g-dev libpng12-dev libjpeg-dev libfreetype6-dev libxml2-dev
$ sudo apt-get build-dep imagemagick

Downloading ImageMagick sources:
$ wget http://mirrors-au.go-parts.com/mirrors/ImageMagick/ImageMagick-6.8.9-2.tar.gz

Preparing and building:
$ tar -xzvf ImageMagick-6.8.9-2.tar.gz
$ cd ImageMagick-6.8.9-2
$ ./configure
$ sudo checkinstall
$ sudo ldconfig /usr/local/lib 

Following the above steps ImageMagick was installed and ready to use.
By default, it will be installed in /usr/local/bin

In order to allow Alfresco to generate thumbnails, it's required to setup the
alfresco-global.properties

Configure properties bellow and it's done:
img.exe=convert
img.root=/usr/local/bin

References:
http://namhuy.net/1730/install-imagemagick-6-8-linux-mint-ubuntu.html
http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=17059#p63413

domingo, 18 de maio de 2014

Some useful tips using the find linux command to search for text

Searching for texts into projects' source code is a common task when you are developing.

I think the best aproach is to go to shell and run the commands bellow:

Search for xml files containing the text "org.alfresco.util.CronTriggerBean"
find . -type f -name "*.xml" -print | xargs grep "org.alfresco.util.CronTriggerBean"


Look for javascript files containing the text "renderPickerHTML"
find . -type f -name "*" -print | xargs grep "renderPickerHTML"

But there are some projects that have lots of "minimized" files, and those files are not that useful when you are searching for sample code. In these cases, it's better to filter the results, ignoring the minized ones.

To do this, you just need to include one parameter to your command, like this

find . -type f -not -iwholename '*-min.js' -name "*" -print | xargs grep "renderPickerHTML"

The only difference here is the "-not -iwholename '*-min.js'.


I hope you enjoy this quick tip.

sexta-feira, 25 de abril de 2014

How to convert properties files to UTF-8

If you need to convert accented characters like áàáéíóúÁÀÃÉÍÓÚ to UTF-8, you can use the native2ascii tool, wich comes with the Java.

In order to use it, you have to specify the source file's encoding, then the name of the file and the name of the file to write the new properties file.

If you want to overwrite the original file with the changes, simply repeat its name in the command, just like this:

native2ascii -encoding ISO8859_1 your-file.properties your-file.properties

terça-feira, 18 de março de 2014

Linux substitute to WinSCP

If you use WinSCP on Windows, then you know how useful it is.
When you go to Linux, you have the option to use scp in the command line, which I think it's not easy.

What I discovered today is that Dolphin, the KDE default file manager, and in my opinion, the best file manager ever built, can replace WinSCP without any problem.

In order to connect to your server using Dolphin, you just have to type in the address bar:

fish://{username}@{server}/{path}
You will be asked to type the password, and then you will be able to copy, move, delete, and so on just like if you were working on your local disc. Simple like that.

I hope it help.

How to disable KDE Wallet?

I use KDE since, basicaly, always, but I couldn't understand the real benefit of using KDE Wallet so far.
So, I've decided to simply disable it in order to avoid those anoying pop-ups being shown every time I open a app that requires password.
Disabling it is pretty simple.
  1. Start System settings
  1. Open Account Details
  1. Go to the "KDE Wallet" tab
  1. Uncheck Enable the KDE Wallet system
  1. Press OK to apply the changes and close the settings window.
I hope this simple tip help.