The Difference between For-Each Loop and forEach()

People who have played enough with the brand new Java 8 will be familiar with the new forEach(fn(x)) loop in lambda. This syntax is quite popular among developers because it’s easier and prettier to use than the normal For-Each loop. It is also popular in other languages, especially JavaScript. The problem is, I’ve seen a very specific bug, which is related to this “functional” forEach() loop, quite a few times, again and again.
Read more →

Java 8 - Turning off SSL Certificate Check

There’s usually no good reason to turn off SSL certificate check. So this is actually wrong in many ways, but maybe we’re still developing in an isolated dev environment and somehow the dev machine of another application you’re depending on only allows SSL connection even though it doesn’t have a valid certificate. The correct solution is actually to self sign a certificate or add it in the system, so that if your application go live, you will still have ssl certificate check turned on.
Read more →

AWS Eb CLI (v3): How to fix ssl_wrap_socket error in Debian Jessie

This is the first time I’m deploying stuff to elasticbeanstalk, and when I’m trying to deploy my private project, I realized the eb cli I download is the version 2 and has different syntax. I installed the version 3, and it seems like it can only be installed using python package manager pip. After installing it, this is what I get: rowanto@Rowanto-Deb ~ $ eb Traceback (most recent call last): File "/usr/local/bin/eb", line 9, in <module> load_entry_point('awsebcli==3.
Read more →

How Positive Thinking and Negative Thinking Could Go Wrong

Pretty much every people who I met understood the concept of positive thinking wrong. Usually what happens is, they are confronted with a problem, and they will say, “Don’t worry. Everything will be fine”. Afterwards, they said it’s positive thinking. The problem here is, we have a problem in front of us, so how is everything fine? The problem will not magically go away. We have to deal with it. Let’s have another example.
Read more →

How to fix libgdbm3 update problem in Debian

In case you recently tried to update your debian system, and got an error related to libgdbm3 like this: Preparing to unpack .../libgdbm3_1.8.3-13+b1_i386.deb ... Unpacking libgdbm3:i386 (1.8.3-13+b1) over (1.8.3-13) ... dpkg: error processing archive /var/cache/apt/archives/libgdbm3_1.8.3-13+b1_i386.deb (--unpack): trying to overwrite shared '/usr/share/doc/libgdbm3/changelog.Debian.gz', which is different from other instances of package libgdbm3:i386 Errors were encountered while processing: /var/cache/apt/archives/libgdbm3_1.8.3-13+b1_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1) You can fix this easily by deleting the libdgbm3 changelog file.
Read more →

Lessons learned in Øredev 2014

Recently I visited the Øredev 2014 conference. I must say that it’s a pretty good one. Some of the talks are pretty boring, but most of them are actually pretty nice. I was in the security training, and the three days conference. I tried to avoid going to the talks whose content I can just read up somewhere in the internet. I want the experiences from the speakers. That’s why if you see the points below, most of them is about how to do something best.
Read more →

Add automatic code or syntax highlighting in your ghost blog

Recently, I switched to the Ghost blogging platform. I must say that it’s actually quite nice. Well, it’s still young, and some stuff needs to be taken care of. You need to use “forever” or an init.d script and monitoring to make sure it will stay running. You have to take care of setting up the mail service because it still can’t do it automatically like other platform, etc, etc. Well, you can also pay them to host it for you and forgot all those stuffs though.
Read more →

Why your cancel button submit the html form

One of the mistake which I see often during development on the frontend side is the cancel button, which actually submits the form when clicked. Saw it once, wait a while, saw it again, wait a while, saw it again, and the loop continues. Some people doesn’t even realize. So what’s the problem? Let’s take a look at a normal html form in AngularJS. HTML Code <div ng-app="MyApp"> <div ng-controller="MyController"> <form ng-submit="submitTheForm()"> <div class="form-group"> <label for="name">Name</label> <input type="text" class="form-control" ng-model="someone.
Read more →

Playing with AWS Redshift - Sum of 1.2 billion rows took 8 seconds

One of the think which makes zanox. an exciting place to work at is because of the innovation time. We used to always have 20% of our work time to be innovation time, where we can learn new stuff which makes life a whole lot interesting. About a month before the writing of this, the format of the innovation time was changed, instead of doing whatever we want on friday, we need to make it transparent what we’re learning, and the company will support them by giving you the required stuff.
Read more →

CVE-2014-6271: what is it and how to check if you’re vulnerable and fix it

What is actually CVE-2014-6271? Actually redhat did a very good job describing it: https://access.redhat.com/articles/1200223 From what I’ve understood, it’s basically a bug that allows you in bash to do some other command after the function declaration in a variable. Let’s change the example a little bit, so that it’s more easier to read: env your_function='() { echo "your function do something";}; echo "but I can still add other command after your function"' bash -c "echo this is a test" If you system is affected with the bug, if you run that command, you will see the text “but I can still add other command after your function”.
Read more →