Skip to content

Instantly share code, notes, and snippets.

@masbog
masbog / oracle_JDK.sh
Last active August 29, 2015 14:16
Ya coba2, sapa tau berguna buat install Oracle JDK pake RPM -_____-"
#!/bin/bash
# bisa pake kek gini juga kalo mau versi lain nya: /bin/sh oracle_JDK.sh <V> <rpm|tar>
# V: default 8
# rpm
V="8"
EXT="rpm"
if [ -n "$1" ]; then
@masbog
masbog / LoadImage.h
Last active August 29, 2015 14:17 — forked from iamamused/LoadImage.h
//
// LoadImage.h
// AssetsFromPDF
//
// Created by Jeffrey Sambells on 2012-03-02.
//
#import <Foundation/Foundation.h>
@interface LoadImage : NSObject
@masbog
masbog / mesos-init-wrapper
Last active August 29, 2015 14:28
see the initial commit, and edit it for add extend parameter work_dir and cluster name UBUNTU | /usr/bin/mesos-init-wrapper
#!/bin/bash
# masbog ~ custom ~ mesos ~ script
# command will look like :
# sudo /usr/sbin/mesos-master --zk=zk://master-zookeeper:2181/mesos --port=5050 --log_dir=/var/log/mesos --work_dir=/tmp/mesos-master/work_dir --cluster=MASBOG-ECOSYSTEM --hostname=mesos-master --ip=8.0.6.13 --quorum=1
# step :
# mkdir -p /tmp/mesos-master/work_dir
# echo "/tmp/mesos-master/work_dir" >> /tmp/mesos-master/work_dir
# echo "WORKDIR=`cat /etc/mesos/workdir`" >> /etc/default/mesos-slave
# echo "WORKDIR=`cat /etc/mesos/workdir`" >> /etc/default/mesos-master
# echo "MASBOG-ECOSYSTEM" >> /etc/mesos-master/cluster

Object Graph Serialization File Size Comparison

  • Update: Added tbuf, broke out tables, you can use https://github.com/schwa/transmogrifier to convert between msgpack, yaml, bson, json and xml plists

  • Update: Added bencode, renamed tbuf to yabon

  • Update: Added disclamer, added pickle

@masbog
masbog / epoc.h
Created October 25, 2011 04:53
epoc time convert to string
- (NSString*)getDate:(int)time
{
NSMutableString *since = [[[NSMutableString alloc] initWithCapacity:0] autorelease];
NSDate *dateNow = [NSDate date];
NSTimeZone *localeTimeZone = [NSTimeZone localTimeZone];
int timeZoneOffset = [localeTimeZone secondsFromGMT];
int epochnow = [dateNow timeIntervalSince1970];
int when = epochnow - time - timeZoneOffset;
int day = when / 86400;
int dayreminder = when % 86400;
@masbog
masbog / RadioIndoOnLine
Created January 11, 2012 03:26
Radio list using PHP (json)
<?php
header('Content-type: application/json');
if($_GET['list'] == 'jogjastreamers')
{
$url = 'http://www.jogjastreamers.com/m/radiolist_ipad.php';
//open connection
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
@masbog
masbog / karma.php
Created March 26, 2012 21:14
Who Not Following Back You algorith on Twitter
<?php
require_once('twitteroauth/twitteroauth.php');
define('CONSUMER_KEY', '');
define('CONSUMER_SECRET', '');
define('ACCESS_TOKEN', '');
define('ACCESS_TOKEN_SECRET', '');
$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
@masbog
masbog / color.m
Created September 17, 2012 08:41 — forked from kylefox/color.m
Generate a random color (UIColor) in Objective-C
CGFloat hue = ( arc4random() % 256 / 256.0 ); // 0.0 to 1.0
CGFloat saturation = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from white
CGFloat brightness = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from black
UIColor *color = [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1];
@masbog
masbog / floatsign.sh
Created October 18, 2012 11:40 — forked from mediabounds/floatsign.sh
A small bash script to re-sign iOS applications.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@masbog
masbog / captcha.md
Created October 20, 2012 12:21 — forked from Samuirai/captcha.md
G-WAN Captcha Decode

G-WAN is a new free web server. They seem to be very proud of it, or at least just want to make a lot of money. Well anyway, in almost every sentence they write, they claim that they are 20% cooler than anything else. It feels a bit arrogant. I have to admit, I don't know a lot about web servers, so I can't speak to how good they are.

However, then I saw their Captcha example. I also don't know much about machine learning algorithms, OCR, and stuff like that, but I do know how to read pixels. I also know how to compare values with python :P

demo

They say the following about their Captcha: