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
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/
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">
====================================================================================
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
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
Salesforce::Class for Retrieve data from another URL using JSON
1) You need register url of repository.
2) Apex Class
=====================================================================================
=====================================================================================
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/
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 ListgetOptions()
{
ListdefaultResult= new List ();
defaultResult.add(new SelectOption('','---'));
listlvalues;
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 ListgetSelectOptions(list l)
{
Listelements=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
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/
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/
Friday, March 11, 2011
Salesforce::ApexPage::Retrieve remote data
Http Request
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http.htm
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_httprequest.htm
Xml DOM
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_xml_dom_xmlnode.htm
Test Methods and Apex Callouts
http://wiki.developerforce.com/index.php/An_Introduction_to_Apex_Code_Test_Methods
references
[1] On Line Json Viewer http://jsonviewer.stack.hu/
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http.htm
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_httprequest.htm
Xml DOM
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_xml_dom_xmlnode.htm
Test Methods and Apex Callouts
http://wiki.developerforce.com/index.php/An_Introduction_to_Apex_Code_Test_Methods
references
[1] On Line Json Viewer http://jsonviewer.stack.hu/
Thursday, March 10, 2011
AFPs y EsSalud
Averigüe si está afiliado al Sistema Privado de Pensiones (SPP)
http://www.sbs.gob.pe/0/modulos/JER/JER_Interna.aspx?ARE=0&PFL=1&JER=250
https://www2.sbs.gob.pe/afiliados/paginas/Consulta.aspx
EsSalud
http://ww4.essalud.gob.pe:7777/acredita/
https://dondemeatiendo.essalud.gob.pe
Reniec (Número y Nombre solamente)
https://portaladminusuarios.reniec.gob.pe/validacionweb/index.html
Sunat (padron_reducido_ruc.zip) ~ 280M
https://www.sunat.gob.pe/descargaPRR/mrc137_padron_reducido.html
Monday, March 07, 2011
Saturday, March 05, 2011
Postgres Backup CentOS
#su postgres
$ pg_dump -Ft mydb > db.tar
$ pg_restore -d newdb db.tar
References:
[1]http://linux.die.net/man/1/pg_dump
[2]http://linux.die.net/man/1/pg_restore
$ pg_dump -Ft mydb > db.tar
$ pg_restore -d newdb db.tar
References:
[1]http://linux.die.net/man/1/pg_dump
[2]http://linux.die.net/man/1/pg_restore
Tuesday, March 01, 2011
Como importar::referencias
Averiguar subpartida nacional (partida arancelaria)
http://www.siicex.gob.pe/siicex/portal5ES.asp?_page_=234.00000
http://www.aduanet.gob.pe/itarancel/arancelS01Alias
Luego en la misma pagina
http://www.aduanet.gob.pe/itarancel/arancelS01Alias
ingresar el codigo y saldrán los aranceles a pagar
mas referencias:
http://www.pymex.pe/emprendedores/tramites/4857-importacion-definitiva-aduanera.html
http://soloempresas.ning.com/profiles/blogs/despacho-simplificado-de?xg_source=activity
http://www.siicex.gob.pe/siicex/portal5ES.asp?_page_=234.00000
http://www.aduanet.gob.pe/itarancel/arancelS01Alias
Luego en la misma pagina
http://www.aduanet.gob.pe/itarancel/arancelS01Alias
ingresar el codigo y saldrán los aranceles a pagar
mas referencias:
http://www.pymex.pe/emprendedores/tramites/4857-importacion-definitiva-aduanera.html
http://soloempresas.ning.com/profiles/blogs/despacho-simplificado-de?xg_source=activity
Saturday, February 26, 2011
Friday, February 25, 2011
Thursday, February 24, 2011
Tuesday, February 22, 2011
Monday, February 21, 2011
Salesforce::ApexPage::Retrieve data from cross domain
Calling a REST Web Service (JSON) with Apex
http://blog.jeffdouglas.com/2010/01/06/calling-a-json-rest-web-service-with-apex/
Related:
[1] Passing parameters to VFP
http://www.forcetree.com/2009/06/passing-parameters-to-visualforce-page.html
http://blog.jeffdouglas.com/2010/01/06/calling-a-json-rest-web-service-with-apex/
Related:
[1] Passing parameters to VFP
http://www.forcetree.com/2009/06/passing-parameters-to-visualforce-page.html
Friday, February 18, 2011
Subscribe to:
Posts (Atom)
-
Resources: [1] Hela https://ome.grc.nia.nih.gov/iicbu2008/hela/index.html
-
en inglés se llama “A potentially dangerous Request.Form value was detected from the client”. varias páginas indican dos cosas: 1. agrega...
-
mas plugins http://devsnippets.com/reviews/using-jquery-to-style-design-elements-20-impressive-plugins.html http://www.extjs.com/deploy/dev/...
Ubuntu Forware port 80
#!/bin/bash iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8069 iptables -t nat -A PREROUTING -i eth0 -p tc...