Rabu, 25 November 2015

Homebrew is the Best Thing EVERRR!!!

Well, indeed perhaps the title is a bit too enthusiastic.... :-)

But, installing things are so so easy. Especially Hadoop. Not the pain it used to be when I was on Windows, which despite being an excellent operating system, does not work quite as well with some open-source stuff.

Without further ado, here's how to install Homebrew. Obviously, you type this into the Terminal:
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

With brew installed, you could install maven like this:
brew install maven
Just to see what would happen (but curiosity is the mother of learning, isn't it), I typed:
brew install hadoop
And it worked! Just like that.


Oh, and should you happen to read this post, please forgive my naive enthusiasm. :-)

Rabu, 29 April 2015

Decompiling .chm Into .html

Here's how to decompile a .chm into .html - from the command line:

hh -decompile test sample.chm

The result is the decompiled .html pages of the file sample.chm in the folder test.

Senin, 30 Maret 2015

How to Enable Proxy Access to R, When You are Behind a Particularly Fussy Proxy Provider

Yes, I am calling my proxy provider fussy. Yes, perhaps it is not to blame, even though I strongly suspect it is. It requires double authentication for each time we access the Internet, and for some applications, it requires me to input my credentials four times. Yes, four.

Anyway, when you are working in an organization, such as school, it might be the situation that you are behind a proxy. However you might feel about it, here's one way to enable web access from R that works for me. I use RStudio, but I think this might work for R-Gui, too.


1. Create a .Renviron file, which contains the following lines:

options(internet.info = 0)
http_proxy=http://your_proxy_address:port_number/
http_proxy_user=ask

Save the .Renviron file in your "Documents" or "My Documents" folder. I know, it is a somewhat weird place to put it. There's a discussion about it here.

2. Check that the http_proxy variable is already read by R, by issuing, in R Studio:

Sys.getenv("http_proxy")

If it works, R should return a string which contains your proxy address.

3. Make sure, in R Studio, that Tools > Global Options > Packages > Use Internet Explorer library / proxy for HTTP is unchecked.

4. Restart your R Studio. Now you can (hopefully) access the Internet from R!

Minggu, 19 April 2009

Sistem Operasi dan Web Server KPU

Dalam tugas pencarian sistem operasi dan web server KPU, kita dapat mempergunakan tool yang disediakan oleh Netcraft, http://news.netcraft.com/. Dengan mempergunakan Netcraft Toolbar, informasi yang dapat diperoleh mengenai situs kpu.go.id ditampilkan dalam screenshot sebagai berikut:





Informasi terpenting yang diperoleh dari gambar diatas adalah bahwa situs KPU beroperasi dengan sistem operasi FreeBSD dengan web server nginx versi 0.6.35.

Senin, 13 April 2009

'Membatik' E-Mail

Pada tugas kuliah Keamanan Informasi Lanjut kali ini, mahasiswa diminta untuk menampilkan suatu e-mail yang memiliki attachment lebih dari satu dalam versi plaintext, lengkap dengan seluruh header dan attachment dari e-mail tersebut. Karena e-mail dikirim dalam bentuk terkode, beberapa bagian dari e-mail, terutama misalnya attachment berupa gambar, akan terlihat sebagai huruf-huruf yang tersusun acak. Pak Budi menyebutnya, 'membatik'. :-)

Berikut ini adalah contoh kutipan e-mail yang mempertunjukkan tiga attachment berupa gambar .gif sederhana, berukuran masing-masing sekitar 1 KB. Bentuk 'asli' dari attachment adalah sebagai berikut:


heart.png


star.png


rainbow.png


Bentuk plaintext dari muatan e-mail adalah sebagai berikut:

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="0-1490702233-1239610247=:50187"


--0-1490702233-1239610247=:50187
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Dearest beautiful, wonderful Renny,=0A=0A=0AWith this e-mail are attachment=
s from your magnificent self. Hopefully you would find in them pleasure and=
endless amusement.=0A=0AEnjoy! :-)=0A=0A-renny-=0A=0A=0A
--0-1490702233-1239610247=:50187
Content-Type: image/png; name="heart.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="heart.png"

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/I
NwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ/
SURBVDjLpZNLiI1xGMZ/3/edOWZojjkiudbMuEVMM4SMBVlbSUpZyAIhG4ql
kcJWycZOSslCMTNFuYVpRrkzLuMy5tA4xulcv//t/Vt80ZTLxltvz7N43vd5
F+8TeO/5n0r9JNLTs9A7t8FbO0WsfSvWdtdv2VIAKJ45kxWtt4rWh5xSQ6LU
yeldXVcAAu890t29zzt3hPp0ljBCyiVMofhMjNkmWldE64t1U5qWTpjXiiuV
qDx8RDX35ZxTalfgrl7d6K2+HC5cQBBGYAyk05jhYWrPX350WpcbWpsX17e0
QGEMwgiasnzv7eX7oyfHUmLt3mjWTIJqFXJfwAlYS13zHKKV7XN9rInqG6D/
AYgkBo0TyXSuId/Xvz0lxiyJMhkYegfGghdwDl68JpycgSiAwTeAgLYJ5scI
WgUXx5mUGJPGOYgVKJUs0CZZMpIDaxNnEfAOlAFxYDSilKRE66K3dlpgDcQ1
sC4ZtjbB8dxacBZSIYQhTqkwFKWu28FBmD0TKmWo1SCOwagEdZxgrZYYlEow
v4X8jVuIUudDp9SJyodP7+NPI9C2FNJRIipXk4FqDVQM1QrUhbB2FYXRMXJX
usdE667Ae0/++PFlotTZhmzjiknLlxOO5mDgCQRBcnq1Cm2L8M3zGO3p5fPt
e0/FmN0d/f13gp+v/Pnw4clOqQOi1P5sR1tj46wZcPceFMuwdjXFbwXen7+g
RevTYsyxjoGB/K9PHF/vduxY4ZQ61dQ8d/XUDevBWfJ37jJy/eaQaL2z/f79
a+P1wZ/C9Grz5ian1FHRek92zozg68s3l0Trg+19fUO/ib33f+3H69ZtetjZ
uf9fmuB/4/wDFoO2ZVesLdkAAAAASUVORK5CYII=

--0-1490702233-1239610247=:50187
Content-Type: image/png; name="star.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="star.png"

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/I
NwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIw
SURBVDjLlZLNS5RRFMafe9/3vjPOjI1jaKKEVH40tGgRBWEibfoPQoKkVdto
EQQF4T/QqkVtWrSTFrVsF1FgJbWpIAh1k2PNh+PrfL4f95zTQk0HHKkDD/cc
7vP8uHCuEhF0q/KnmXNgGR248PZFN4/GISXMC8L89DBPV0Dp4/SsazJjrtfb
9/vdxfn/BgjzY5M8Aq8nBya+V3h93vtnQHFxat4kszntJAAAxus1YvnZQV5V
/jyTEZarwnwFLGeFZdT0ZFOJdD84qoCDOpQ7grZfRNj020JSEOKvwvxGiF+q
0tL0N5PuO+Mk0nC0B0BDsYCCImyzAIktBBloMwKJLSgKYcMAcdhC2KpVlIig
+H5qxcv0n0xmj4Gbq+BwC2wtJLbgHUlMEFJwUpMIGpto16u+kJzSACAk+WCz
vNbe+AVljkOYIcQQou3TbvdOJo+g4aNdqzaF+PT43HJVA8DQpcVIiPPtaqlE
UQzlDELsTpgYwgTAQIjQqlUCtpQfn1spdmxh+PJSQyw9CrbKgM7tvcISQAxl
BhC3GuCYXk3cWP25m3M7dk88qbWBRDVApaATOSjPBdXXwYEP5QyCgvjE/kwH
gInHtHYBnYA2owhrPiiuw0sOw3EZFEagIB7qChDiYaUcNIoFtP1KxCTPhWiD
w7WbXk9vKpnOgsI4exjg6Mbq96YQPxm79uPOvqvbXx4O3KrF6w8osv2df17k
r5YXJq7vnw/S0v3k7Ie7xtud/wAaRnP+Cw8iKQAAAABJRU5ErkJggg==

--0-1490702233-1239610247=:50187
Content-Type: image/png; name="rainbow.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="rainbow.png"

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/I
NwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIh
SURBVDjLjZPfS1NxGMbPjX9Bl/0PXqQzIYIEWWIpRFFBQwyNQqhG4VY0dUK0
gXQh+KMhu2nKIAkpAu0wkBA0f0QRtoLuFgSbOmSbZ+estsf3+e6ssE7hxXNz
4PM+7/d9nqMB0A6jr3Var2hJlBFZorKochhwUpQmkO65iC3/DWwP3sJO0Av5
9l/QI0qlmuux5buO7EMvcuM+5AInsRdqxo/5ART92j/hqMhIX7uMbOgudu+7
YYRdsMaPozRZ1c/EIKwHmiM8KyptD9xEbsyHQvAYSjZozZyC+boDxbeXYKUm
kF9vcHQu7QzdRn7KD/OxqwrGW1B8cx7GZheML1eVrO8R5N+5/nqzQWfC1miT
gs1X7TA+eBT0bdOD5yudCCRaMPF+CEej2oEBKb6Za9ecTb0TRrIbewLPLneg
d/4E2l824vSLBoQ3AjgypR2IqpJ9dAeF4cbfzgJnPnVhZLEVZ23wSsyHvkgc
Mf0jzvTP/RqQZlSF6D11ML6Za9OZcJuA555dQN+TOKb1JGb0z3i6kKwOsBtW
Zs6Miu7qYPbadCYcjCUUGJ5eQ09IJ2yKVjlgiQ1jSZgzo+K1eTC+mWvTmbB3
dLEGumu344AM68mGqbdLznTntXkwvplr05nwn73hAIvdZj3V+lISDmBUyj1S
dbfXdjsNKPPHYLdVPaVhLAlzZlS8tn0w06n2HFDhX8Ufg91mPdkwloQ589K2
Vp0G7AOR2a7+EgKeFAAAAABJRU5ErkJggg==

--0-1490702233-1239610247=:50187--

Seperti terlihat di atas, setiap bagian attachment diawali oleh string:

--0-1490702233-1239610247=:50187

String di atas tidak tetap seperti di atas nilainya, melainkan akan berbeda untuk e-mail yang berbeda. Selain awal dari masing-masing bagian attachment, string di atas juga muncul satu kali di akhir seluruh attachment.

Selain itu, setiap bagian attachment juga didahului dengan informasi mengenai attachment sebagai berikut:

Content-Type: image/png; name="heart.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="heart.png"

Contoh di atas adalah untuk berkas gambar bernama 'heart.png'.