Posts Tagged ‘Uncategorized’

Blackberry Color Picker

Color Picker preview

Upon finishing my blackberry application, PhotoCard (it is an application to manipulate photo, add photo filters and text and then share it), there are many requests posted to my email asking for options to change the text color. Blackberry JDE don’t have Color picker field, so I have to create it from scratch. And there’s no blackberry JDE library for the color picker field. Fortunately I found some good codes in Nokia developer website and I just need to convert some of the codes to JDE codes.

So here I share the code, it is already up on the github for you to use. Have fun ;)

Dear Admin: “Please Limit POST/GET request Length”

First of all, I would like to say: Happy new year ;) Haha, this is my first post in 2012 and my first post will began with messages to all admins around the world, to limit their request length. Why? Because it can lead to DOS attack, using a simple POST request with specially crafted messages that can led to huge amount of CPU usages.

I don’t have to explain the background behind it, because many articles has done a great job of explaining. Here’s the related articles explaining the problem:

The most important is the third link, because many sites are using PHP, and so many sites are not yet updated into PHP 5.3, especially shared hosting sites.

Mandiri Transaction Downloader

Following the BCA transaction downloader script, my friend asked me to do the Mandiri transaction downloader script.

So, here it is, ofcourse it is in python. The reason I keep doing this in python is that so other user can use and learn python too. Since it is not as suck as the other scripting language and never let me down ;)

Just change the parameter inside the script:


#Ganti username dengan username anda
USERNAME = "user123"

#Ganti pin dengan pin anda
PIN = "123123"

#Ganti pake norek anda
NOREK = "1111111111111"

#Hari
DAYS = 7

Its so self explaining, below is the full script

http://www.ferdianto.com/media/mandiri.py

Edit Your Email Before Reply or Forward In Blackberry

Having trouble editing e-mail prior to reply or forwarding? Or perhaps your colleagues at mailing-list is flaming you because of top posting? No more excuses now, there is apps for Blackberry that allow you to edit / inline editing email messages for reply or forward

Try EmailEdit Blackberry Apps. The price is less than a dollar, but it works great.

It even can pull HTML email, and format it as text.

Mining GMAIL Data

Once I’ve create a script to monitor application status and send it to my email. And apparently, I need to download all the result to create some graph for analyzing purposes. Luckily, I have python at my disposal, so I can easily fetch email from my Gmail mailbox to some text file and then whipped some awk command to get the stats.

Here’s the simple script to fetch the required emails:

import imaplib
import rfc822
try:
    from cStringIO import StringIO
except ImportError:
    from StringIO import StringIO

imap = imaplib.IMAP4_SSL('imap.gmail.com', 993)
imap.login(USER, PASS)
imap.select()
type,data = imap.search(None, 'SUBJECT', '"Push Stats"')
for num in data[0].split():
    typ, data = imap.fetch(num, '(RFC822)')
    text = data[0][1]
    file = StringIO(text)
    message = rfc822.Message(file)
    print message.fp.read()
imap.close()
imap.logout()

I’m simply run the script and redirect the output to get the text file

python gmail.py > data.txt

And then, just process the data.txt as if its a simple text file data