Skip to content

Instantly share code, notes, and snippets.

@kopiro
kopiro / gist:62a0d3d07846ab6cee3d0ce928038f01
Last active October 20, 2017 18:21
iOS App Reverse Engeneering
http://blog.dewhurstsecurity.com/2015/11/10/mobile-security-certificate-pining.html
https://github.com/intrepidusgroup/trustme
https://nabla-c0d3.github.io/blog/2013/08/20/intercepting-the-app-stores-traffic-on-ios/
https://developer.apple.com/library/ios/technotes/tn2232/_index.html
https://books.google.it/books?id=2D50GNA1ULsC&pg=PA186&lpg=PA186&dq=cycript+scripts&source=bl&ots=YQTU0EMbsy&sig=4cptZGKXOlTJ-HahM17LvTsfans&hl=en&sa=X&ved=0ahUKEwjw4aPmja_NAhVErRQKHSJIAwA4ChDoAQg8MAU#v=onepage&q=cycript%20scripts&f=false
@kopiro
kopiro / transformata-ios-to-rr.js
Created June 7, 2016 09:34
Transformata iOS to RR
var RRT = {
dateFormat: 'YYYY-MM-DDTHH:mm:ss.SSS+0000',
map: {
RR_to_IOS: {
freq: {},
weekday: {},
},
IOS_to_RR: {
frequency: {},
weekday: {},
@kopiro
kopiro / gpick
Created June 6, 2016 09:58
Git Pick
#!/bin/bash
# This script pick the latest commit of current branch, apply
# it to another branch (the argument) and push against its remote
# Example: gpick "PR-1234"
branch=$(git rev-parse --abbrev-ref HEAD)
commit=$(git rev-parse HEAD)
git checkout "$1" &&
@kopiro
kopiro / proguard.conf
Last active May 8, 2016 00:17
Example proguard.conf file for Google Play Services SDK.
-injars /opt/android/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar
-outjars google-play-services-light.jar
-libraryjars /opt/android/extras/android/support/v4/android-support-v4.jar
-libraryjars /opt/android/extras/android/support/v7/mediarouter/libs/android-support-v7-mediarouter.jar
-libraryjars /opt/android/platforms/android-23/android.jar
-libraryjars /opt/android/platforms/android-22/android.jar
-dontoptimize
-dontobfuscate
@kopiro
kopiro / php56-oci8-macosx-installation.md
Last active August 28, 2017 08:08
PHP 5.6 OCI8 installation

PHP OCI8 installation

Download the InstantClient from the Oracle website

  • instantclient-basic-macos.x64-VERSION.zip
  • instantclient-sqlplus-macos.x64-VERSION.zip
  • instantclient-sdk-macos.x64-VERSION.zip

Create and unzip all theses files into a the directory /opt/instantclient/VERSION

@kopiro
kopiro / MySQLEncoder.php
Last active April 3, 2020 20:23
MySQLEncoder
<?php
class MySQLEncoder {
public static function listOfObjects($attrs, $table, $as = '_', $intvals = []) {
$intvals = array_flip($intvals);
return 'CONCAT("[", GROUP_CONCAT(CONCAT("{",' . implode(', "," ,', array_map(function($a) use ($table) {
$is_int = isset($intvals[$a]) || $a === 'id';
$mysql_a = $table . '.' . $a;
return '"\"' . $a . '\"' . ':' . '", ' .
@kopiro
kopiro / main.js
Last active April 29, 2016 10:40
Random fixed sequence repetion
// this value define how many entropy add
var ENTROPY_ITERATION = 1;
// how many times multiply the array
var MULTIPLIER = 1000000;
// the output array
var A = [];
// the matrix generator
(function($) {
var supportedServices = {
'weibo': 'http://service.weibo.com/share/share.php?title={{title}}&url={{url}}&pic={{pic}}',
'douban': 'http://shuo.douban.com/!service/share?name={{title}}&href={{url}}&image={{pic}}',
'kaixin': 'http://www.kaixin001.com/repaste/bshare.php?rtitle={{title}}&rurl={{url}}',
'netease': 'http://t.163.com/article/user/checkLogin.do?info={{title}}',
'qq_t': 'http://v.t.qq.com/share/share.php?title={{title}}&url={{url}}&pic={{pic}}',
'qq_zone': 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title={{title}}&url={{url}}&pics={{pic}}',
'renren': 'http://share.renren.com/share/buttonshare.do?title={{title}}&link={{url}}',
'sohu': 'http://t.sohu.com/third/post.jsp?title={{title}}&url={{url}}&content=utf-8',
@kopiro
kopiro / eventaggregator.js
Created March 26, 2016 12:11
Simple event aggregator
var EventAggregator = function() {
this._events = {};
};
EventAggregator.prototype.trigger = function (msg) {
var args = Array.prototype.splice.call(arguments, 1);
for (var i = 0, len = (this._events[msg] || []).length; i < len; i++) {
this._events[msg][i].apply(this, args);
}
};
@kopiro
kopiro / nbn.js
Created February 25, 2016 20:49
Next bigger number with the same digits
function nextBigger(n){
var d = n.toString().split('');
// find the pivot, the point (from right) where i > i-1
var p = -1;
for (var i = d.length-1; i > 0; i--) {
if (+d[i] > +d[i-1]) {
p = i-1;
break;
}