Skip to content

Instantly share code, notes, and snippets.

package test.util;
import org.junit.Assume;
import org.junit.internal.AssumptionViolatedException;
import org.junit.rules.MethodRule;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.Statement;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@jorgevila
jorgevila / Java-memory.txt
Created March 20, 2014 11:29
Java memory space
java -Xms128m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m
@jorgevila
jorgevila / app_backup.sh
Created April 22, 2014 11:49
Android backup
#!/bin/bash
adb backup -f data.ab -noapk com.package
dd if=data.ab bs=1 skip=24 | openssl zlib -d | tar -xvf
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;

###Install APK file using Gradle and Command Line

1.- First thing, install Gradle SDK. Download the latets version and install it in your root.

https://gradle.org/

2.- You'll need to have Android Studio installed also.

3.- Configure bash_profile file

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>App Redirection</title>
</head>
<body>
<!-- iframe used for attempting to load a custom protocol -->
<iframe style="display:none" height="0" width="0" id="loader"></iframe>
@jorgevila
jorgevila / SSLPoke.java
Created October 1, 2015 14:11
SSL Check
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {
@jorgevila
jorgevila / bash_path
Created May 28, 2012 10:30
Bash get script path
You can't use $0 because that gives only a relative path if the script is run with a command like ./myscript.sh.
The method below works well for both Linux and Mac OS X. It's a bit weird, but works.
#!/bin/bash
#==========================
# bash - find path to script
#==========================
abspath=$(cd ${0%/*} && echo $PWD/${0##*/})
@jorgevila
jorgevila / bash_path
Created May 28, 2012 10:30
Bash get script path
You can't use $0 because that gives only a relative path if the script is run with a command like ./myscript.sh.
The method below works well for both Linux and Mac OS X. It's a bit weird, but works.
#!/bin/bash
#==========================
# bash - find path to script
#==========================
abspath=$(cd ${0%/*} && echo $PWD/${0##*/})