OS

Open MySQL for remote connection in Fedora 17

24 Oct , 2012  

Sometimes we need to open MySQL for remote connection. To do this, we can create file “/etc/my.cnf” or modified it if exists.
The key here is:

1
2
3
[mysqld]
skip-external-locking
bind-address = 0.0.0.0

And you need to access your MySQL console and grant remote user by:

1
GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'YOUR_PASSWORD' WITH GRANT OPTION;

And last step is restart the MySQL services by “sudo service mysqld restart”

,

Tornado

How to make tornado server auto restart / reload everytime files changes

20 Oct , 2012  

When running Tornado web server, we must doing restart for every changes that has been maded. This tedious works for sure. Are you newbie? Yes, I just download Tornado just today and I’m a new comers for this web-framework. If you follow Tornado documentation, it only showing how to running webserver in non-autoreload way. Wait, did you mean Tornado actually have module or function to make it autoreload everytime changes has been made? Yes!

Here is example how to using tornado.autoreload to reload server everytime changes has been made. It’s also “update” if files in templates (HTML) being changed as well.
More…

,

Python

Simple create alphabet and reverse them in Python using number

20 Oct , 2012  

It’s suddenly pop-out on my head which what the one-liner solution for creating alphabet (A-Z) in Python and reversed them. Then, the first thing is using built-in python function like ord() and chr(). Then, I can use list comprehension to make it compact.

Example:

1
[chr(x) for x in range(ord("a"), ord("z") + 1)]

More…

,

Java

Interesting Keyword and Topic about Java usage in Bank and domain knowledge

15 Oct , 2012  

I’m trying to make a jump in learning Java and Banking. Because I’m interesting with the big problem there.

So, here are the results that what I’m looking for the problem that faced in Bank and Java implementation.
Because there are some domain knowledge in bank that also I need to know, so I put some website that related with Bank.
More…

,

OS

Fix subfolder directory listing forbidden HTTPD / Apache2 in Fedora 17

14 Oct , 2012  

This is the most annoying problem when you setup httpd in Fedora 17. Fedora apache directory listing for subfolder became forbidden and only allowing for folder that have “index.html” or “index.“. Solution to fix this problems is very easy.

Open “/etc/httpd/conf/httpd.conf” and put this into bottom line:

1
2
3
<DirectoryMatch  /home/yodi/htdocs/(.)*/>
        Options +Indexes
</DirectoryMatch>

And make sure “/etc/httpd/conf.d/welcome.conf”:

1
2
3
4
<LocationMatch "^/+$">
    Options +Indexes    
    ErrorDocument 403 /error/noindex.html
</LocationMatch>

Now you got subfolder in Apache have directory listing

,

OS

MYSQL export PROCEDURE only from database

11 Oct , 2012  

Here is how to export PROCEDURE from MySQL database :

1
mysqldump -u USERNAME -pPASSWORD --routines --no-create-info --no-data --no-create-db --skip-opt YOUR_DATABASE > test.txt

OS

Block Incapsula Web Crawler using IPTables in Linux

9 Oct , 2012  

In my previous post, I was doing experiment by blocking crawler from Incapsula with NGINX “deny” which actually it’s doesn’t give solution for me. I don’t know if my code is wrong or NGINX can’t doing subnet blocking correctly. Because I was going into NGINX documentation and follow the article but that drive me into some unlikely result.

So, I try with more familiar way called “iptables”. I use debian for this example. So, basically iptables is available for Linux Distros. Just make sure your server have it installed. Then here is the list:
More…

OS

Block Incapsula Monitoring System flooding your web server by IP and NGINX

8 Oct , 2012  

I have subscribe Incapsula services about one years and i’m feel great and bad with their services. First thing, I like to see that their system protecting my websites very good. But, “overprotecting” is the only way i complain to them since a years ago and it’s doesn’t fixed till now.

What is it? It’s about “Incapsula Monitoring Bot / Incapsula Uptime Monitor” that flooding my server which make 2-3 request in every SECOND! For example:
More…

,

OS

Git exlude / ignore changes on particular file for temporary

4 Oct , 2012  

This is always happen when you working with different environment like Production, Staging, Release Branch, etc.
To make some particular file being ignored for temporary, we can use “git update-index”.

Here is to disable tracking:

1
git update-index --assume-unchanged <file>

Then to enable track updates on this particular file:

1
git update-index --no-assume-unchange <file>

,

OS

Create a local branch from remote branch that already exist in git repository

2 Oct , 2012  

There will be a need when we want to create a new branch in local based on remote branch (not master) in repository. For instance, we have three branch:

1
2
3
1. Master
2. Development
3. New-branch

This “New-branch” already exist in our remote git repository. Then, we need to make sure if we can see this remote repository in our local.

1. Compare local and remote branches repository
When you’re doing “git branch -a” but you don’t see the same things in remote repository, then something wrong here.
eg:

1
2
- master
- development

This mean our remote repository doesn’t detected in our local. Try with:
More…

,