Skip to content

Instantly share code, notes, and snippets.

@jorgeuriarte
jorgeuriarte / AndroidManifestDecompressor.groovy
Created September 19, 2016 10:08 — forked from seymores/AndroidManifestDecompressor.groovy
Extract AndroidManifest.xml information.
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
class AndroidXMLDecompress {
// decompressXML -- Parse the 'compressed' binary form of Android XML docs
// such as for AndroidManifest.xml in .apk files
@jorgeuriarte
jorgeuriarte / closureTimer.groovy
Created October 12, 2016 12:18
Ejemplo de contexto de closures arrastrado en Groovy
@Grab("io.vertx:vertx-core:3.3.3")
import io.vertx.core.Vertx
def schedulerId
def vertx = Vertx.vertx()
(1..10).each { it ->
vertx.setTimer(2000, {
println """
Hola, este es ${schedulerId}
@jorgeuriarte
jorgeuriarte / checkssl.sh
Created October 25, 2016 14:58
Check SSL Ciphers available in a given URL
#!/usr/bin/env bash
#OpenSSL requires the port number.
#ws.seur.com
#SERVER=80.65.15.72:443
SERVER=54.187.119.242:443
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
@jorgeuriarte
jorgeuriarte / Twitter API with Curl
Created December 9, 2016 20:55 — forked from apolloclark/Twitter API with Curl
Twitter API with Curl
# create an account, create an app
# @see https://apps.twitter.com/
# retrieve the access tokens
# @see https://dev.twitter.com/oauth/reference/post/oauth2/token
# create the file ~/twitter_api
nano ~/twitter_api
Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0"
@Grab(group='org.modelcatalogue', module='spreadsheet-builder-poi', version='0.3.1')
@Grab(group='commons-codec', module='commons-codec', version='1.10')
@GrabExclude('org.codehaus.groovy:groovy-all')
import org.modelcatalogue.spreadsheet.api.Cell
import org.modelcatalogue.spreadsheet.builder.poi.PoiSpreadsheetBuilder
import org.modelcatalogue.spreadsheet.query.api.SpreadsheetCriteria
import org.modelcatalogue.spreadsheet.query.poi.PoiSpreadsheetCriteria
File file = new File('report.xlsx')
def profileInfo(username) {
final String TOK1 = 'window._sharedData = '
final String TOK2 = ';</script>'
def insta = "https://instagram.com/${username}".toURL().text
def text = insta.split(TOK1)[1].split(TOK2)[0]
def json = new groovy.json.JsonSlurper().parseText(text)
[username: username,
followers: json.entry_data.ProfilePage[0].user.followed_by.count,
media: json.entry_data.ProfilePage[0].user.media.nodes.collect( { item -> item.subMap(['code', 'date', 'caption', 'likes', 'comments']) } )
]
@jorgeuriarte
jorgeuriarte / ssh
Created May 15, 2017 09:30
Cambio de fondo para sesiones de terminal
#!/bin/sh
#
# Ponerlo en bin/ssh
#
HOSTNAME=`echo $@ | sed s/.*@//`
set_prod_settings() {
osascript -e "Tell application \"Terminal\" to set current settings of front window to settings set \"Red Sands\""
}
@jorgeuriarte
jorgeuriarte / out.xml
Created June 7, 2017 08:59
Respuesta y petición SEUR / FR
<?xml version='1.0' encoding='ISO-8859-1'?>
<root><main>EL FICHERO INTEGRADO NO HA SUPERADO EL PROCESO DE VALIDACION</main>
<errorVal>
<codigo>5</codigo>
<descripcion>ECB NUMERACIÓN CORRECTA</descripcion>
<nombreCampo>cod_barras_ECB</nombreCampo>
<nombreCampo>numerador_etiq</nombreCampo>
</errorVal>
</erroresEnvio>
</root>
package com.evandti;
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import com.opensymphony.oscache.base.Cache;
import com.opensymphony.oscache.web.ServletCacheAdministrator;
@jorgeuriarte
jorgeuriarte / gist:3fa0a0e1e83dc71c6923bf52d40a9f64
Created September 10, 2018 09:00 — forked from trodrigues/gist:1023167
Checkout only certain branches with git-svn
If you want to clone an svn repository with git-svn but don't want it to push all the existing branches, here's what you should do.
* Clone with git-svn using the -T parameter to define your trunk path inside the svnrepo, at the same time instructing it to clone only the trunk:
git svn clone -T trunk http://example.com/PROJECT
* If instead of cloning trunk you just want to clone a certain branch, do the same thing but change the path given to -T:
git svn clone -T branches/somefeature http://example.com/PROJECT