Thursday, April 4, 2013

Data Visualizing with Google

If you ever have to visualize data in a fast and good looking way I suggest trying Google Chart, I've used it several times  and it's really really easy to use, if you know some basic JavaScript you are good to go, but even if you have no experience with code it doesn't matter it has great documentation.

Google Chart


Wednesday, April 3, 2013

Droping Dropbox

Sparkleshare is a dropbox kind software for synchronizing your files. Even though I don't use dropbox I know so many of my friends use it, the advantages of Sparkleshare is that you can install it on your server and you can have TBs of data. Also one cool feature I like to point out that it uses git version control so if you accidentally have removed something or did a change to a file you could easily go back.

Thursday, July 26, 2012

Bash for-loop renaming special characters from a list of files

This shows how AWESOME bash is

i=1; for f in ./*.doc; do printf -v num %05d $((i++)); mv "$f" $num.doc; done

A for-loop that iterates all files ending with .doc in the current dir. It uses the printf command to generate a five-digit, zero-padded, incrementing number, then uses the mv command to rename from old name to XXXXX.doc, where XXXXX is the 5-digit number.

Wednesday, July 25, 2012

Alfresco Bulk Filesystem Import Tool

get the tool

use the alfresco module managing tool

Installation Steps

The following steps describe how to download and install the Alfresco Bulk Filesystem Import Tool:
  1. Download the latest AMP file containing the tool from here
  2. Shutdown your Alfresco instance (use the .sh inside your alfreso install folder)
  3. Make a backup of the original alfresco.war file. On Tomcat, this is located in ${ALFRESCO_HOME}/tomcat/webapps
  4. Use the Alfresco Module Management Tool to install the AMP file obtained in step 1
  5. Restart Alfresco, watching the log carefully for errors

Running the MMT

Run the following command:
  java -jar alfresco-mmt-2.1.jar [args]
It is compatible with V2.0 WAR files and above.

MMT Commands

The MMT has a number of commands. Details of these are outlined below:
usage: install <AMPFileLocation> <WARFileLocation> [options]

valid options:

   -verbose   : enable verbose output
   -directory : indicates that the amp file location specified is a directory.
                All amp files found in the directory and its sub directories are installed.
   -force     : forces installation of AMP regardless of currently installed module version
   -preview   : previews installation of AMP without modifying WAR file
   -nobackup  : indicates that no backup should be made of the WAR

Stop Alfresco

:~/alfresco-4.0.d-1$ ./ stop
/home/ardian/alfresco-4.0.d-1/apache-tomcat/scripts/ : tomcat not running
/home/ardian/alfresco-4.0.d-1/mysql/scripts/ : mysql stopped

Check if alfresco is running

ardian@arbk-share:~/alfresco-4.0.d-1$ ps -ef | grep alfresco
ardian   18815 18168  0 11:06 pts/2    00:00:00 grep --color=auto alfresco

locate where the alfresco-mmt-2.1.jar is usually its under alfresco install dir in the bin/ 
For me its /alfresco-4.0.d-1/apps/alfresco

java -jar alfresco-mmt.jar install ~/alfresco-bulk-filesystem-import-1.1-ALF40.amp ~/alfresco-4.0.d-1/apache-tomcat/webapps/alfresco.war

list the modules

java -jar alfresco-mmt.jar list ~/alfresco-4.0.d-1/apache-tomcat/webapps/alfresco.war
Module 'org.alfresco.extension.alfresco-bulk-filesystem-import' installed in '/home/ardian/alfresco-4.0.d-1/apache-tomcat/webapps/alfresco.war'
   -    Title:        Alfresco Bulk Filesystem Import v1.1 (for Alfresco v4.0)
   -    Version:      1.1
   -    Install Date: Wed Jul 25 11:18:19 CEST 2012
   -    Description:   Alfresco Bulk Filesystem Import tool.  Provides high performance bulk loading of content from the server's filesystem into Alfresco.

If you run Alfresco on Linux turn of CIFS: add this


export BULK=alfresco-bulk-filesystem-import-1.0.amp

java -jar $ALFRESCO_HOME/bin/alfresco-mmt.jar install $ALFRESCO_HOME/amps/$BULK $ALFRESCO_HOME/tomcat/webapps/alfresco.war -force -verbose