Skip to content

Instantly share code, notes, and snippets.

View lezi's full-sized avatar
:octocat:

Osvaldo Júnior "mwanalezi" lezi

:octocat:
View GitHub Profile
@lezi
lezi / jre.bat
Created November 13, 2011 20:39 — forked from thesurlydev/jre.bat
@echo off
echo Installing JRE...
start /w C:\temp\jre-1_5_0_12-windows-i586-p.exe /s INSTALLDIR=d:\bin\Java\jre1.5.0_12 REBOOT=Suppress
@lezi
lezi / mysqlsilent.txt
Created November 13, 2011 20:41
Silent instalation of mysql
This entry provides instructions for “silently” installing MySQL on a Microsoft Windows server. I use the term “silent install” to describe the method of passing parameters to the Microsoft Installation Package (MSI) to bypass installation screens. This allows you to deploy MySQL with your application and to install MySQL without end-user intervention. The developer can define the install location, the appropriate storage engines, the root password and the server configuration.
Most application developers use some sort of software for creating an application installer. Common tools include Install Shield, Wise Installation, InstallBuilder and Windows Installer. These installation software tools can also be used to install MySQL by launching the MySQL MSI and the MySQL Instance configuration utility ( MySQLInstanceConfig.exe ) from the command-line.
To get started, download the Windows Essentials from http://dev.mysql.com/downloads.
Then, look for an option in your installation tool to execute the foll
@lezi
lezi / AeroportoConverter.java
Created June 13, 2012 12:37
A JSF Converter model accessing an ejb
/**
*
* @author Mwanalezi
*/
@FacesConverter(value = "aeroportoConverter", forClass = Aeroporto.class)
public class AeroportoConverter implements Converter {
@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
@lezi
lezi / DownloadFileHandler .java
Created June 25, 2012 21:05
Classe utilitária para download de arquivos com JSF
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletResponse;
@lezi
lezi / ProcessadorDeRelatorio.java
Created June 27, 2012 12:55
Processador de relatório para jasper
import edu.ucan.util.JSFUtil;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Map;
import javax.activation.MimetypesFileTypeMap;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.servlet.ServletOutputStream;
@lezi
lezi / global_ajax_status_jsf.js
Created July 30, 2012 14:08
Show Global Ajax Status
/**
* ***************************************
* Show busy status.
* Original from POST: http://ocpsoft.org/java/jsf-java/jsf2-how-to-create-a-global-ajax-status-indicator/
*/
if (!window["busystatus"]) {
var busystatus = {};
}
busystatus.onStatusChange = function onStatusChange(data) {
@lezi
lezi / dyn.txt
Created August 17, 2012 09:45
Dynamic Theme on Primefaces
A nice trip to use EL expression to apply a theme dynamically. See following code snippet :
File : web.xml
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>#{loggedInUser.preferences.theme}</param-value>
</context-param>
mysql> SET foreign_key_checks = 0;
mysql> drop table tabela;
mysql> SET foreign_key_checks = 1;
@lezi
lezi / drop.sh
Created January 9, 2013 08:53
Delete all tables on mysql database
#!/bin/bash
MUSER="$1"
MPASS="$2"
MDB="$3"
# Detect paths
MYSQL=$(which mysql)
AWK=$(which awk)
GREP=$(which grep)
# Puppet manifest for my PHP dev machine
class iptables {
package { "iptables":
ensure => present;
}