Skip to content

Instantly share code, notes, and snippets.

View aVolpe's full-sized avatar
:electron:
Hacking

Arturo Volpe aVolpe

:electron:
Hacking
View GitHub Profile
@aVolpe
aVolpe / datasource.xml
Created September 12, 2014 19:31
Jboss sample informix datasource
<datasource jta="true" jndi-name="java:jboss/datasources/CopacoBillingDS" pool-name="CopacoBillingDS" enabled="true" use-ccm="true">
<connection-url>jdbc:informix-sqli://10.13.200.41:9088/copaco_prueba01:informixserver=copacodb</connection-url>
<driver>informix-jdbc</driver>
<security>
<user-name>USER</user-name>
<password>PASS</password>
</security>
</datasource>
@aVolpe
aVolpe / Vibration.cs
Created October 16, 2014 02:45
Vibration for Unity3d with Android native Call, with fallback to Handlheld.Vibrate()
using UnityEngine;
using System.Collections;
public static class Vibration
{
#if UNITY_ANDROID && !UNITY_EDITOR
public static AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
public static AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
public static AndroidJavaObject vibrator = currentActivity.Call<AndroidJavaObject>("getSystemService", "vibrator");
#!bin/bash
ps -eF | grep jboss | grep server | tr -s " " | cut -d " " -f2 | xargs kill -9
su - jboss -c 'nohup sh /opt/jboss/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0' &
@aVolpe
aVolpe / Q27758304.java
Created January 4, 2015 07:41
Answers to the Question Q27758304 of StackOverflow
package py.com.volpe.stack;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType;
@aVolpe
aVolpe / AuditCallback.java
Last active August 25, 2017 06:40
Audit with flyway and postgresql
package test;
import java.sql.Connection;
import org.flywaydb.core.api.MigrationInfo;
import org.flywaydb.core.api.callback.FlywayCallback;
public class AuditCallback implements FlywayCallback {
@Override
@aVolpe
aVolpe / service.bat
Created October 30, 2015 20:19
Jboss as service
---------------------------------------------------------------------------------------------------
@echo off
REM JBoss, the OpenSource webOS
REM
REM Distributable under LGPL license.
REM See terms of license at gnu.org.
REM
REM -------------------------------------------------------------------------
REM JBoss Service Script for Windows
REM -------------------------------------------------------------------------
@aVolpe
aVolpe / test.py
Created January 25, 2016 19:54
Ejemplo de scraping con python para curso de open data
import urllib2
from bs4 import BeautifulSoup
e = urllib2.urlopen("http://es.wikipedia.org/wiki/Paraguay").read()
soup = BeautifulSoup(e, 'html.parser')
# Ejemplo de como imprimir todo
# print soup.prettify()
@aVolpe
aVolpe / scraper.py
Last active August 18, 2020 14:21
Extractor de información histórica de cotizaciones en Paraguay
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Dependencias:
# - beautifulsoup4
import sys
import time
import urllib
import urllib.request
@aVolpe
aVolpe / paraguay.json
Created February 10, 2016 22:34
GeoJson de los departamentos del Paraguay
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aVolpe
aVolpe / Dockerfile
Last active August 2, 2024 05:00
A example dockerfile to use pgFouine with postgresql 9.4
FROM postgres:9.4
MAINTAINER Arturo Volpe <arturovolpe@gmail.com>
ENV DB_NAME test
ENV DB_USER admin
ENV DB_PASS password
RUN apt-get update && apt-get install -y wget && wget --no-check-certificate --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
RUN apt-get update && apt-get install -y postgresql-9.3-postgis-2.1 -f
ADD setup-database.sh /docker-entrypoint-initdb.d/ # this scripts creates a database, is optional