Wednesday, February 20, 2013

Install Oracle/Sun Java SDK and JRE in Ubuntu

If you need simple steps to install java in Ubuntu, here they are. 
 
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
 
I used this method to install PhpStorm dependency in Ubuntu 12.04. Originally from here.

Monday, December 24, 2012

MySQL - ERROR 1045 (28000): Access denied for user

When you get a weird permissions denied error while connecting to MySQL considering that,

1. You have properly granted privileges to the user.
2. That the user logs-in from a host that's permitted by the the database server.
3. That you have entered the correct username + password combination.
4. That you are accessing a database that the user have been granted permission

Then, you are most likely a victim of a setup that has an anonymous user. How to verify and fix.

Using Child Routes In Zend Framework 2

In Zend Framework 2, the router has support with child routes or part routes. As opposed to ZF 1 which have a flat routing heirarchy, this feature ensures that you have an organized route tree. However, child routes are not meant to be called or used directly. More so, the way to use is buried beneath the rubble of the ZF documentation.

So how, it's actually quite easy.

1. First define your child route.

Saturday, December 22, 2012

Use Your Local Database IP References (or other Resources) Without Altering Code


So you want your code to point to your local IP database references but want to avoid changing code or maintaining configuration values separate for production and development? Here's how.

The principle is to use iptables (works only on Linux kernels and alike), and route the outgoing packets even before they try to resolve and reach the network resource, in this case a database server, they need to connect to. Here's the example.

 iptables -t nat -A OUTPUT -p tcp -d <production database IP> -j DNAT --to-destination 127.0.0.1

Monday, November 19, 2012

Subversion - Ignore Files or File Patterns Using svn:ignore Property Not Working?


Using the svn metadata or svn properties svn:ignore, you may ignore files or file patterns within a folder. Somehow, it is not working and you are probably wondering why. Then, you came to the right place.

In order to properly set it up, it must meet the following conditions.

Saturday, November 17, 2012

Mounting a Folder Via SSH on Linux

So you have SSH (Secure Shell) access but can not work directly with them but through a an SSH client which is not probably the most productive way to do it.

Well, you came to the right place if you are a Linux desktop user. Here's how.

Tuesday, November 6, 2012

Yum Install KeepassX

KeepassX is a secure way of storing sensitive data like credit card info, username and passwords. It was originally built for Windows and now is a cross-platform application hence the 'X'. It is quite secure due to its db file encryption with a 256-bit key. More info can be found here - http://www.keepassx.org/.

Okay, since it is cross-platform Fedora repo naturally has it. So to install, simply do the following.

yum install keepassx

Now, you can share the database file (*.kdb) to DropBox or GoogleDrive, then separately share the key. This way, you can securely share sensitive info and collaboratively change it. Cool?

For CentOS or RHEL, add the EPEL repo and do the same thing above but they are operating systems that are not meant for desktop use anyway.