misc Posts

Download A Compressed Attachment (Zip, Rar or 7Z) on GMail

I want to download a compressed file that i’ve sent several years ago, but somehow google disabled it, and gives an “anti virus warning”. And it happen for all my email with compressed attachments files, such as .zip, .rar and also .7z.

compressed download

Well, the workaround is quite simple, im opening my email using my Android GMail client , and then save my attachment to Google Drive.

7zip

From Google Drive, i can easily download my attachment freely.
google drive

Hopefully it can help other people. :-D

Google+

Daftar Kode Provinsi, Kecamatan, Kabupaten dan Desa di Indonesia Menurut Kemendagri

Setelah berkeliaran kesana-kesini, apalagi data kemendagri berupa pdf sehingga menyulitkan diparsing :-P , akhirnya dapet juga versi sql dari data Kemendagri. Setelah diparsing sehingga mysql-compatible, hasil akhir sql filenya bisa diunduh di —> sini

Data Kemendagri

Google+

Daftar Kode Provinsi, Kecamatan, Kabupaten dan Desa di Indonesia Menurut Kode BPS

Kali ini gw kembali menulis tentang GIS, berawal dari masalah yang gw temui di project terbaru gw terkait geospasial Indonesia. Disana gw kesulitan untuk mendapatkan kode dan nama wilayah di Indonesia secara sistematis, akhirnya gw bikin versi sql-nya. Semoga data gw bisa bermanfaat bagi seluruh penggiat spasial Indonesia (Y)

SQL File-nya bisa diunduh —> disini

database kabupaten sql

database kabupaten sql

Google+

How to Log X-Forwarded-For HTTP Header on Glassfish Application Server

Yesterday i was talking with my friend, on how Glassfish Application Server able to log the http request’s original user ip. Because my Glassfish is behind Apache ModProxy, so what is logging om my Glassfish’s access log file is my proxy’s ip address.

My apache modproxy ip is 192.168.56.102, while my original ip is 192.168.56.101. So im planning to see “192.168.56.101″ on my Glassfish access log instead of “192.168.56.102″ which is my proxy’s ip.

This is my Access Logging screenshot,

But before you do that, please make sure, you checked the Access Logging checkbox

And this is the result of my Glassfish’s Access Log File, which is located at, <glassfish installation folder>/glassfish/domains/domain1/logs/access

"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:40:11 +0700" "GET // HTTP/1.1" 200 563
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:40:12 +0700" "GET // HTTP/1.1" 200 563
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:40:12 +0700" "GET // HTTP/1.1" 200 563
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:40:13 +0700" "GET // HTTP/1.1" 200 563
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:40:13 +0700" "GET // HTTP/1.1" 200 563
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:40:13 +0700" "GET // HTTP/1.1" 200 563
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:40:13 +0700" "GET // HTTP/1.1" 200 563
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:40:13 +0700" "GET // HTTP/1.1" 200 563

As you can see, what is written on my access log is my proxy ip address instead of my original address.

After spending some time researching, i found out that Apache ModProxy have an “X-Forwarded-For” http header which contain the original user’s ip address. So this is my new Access Logging Format, you can see me logging “X-Forwarded-For” header on the end of my new logging format.

%client.name% %auth-user-name% %datetime% %request% %status% %response.length% %header.X-Forwarded-For%

And this is my lates access log file, you can see my original ip at the end of every access log.

"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:51:56 +0700" "GET // HTTP/1.1" 200 563 "192.168.56.101"
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:51:56 +0700" "GET // HTTP/1.1" 200 563 "192.168.56.101"
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:51:56 +0700" "GET // HTTP/1.1" 200 563 "192.168.56.101"
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:51:56 +0700" "GET // HTTP/1.1" 200 563 "192.168.56.101"
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:51:56 +0700" "GET // HTTP/1.1" 200 563 "192.168.56.101"
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:51:57 +0700" "GET // HTTP/1.1" 200 563 "192.168.56.101"
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:51:57 +0700" "GET // HTTP/1.1" 200 563 "192.168.56.101"
"192.168.56.102" "NULL-AUTH-USER" "20/Oct/2013:15:52:05 +0700" "GET // HTTP/1.1" 200 563 "192.168.56.101"

Hope it’d help others, have fun ;-)

Google+

[Oracle] How to Truncate and Clean All Your Database’s Tables

I worked with Oracle for this project, and sometime i need to truncate and clean all my oracle database’s content. So instead of truncate the tables one by one, i found a simple query to generate a simple truncate query.

select 'truncate table ' || table_name || ';' from user_tables

Hope it helped others :)

Google+