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
@jaehoo
jaehoo / QueueService.java
Created July 17, 2022 07:09
Demo AWS SQS
package org.example;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.auth.BasicSessionCredentials;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.securitytoken.AWSSecurityTokenService;
@jaehoo
jaehoo / XmlReportParser.java
Created April 6, 2020 15:43
sonar-jacoco plugin, change to support multiple charset to parse jacoco.xml report
public class XmlReportParser {
private final Path xmlReportPath;
public XmlReportParser(Path xmlReportPath) {
this.xmlReportPath = xmlReportPath;
}
public List<SourceFile> parse() {
XMLInputFactory factory = XMLInputFactory.newInstance();
factory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, false);
@jaehoo
jaehoo / sonar.sh
Created April 26, 2017 18:47
Sonar Service shell script
#!/bin/bash
### BEGIN INIT INFO
# Provides: Sonar
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/Stop Sonar Server
### END INIT INFO
@jaehoo
jaehoo / tomcat.sh
Created February 14, 2017 18:02
Tomcat Startup Script Ubuntu
#!/bin/bash
### BEGIN INIT INFO
# Provides: tomcat7
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/Stop Tomcat server
### END INIT INFO
@jaehoo
jaehoo / kubuntu_audio_fix.sh
Created January 19, 2017 00:14
Kubuntu 16.04 fix no sound
#!/bin/bash
rm -f ~/.config/akonadi/agentsrc
rm -f ~/.config/akonadi/akonadiconnectionrc
rm -f ~/.config/akonadi/akonadiserverrc
rm -rf ~/.config/pulse
@jaehoo
jaehoo / UserDefineFunctions.Java
Created October 9, 2016 03:31
Fill import with zeroes to left
/**
* Auto complete number with zeroes to left from String value
**/
public String fillNumerZero(String value, int numLeftDigits, Container container) throws StreamTransformationException{
if ( value == null || value.trim().length()==0 ){
return "_sUpPresSeD_";
}
else if(value.length() < numLeftDigits){
return String.format ("%0"+numLeftDigits+"d", Integer.valueOf(value));
@jaehoo
jaehoo / ReplacementString.java
Created October 1, 2016 06:23
Replacement Characters in String
package com.mycompany.app;
/**
* Created by asanchez on 28/09/16.
*/
public class ReplacementString {
private static final String[] REPLACEMENT = new String[Character.MAX_VALUE+1];
static {
for(int i=Character.MIN_VALUE;i<=Character.MAX_VALUE;i++)
@jaehoo
jaehoo / CapitalizeText.java
Created September 28, 2016 18:11
Capitalize Text Java
public void capitalize(String text){
int i=0;
char pc=' ';
StringBuilder result = new StringBuilder();
for(char c: text.toLowerCase().toCharArray()){
if (pc == ' ' || pc == '\t' || i == 0) {
@jaehoo
jaehoo / standalone.conf
Created October 18, 2015 23:45
JBoss EAP 6.2 standalone.conf to link JConsole/JVisual VM
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=6789"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=127.0.0.1"
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.1.Final-redhat-1.jar"
@jaehoo
jaehoo / sonar-project.properties
Created August 26, 2015 18:46
SOnar properties
#Required project data fron sonar
sonar.projectKey=eph-conafys
sonar.projectName=eph-conafys
sonar.projectVersion=1.0
sonar.sourceEncoding=ISO-8859-1
#Source code directories names
sonar.sources=src
sonar.modules=Conafys,ConafysReportes