Skip to content

Instantly share code, notes, and snippets.

View bertrandmartel's full-sized avatar
💤
👀

Bertrand Martel bertrandmartel

💤
👀
View GitHub Profile
@bertrandmartel
bertrandmartel / convert_to_p12.sh
Created May 16, 2015 00:29
[ SHELL ] convert public cert + private key + ca cert to pkcs12 cert
openssl pkcs12 -export -out cert.p12 -inkey cert.key -in cert.crt -certfile ca.crt
@bertrandmartel
bertrandmartel / debug_java.sh
Created May 16, 2015 00:35
[ JAVA ] set ssl debug
-Djavax.net.debug=ssl
@bertrandmartel
bertrandmartel / wireshark
Created May 16, 2015 00:42
wireshark useful filters
ip.src == 192.168.43.47 && ip.dst == 192.168.43.47
@bertrandmartel
bertrandmartel / openssl_debug.sh
Created May 16, 2015 16:04
debug ssl connection in command line
openssl s_client -connect 127.0.0.1:443
@bertrandmartel
bertrandmartel / list_objects.js
Created May 26, 2015 00:42
list objects in windows
for(var b in window) {
if(window.hasOwnProperty(b)) console.log(b);
}
@bertrandmartel
bertrandmartel / launch_movies_adb.bat
Last active August 29, 2015 14:22
launch movies with adb on windows
SET ADB_PATH=C:\Users\Akinaru\AppData\Local\Android\sdk\platform-tools\adb.exe
SET CONTAINSCONNECTED="connected"
SET IP1="192.168.2.210"
SET IP2="192.168.2.222"
SET IP3="192.168.2.205"
SET IP4="192.168.2.114"
SET IP5="192.168.2.143"
@bertrandmartel
bertrandmartel / rfc3339.js
Last active August 29, 2015 14:27
[ JAVASCRIPT ] Convert a date object to timestamp format according to RFC 3339
function dateFormat(date)
{
var dd = date.getDate();
var mm = date.getMonth()+1;
var yyyy = date.getFullYear();
var hour= date.getHours();
var minutes=date.getMinutes();
var seconds=date.getSeconds();
@bertrandmartel
bertrandmartel / rfc3339.java
Created August 9, 2015 14:04
[ JAVA ] convert String timestamp in RFC 3339 format to date object (only from JAVA 7)
import java.text.SimpleDateFormat;
import java.util.Date;
private void convertRfc3339ToDate(String timestamp)
{
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX").parse(dateStr);
}
@bertrandmartel
bertrandmartel / build.xml
Last active August 29, 2015 14:27
[ ANT ] compile & archive with source attachment projects with source (/src) and libraries (/libs)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="build" name="compile-archive">
<property name="project-name" value="your-project-name"/>
<property name="version" value="1.0" />
<path id="master-classpath">
<fileset dir="${basedir}/libs">
@bertrandmartel
bertrandmartel / formatted_output.txt
Last active August 29, 2015 14:27
[ STACK OVERFLOW ] Format preformatted netstat format to column styled netstat info (usage ./netstat_format.sh output.txt formatted_output.txt
2015-08-13,09:55:27,8080,7,,,,1,,,,,1,,5555,2,,,,,,,1,,,,0
2015-08-13,09:56:27,8080,1,,,,,,,,,1,,5555,1,,,,,,,1,,,,1