Skip to content

Instantly share code, notes, and snippets.

View jaehoo's full-sized avatar
💭
X it's a variable, it represents unlimited potential

Alberto Sanchez jaehoo

💭
X it's a variable, it represents unlimited potential
View GitHub Profile
public class HelloWorld{
}
import java.util.Locale;
import java.util.Scanner;
/**
* Created by Orbital Zero.
* <p/>
* User: jaehoo
* Date: 18/12/12
* Time: 20:24
*/
@jaehoo
jaehoo / gist:4334009
Created December 19, 2012 02:59
La maquina virtual de Java toma el formato para leer los números de la region donde esta instalado, por defecto en nuestras maquinas es el de españa "es_ES". Para los números utiliza "la coma , " en lugar del "punto ." Cuando tu escribes "1.8" no lo reconoce y lanza la exception, pero si escribes "1,8" lo lee correctamente. Lo que hay que hacer …
import java.util.Locale;
import java.util.Scanner;
/**
* Created by Orbital Zero.
* <p/>
* User: jaehoo
* Date: 18/12/12
* Time: 20:24
*/
@jaehoo
jaehoo / gist:4540736
Created January 15, 2013 18:24
Script to Manage Jboss Service into SUSE 10 (SLES 10)
#! /bin/sh
export JBOSS_HOME=/usr/share/jboss-6.1.0.Final
start(){
echo "Starting jboss.."
# If using an SELinux system such as RHEL 4, use the command below
# instead of the "su":
# eval "runuser - jboss -c '/opt/jboss/current/bin/run.sh > /dev/null 2> /dev/null &'
@jaehoo
jaehoo / jboss-classloading.xml
Created January 16, 2013 23:52
Example configuration file for Jboss Application Server 6
<?xml version="1.0" encoding="UTF-8"?>
<classloading xmlns="urn:jboss:classloading:1.0"
parent-first="false"
domain="AppBuild"
top-level-classloader="true"
export-all="NON_EMPTY"
import-all="false">
</classloading>
@jaehoo
jaehoo / httpd.conf
Created January 21, 2013 03:51
Example to create virtual host with, proxy reverse java webapp and redirect all request to secure port (433)
<VirtualHost *:80>
ServerAdmin webmaster@orbitalzero.com
#DocumentRoot “/var/www/oz”
ServerName local.orbitalzero.com
ServerAlias orbitalzero.com
ProxyPass /jbossb http://192.168.1.68:8080/proveedores
ProxyPassReverse /jbossb http://192.168.1.68:8080/proveedores
ProxyRequests Off
@jaehoo
jaehoo / httpd.conf
Created January 21, 2013 22:37
Apache Server, porxy configuration. Exponer una aplicación web por medio de apache server direcatemente a la raíz.
<IFModule mod_proxy.c>
<VirtualHost *:80>
ServerAdmin webmaster@orbitalzero.com
ServerName myserver.com
ServerAlias tomcat.server
ProxyPass / http://192.168.1.67:8080/mywebapp/
ProxyPassReverse / http://192.168.1.67:8080/mywebapp/
@jaehoo
jaehoo / httpd.conf
Last active June 2, 2018 10:54
Apache Reverse proxy configuration: - proxied sites with by https - proxied web sites with java servers by ajp protocol - proxyed cookies ** You need installed a SSL cert to access https resources
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"
User apache
Group apache
@jaehoo
jaehoo / httpd.conf
Last active December 14, 2015 08:38
Apache Proxy + Sprong Security, fix to reqrite url and use apache in front of java app server
<IFModule mod_proxy.c>
<VirtualHost *:80>
DocumentRoot "/var/www/html"
<Directory "/var/www/html">
AllowOverride All
Allow from All
</Directory>
ServerAdmin webmaster@orbitalzero.com
@jaehoo
jaehoo / TestCompareDateHour.java
Created November 26, 2013 17:22
Compare if current Hour is in the range between two hours
package test;
import java.util.Calendar;
/**
* Created with IntelliJ IDEA.
* User: asanchez
* Date: 26/11/13
* Time: 10:52 AM
*