Monday, March 28, 2011

Install Java + Tomcat on Linux CentOS

I. Installing Java

#yum install jpackage-utils

#wget url/jdk-6u13-linux-i586-rpm.bin [1]

#chmod +x jdk-6u13-linux-i586-rpm.bin

#./jdk-6u13-linux-i586-rpm.bin

#java -version

II. Installing Tomcat

#wget http://apache.mirror.testserver.li/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz

#cp apache-tomcat-6.0.32.tar.gz /var/

#cd /var

#tar -zxvf apache-tomcat-6.0.32.tar.gz

# ln -s /var/apache-tomcat-6.0.32 tomcat

#/var/tomcat/bin/startup.sh

References:
[1]Java Download http://www.oracle.com/technetwork/java/javase/downloads/index.html
[2]Java + Tomcat + startup in CentOS
http://wiki.openbluedragon.org/wiki/index.php/Apache_Tomcat_on_CentOS/RedHat
[3]Java 6 + Tomcat in CentOS
http://www.satollo.net/how-to-install-tomcat-and-java-6-on-centos-5-2
[4]Java SE
http://www.oracle.com/technetwork/java/javase/downloads/index.html
[5]Tomcat (download core tar.gz)
http://tomcat.apache.org/download-60.cgi
[6]Mirror
http://apache.mirror.testserver.li/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz

CSS Templates

http://www.woothemes.com/themes/

Videos Graciosos

http://video.latam.msn.com/watch/video/gato-cansado-se-desmaya/1jb3dt5rq

http://video.latam.msn.com/watch/video/sonrie-cuando-le-dicen/1jbyn00k1

http://video.latam.msn.com/watch/video/perro-ladra-mas-bajo-a-pedido/1jb65jo8z

http://video.latam.msn.com/watch/video/precision-japonesa/1jb7ufffb

http://video.latam.msn.com/watch/video/carrera-de-31-piernas/1jb3la8c6

http://video.latam.msn.com/watch/video/gato-contra-perro-en-camara-lenta/1jbatlyp9

http://video.latam.msn.com/watch/video/la-mejor-imitadora-de-animales-del-mundo/p4fej3h3

Wednesday, March 23, 2011

Portal Cautivo

[1] pfsense http://www.pfsense.org/


http://es.wikipedia.org/wiki/Portal_cautivo

http://blyx.com/public/wireless/nocatbox/nocatbox-howto-es.pdf

Tuesday, March 22, 2011

ASP.NET MVC and HTTPS

Enable SSL or HTTPS in IIS 7

1. Open IIS from Administrative Tools.
2. Navigate to Sites>Default Web Site. Or select the web site you want to enable SSL or HTTPS.
3. In the right pane, Click Binding.
4. Default is setup Port 80. You can click Add and to HTTPS or port 443.
5. Continue the instruction to complete the settigns.


Referencias:
[1]Adding HTTPS/SSL support to ASP.NET MVC routing
http://blog.stevensanderson.com/2008/08/05/adding-httpsssl-support-to-aspnet-mvc-routing/
[2]Requiring SSL For ASP.NET MVC Controllers
http://weblogs.asp.net/dwahlin/archive/2009/08/25/requiring-ssl-for-asp-net-mvc-controllers.aspx
[3]SSL pages under ASP.NET MVC
http://stackoverflow.com/questions/156748/ssl-pages-under-asp-net-mvc
[4]http://es.wikipedia.org/wiki/Hypertext_Transfer_Protocol_Secure
[5]Enabling SSL on IIS 7.0 Using Self-Signed Certificates http://weblogs.asp.net/scottgu/archive/2007/04/06/tip-trick-enabling-ssl-on-iis7-using-self-signed-certificates.aspx
[6] Configure IIS http://learn.iis.net/page.aspx/144/how-to-set-up-ssl-on-iis-7/
[7] IIS 7 SSL Certificate Installation http://www.digicert.com/ssl-certificate-installation-microsoft-iis-7.htm
[8] Enable SSL on IIS 7 (Spanish) http://thinkingindotnet.wordpress.com/2007/04/06/trucos-habilitar-ssl-en-iis-70-usando-certificados-firmados-por-nosotros/
[9] IIS7 - How to Install GoDaddy SSL Certificate http://www.netometer.com/video/tutorials/iis7-godaddy-ssl-certificate/
[10] Self-Signed Certificates on IIS 7 – the Easy Way and the Most Effective Way http://www.robbagby.com/iis/self-signed-certificates-on-iis-7-the-easy-way-and-the-most-effective-way/

Thursday, March 17, 2011

Salesforce::Override save method of Opportunity

Apex Class
====================================================================================

public class OpportunityEditControllerExtension {

public String status;
public String getStatus() {return status;}

public opportunity oppo;
private final ApexPages.StandardController controller;

//initializes the private member variables
public OpportunityEditControllerExtension(ApexPages.StandardController stdController)
{
controller= stdController;
this.oppo= (opportunity)controller.getRecord();
}


public PageReference mysave()
{
try{
update oppo;
}
catch(DmlException ex){
ApexPages.addMessages(ex);
}
status='Updated...';
//PageReference sc = new ApexPages.StandardController(oppo).view();
//return sc;
return null;
}
}
====================================================================================

Apex Page
====================================================================================
<apex:page standardcontroller="opportunity" extensions="OpportunityEditControllerExtension" >
<apex:form >
<apex:pageblock >
<apex:pageBlockButtons >
<apex:commandbutton value="Save" action="{!mysave}" rerender="resultsPanel" status="status"/>

<apex:inputfield value="{!opportunity.name}"/>
<apex:inputfield value="{!opportunity.amount}"/>
<apex:inputfield value="{!opportunity.closedate}"/>

<apex:actionStatus id="status" startText="Fetching map..."/>
<apex:outputPanel id="resultsPanel">





Salesforce::Apex Page::Add extensions

Load another objetcts
http://stackoverflow.com/questions/3552779/salesforce-softphone-relate-call-to-records-in-two-different-objects


Adding Custom List Buttons using Standard List Controllers
http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_sosc_custom_button.htm

Tuesday, March 15, 2011

Servlet::Make PDF

http://www.geek-tutorials.com/java/itext/servlet_jsp_output_pdf.php


iText->Códigos de Barra
http://www.itextpdf.com/themes/keyword.php?id=373
Other methods
http://www.bokai.com/BarcodeJSP/
http://stackoverflow.com/questions/1700597/barcode-image-generator-in-java

Salesforce::Class for Retrieve data from another URL using JSON

1) You need register url of repository.



2) Apex Class
=====================================================================================

public class JsonSecondController {
String name;
public PageReference test() {
return null;
}
public PageReference submit() {
return null;
}

public String getName() { return name;}
public void setName(String nname) { name=nname;}



public List getOptions()
{

List defaultResult= new List();
defaultResult.add(new SelectOption('','---'));

list lvalues;
try
{
String values=getJsonString('342096656648874');
lvalues=JSONObject.jsonarray ( new JSONObject.JSONTokener( values ) );
}
catch(Exception e)
{
return defaultResult;
}
return getSelectOptions(lvalues);
}


private String getJsonString(String id) {

String json;
HttpRequest req = new HttpRequest();
Http http = new Http();
req.setMethod('GET');
// generate the url for the request
String url = 'http://datarepository/page.aspx/GetIndustries/'+id;
req.setEndpoint(url);// add the endpoint to the request
req.setCompressed(true);
HTTPResponse resp = http.send(req);
json = resp.getBody().replace('\n', '');

try {
//System.debug('Respond code: ' + resp.getStatus());
return json;
} catch (JSONObject.JSONException e) {
return 'Error parsing JSON response: '+e;
}

}
private List getSelectOptions(list l)
{
List elements=new List();
for (Integer i = 0; i < l.size(); i++){
JSONObject v = l.get(i).obj;
String value=v.getValue('Value').str;
String label=v.getValue('Text').str;
elements.add(new SelectOption(value,label));
}

return elements;
}


}

=====================================================================================


2) Apex Page
=====================================================================================

<apex:page controller="JsonSecondController">
<apex:form >

<apex:selectList id="idindustry" value="{!name}" size="1">
<apex:selectOptions value="{!Options}"/>



<apex:commandButton value="Test" action="{!test}" rerender="out" status="status"/>

<apex:outputPanel id="out">
<apex:actionstatus id="status" startText="testing...">





=====================================================================================

References:

[1] JSONObject http://www.embracingthecloud.com/CommentView,guid,6ca59b34-f896-48a2-b1bf-33ffbe96b4ec.aspx
[2] http://wiki.developerforce.com/index.php/Building_Android_Applications_with_the_Force.com_REST_API
[3] JSON Validator page http://www.jsonlint.com/

Monday, March 14, 2011

JasperReport::Export to Text

CHAR_WIDTH = REPORT_WIDTH / MAX_CHAR_PER_ROW=524 / 80 = 6.55 //6
CHAR_HEIGHT = REPORT_HEIGHT / MAX_CHAR_PER_COL =524 / 44 = 11.9 //11//10


JRTextExporter exporter = new JRTextExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "c:\\textreport1.txt");
exporter.setParameter(JRTextExporterParameter.CHARACTER_WIDTH, new Integer(6));
exporter.setParameter(JRTextExporterParameter.CHARACTER_HEIGHT, new Integer(11));
exporter.exportReport();



References
[1]http://www.coderanch.com/t/62982/open-source/Jasper-Report-Text-Exporter
[2] http://www.cepeu.edu.py/LIBROS_ELECTRONICOS_3/lpcu089%20-%2001.pdf
[3] http://chuwiki.chuidiang.org/index.php?title=Ejemplo_b%C3%A1sico_con_Jasper_Report

PostgreSql Date Format

If you need change date format into postgres database, need execute next commands

SET DATESTYLE TO Postgres,US;
or
SET DATESTYLE TO iso,dmy --dd/mm/yyyy

this setting apply to current session; for permanent change modify postgresq.conf, section Locale and Formatting:

datestyle = 'iso, mdy'

Now you need reestart database

#service postgresql restart


Reload config settings without restarting database
If you are making modifications to the file postgresql.conf (or similar), and you want to new settings to take effect without needing to restart the entire database, there are two ways to accomplish this.

Option 1: From the command-line shell
#su - postgres
$/usr/bin/pg_ctl reload

Option 2: Using SQL

SELECT pg_reload_conf();

Using either option will not interrupt any active queries or connections to the database.

References:
[1] SET http://www.commandprompt.com/ppbook/r28464
[2] http://heatware.net/databases/postgresql-reload-config-without-restarting/

Thursday, February 17, 2011

Wireless::Proveedores de Equipos

http://www.digitalstoreperu.com/tienda/category.php?id_category=18

Precios
http://www.diazcomunicaciones.com/tienda

Wireless Metrics

dBm is defined as power ratio in decibel (dB) referenced to one milliwatt (mW). It is an abbreviation for dB with respect to 1 mW and the "m" in dBm stands for milliwatt.

dBm is different from dB. dBm represents absolute power, whereas dB is a ratio of two values and is used to represent gain or attenuation. For example, 3 dBm means 2 mW, and 3 dB means a gain of 2. Similarly, -3 dBm means 0.5 mW, whereas -3 dB means attenuation of 2.

The formula to calculate dBm from mW is:

dBm = 10 log10( P )
1mW

Table of dBm and mW
http://www.guatewireless.org/internetworking/redes/wireless/tabla-de-relacion-entre-dbm-y-potencia-de-transmision-wlan/

Friday, February 04, 2011

Postgres Auditory

Trace connections
select * from pg_stat_activity;

select client_addr,count(*) from pg_stat_activity group by client_addr;

select datname,client_addr,count(*) from pg_stat_activity group by datname,client_addr;

Test times of count(*)

EXPLAIN ANALYZE SELECT COUNT(*) FROM remitos;

Obtain rows(tuples) info

select * from pg_class where relname = 'remitos' and relkind = 'r';
select * from pg_stat_all_tables where relname = 'remitos';

and look at the n_tup_ins, n_tup_del, ...


references:
http://www.postgresonline.com/journal/archives/134-Terminating-Annoying-Back-Ends.html

Thursday, February 03, 2011

Salesforce Test Visual Apex Pages

1) Page.existingPageName

2) PageReference pageRef = new PageReference('partialURL');
PageReference pageRef = new PageReference('/apex/HelloWorld');

3) PageReference pageRef = new PageReference('fullURL');
PageReference pageRef = new PageReference('http://www.google.com');

4) PageReference pageRef = ApexPages.currentPage();

Executing page:
https://c.na7.visual.force.com/apex/SecondAccount


References

Displaying JIRA related information in Salesforce.com
http://www.customware.net/repository/pages/viewpage.action?pageId=62455956

Wednesday, February 02, 2011

Wireless Punto a Punto :: Requisitos x distancia

Enlace punto a punto(requisitos x distancias):

Enlace 3Km entre 02 locales:
02 Antenas Hyperlink de 15 dBi (U$ 73 c/u)
02 AP(AccessPoint) TRENDnet de 54 Mbps (U$ 107 c/u)
02 pigtail de 60 cm (U$ 25 c/u)

Puede lograr enlaces de hasta 7Km usando AP(TRENDnet , DLINK , LINKsys , Edimax)


Enlace 8Km:
02 Antenas Hyperlink de 24 dBi (U$ 107 c/u)
02 AccessPoint(AP) Trendnet de 54 Mbps (U$ 110 c/u)
02 pigtail de 2 metros (U$ 34 c/u)


Enlace 1Km:
02 Antena Hyperlink Flat Panel de 14 dBi (U$ 45 c/u)
02 AP TP-LINK 54 Mbps (U$ 79 c/u)
02 Pigtail de 60 cm. (U$ 22 c/u)


Referencias
http://www.ds3comunicaciones.com/
http://www.opcionweb.com/index.php/2008/03/04/tipos-de-antenas-wifi/

Saturday, January 15, 2011

Thursday, January 13, 2011

Reciclar encendedores

http://www.dogguie.com/reciclando-viejos-encendedores-desechables/?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+dogguie+%28Dogguie%3A+curiosidades%2C+rarezas+y+humor%29

Monday, January 10, 2011

Funny links II

Transformers
http://www.dogguie.com/transformers-hechos-con-chatarra/

http://dailyartcocktail.com/what-happens-when-cartoons-meet-art/?utm_source=wahoha.com&utm_medium=referral&utm_campaign=wahoha

http://www.usfunny.info/2011/01/indecent-behavior-of-couples-in-street.html

http://www.antaresonline.com/2011/01/07/the-best-butt-on-the-web/
http://www.sharenator.com/Wind_versus_Miniskirts/#/wind_vs_miniskirt3-13.html

Friday, January 07, 2011

Running apps

Runtastic (I uninstalled because force to update your device - Internet connection problems) Runkeeper  (Currently testing) Strava   (Curre...