Skip to content

Instantly share code, notes, and snippets.

View willianantunes's full-sized avatar
🎯
Focusing

Willian Antunes willianantunes

🎯
Focusing
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<Environment
xmlns="http://schemas.dmtf.org/ovf/environment/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:oe="http://schemas.dmtf.org/ovf/environment/1"
xmlns:ve="http://www.vmware.com/schema/ovfenv"
oe:id=""
ve:vCenterId="vm-610">
<PlatformSection>
<Kind>VMware ESXi</Kind>
#! /usr/bin/python
# Script to set network parameters from 'vmtoolsd --cmd "info-get guestinfo.ovfenv"'. It is designed for SLES 11 SP3
# Author: Willian Antunes
# Date of creation: September 03, 2014
import os, sys, time, subprocess, re
from xml.dom.minidom import parseString
def findXmlSection(dom, sectionName):
sections = dom.getElementsByTagName(sectionName)
package br.com.willianantunes.utils.datatables;
import java.util.ArrayList;
import java.util.List;
/**
* This class can be inherited by another class to expose information compatible with
* jQuery DataTables v1.9.4. The constructor of the class that will inherit this one, must set some attributes to
* enable DataTables plugin work properly.
* @author Willian Antunes
package br.com.willianantunes.utils.datatables;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.LogManager;
$(document).ready(function(){
$.LABDT = new Object();
$.LABDT.url = "<c:url value="/"/>";
$.LABDT.dataTables_LanguageFile = $.LABDT.url + "js/dataTables/languages/" + "dataTables." + "<fmt:message key="config.language"/>" + ".txt";
$.LABDT.dataTables_SearchName = "<fmt:message key="config.datatables.search.name"/>";
$('#usersDataTable').dataTable({
"bAutoWidth":true,
"bPaginate": true,
package br.com.willianantunes.utils;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.joda.time.DateTimeConstants;
import org.joda.time.LocalDate;
/**
#!/bin/bash
# Checks the requests status available in an access.log file and outputs the first 20 lowest responses.
# The following pattern is expected: '%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i" %Dms'
# Author: Thiago Ferreira (https://github.com/tfc1304)
# Example of command to use it: ./check-access-log.sh '/my-path/services/rest/users' '/tmp/access_log.2017-03-03'
RED='\033[0;31m'
BLUE='\033[1;34m'
GREEN='\033[1;32m'
YELLOW='\033[1;33m'
package br.com.willianantunes.analyser;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.*;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@willianantunes
willianantunes / TwitterSnifferRoute.java
Created May 31, 2017 19:01
Class used for my blog post
package br.com.willianantunes.test.routes;
import java.time.LocalDateTime;
import java.time.ZoneId;
import org.apache.camel.LoggingLevel;
import org.apache.camel.PropertyInject;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.jackson.JacksonDataFormat;
import org.apache.camel.component.twitter.TwitterComponent;
@willianantunes
willianantunes / MyFunctionalPostBlog.java
Last active June 1, 2017 11:33
Class used for my blog post
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.LocalDate;
import java.time.Month;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.regex.Matcher;