Apt-get: Cannot initiate the connection to 8080:80

To fix this issue, open the apt.conf configuration file:

vi /etc/apt/apt.conf

Add this row or check it if already exists:

Acquire::http::proxy “http://proxy.localdomain:8080/”;
Tagged

Change Eclipse settings to ignore jquery errors on a specific file

In my dynamic web project in eclipse, I have jQuery in my js source folder. For some reason, Eclipse is not handling it correctly and interpreting many lines as errors in the standard jQuery file (even though I have the javascript development tools installed).

I have found that I can leave the JavaScript Validator enable and ignore specific files by adding a suitable exclusion pattern e.g. **/jquery*.js to the JavaScript/Include Path/Source/Excluded group (Project->Properties->JavaScript->Include Path->Source).

Tagged , ,

Resolving java.lang.OutOfMemoryError: PermGen

Today our Alfresco doesn’t start due to this error:

java.lang.OutOfMemoryError: PermGen

The PermGen (permanent generation) holds data needed by the virtual machine to describe objects that do not have an equivalence at the Java language level like objects describing classes and methodse. So often large, complex apps will need lots of PermGen space. Similarly if you are doing frequent war/ear/jar deployments to running servers like Tomcat or JBoss you may need to issue a server restart after a few deploys or increase your PermGen space.

To increase the PermGen space use something like:

-XX:MaxPermSize=128m

The default is 64MB.

Note that Xmx is separate from the PermGen space, so increasing Xmx will not help with the PermGen errors (PermGen memory is in addition to the Xmx memory)

Java has other settings that could help control how much memory it uses:

-Xmx sets the maximum memory heap size
-Xms sets the minimum memory heap size.

Tagged ,

MacOS X – Remove an agent from launchd

launchd is a daemon/agent manager and to remove a service from it, use the following syntax with the launchctl command:

launchctl remove name

It’s possible to get a list of daemon/agent with:

launchctl list

Usually the daemon/agent configuration files are in: /Users/andrea.girardi/Library/LaunchAgents

Tagged

Oracle admin on Ubuntu server

To be able to admin Oracle instance from sqlplus command line on Ubuntu server, for first you need to set the enviroment variables:

source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh

At this point, is possible to login as sysdba using:

sqlplus / as sysdba

if you get insufficient privileges error, you need to add your user to dba group:

usermod [username] -G oracle, dba

a this point is possible to startup and shutdown the Oracle instance on sqlplus prompt using:

SHUTDOWNN IMMEDIATE;
Tagged ,

Oracle 11gR2 Express Edition on Linux Ubuntu 11.10 howto

To install Orace 11gR2 Express Edition, please take a look to this tutorial (tutorial? THE TUTORIAL!)

https://forums.oracle.com/forums/thread.jspa?threadID=2301639

Tagged ,

Nostalgia nostalgia canaglia!

Non so se vi capita mai, ma oggi è uno di quei giorni in cui sento una viscerale nostalgia di quando ero bambino, di quei famosi anni 80 fatti di serie tv divertenti, di robottoni giganti che lottavano con tutte le loro forze per salvare il nostro povero pianeta dai nemici invasori di altri pianeti e tutto si concludeva con un bellissimo fungo atomico. Non è nostalgia di un evento particolare, è semplicemente una stretta allo stomaco, un impressione indescrivibile, una malinconia struggente per qualcosa che c’è stato e, credetemi, è stato bellissimo. Nostalgia per un modo di vivere che era davvero molto più semplice, sicuramente perchè eravamo bambini e tutto ci sembrava bello. Ecco, oggi mi sento così, con la tristezza nel cuore per la spensieratezza ormai andata e che, anche volendo, non potrà più esserci a causa del terrorismo psicologico dei mass media di questi tempi. Ricordo la Minerbe di allora, grande, da scoprire, da vivere, piena di ragazzi che al pomeriggio si davano appuntamento per le strade mentre oggi, tutti ben nascosti in casa a giocare alla PS o su Facebook!

Anche una volta i mass media facevano “terrorismo psicologico”, ma era decisamente positivo! Ricordo quanto hanno cercato (e ci sono riusciti) di farci avere paura dei “drogati”. Mamma mia… quelli si che facevano paura! I drogati. Adesso orami è tutto sdoganato…. Guardo vecchi film e non vedo scene di sesso o di violenza troppo esplicite, reali. C’era qualcosa di molto velato…. si intuiva, ma non si vedeva di certo!!!!

Mi chiedo, i tempi sono cambiati in meglio o in peggio? O semplicemente è solo una conseguenza della mio essere malinconico?

Quit from psql command-line utility

To quit from Postgres psql command-line utility use:

health_coach=# \q

and press enter

Tagged

Show post categories using Webscript

To show all categories of a post, check if the cm:categories child association exists and, if yes, list all childs into the ftl file:

<#if node.properties["cm:categories"]?exists>
	<categories>
		<#list node.properties["cm:categories"] as prop>${prop.name}</#list>
	</categories>
</#if>
Tagged

Download Alfresco content from Java using Spring

To download content stored on Alfresco repository using Java, this is one possible way:

String url = "http://localhost:18080/alfresco/d/a/workspace/SpacesStore/" + attach.getNode_ref() + "/" + attach.getAttach_filename() + "?ticket=" + ticket;
return new ModelAndView("redirect:" + url);

Where getNode_ref() is a method that returns the node reference ID and getAttach_filename() returns the file name. In that case the authentication ticket is attached to the request because the Alfresco guest user is disable.

To view the content instead of dowload it, change the url into:

http://localhost:18080/alfresco/d/d/workspace/SpacesStore/
Tagged , ,