Thursday, November 5, 2015

How to open big text files on Ubuntu

Problem:
You want to read a big text file. But the editor is very slow loading it.

Solution:
Chop the big text file into smaller ones.

split -b 1024k <path/of/your/filename.txt>

The Terminal command above splits the file path/of/your/filename.text into 1024kb files.

Thursday, August 13, 2015

Resolve missing .classpath and .project on Grails project

Problem
You have an existing Grails project. It cannot be imported by eclipse / STS IDE because the files .classpath and .project are both missing.

Solution
Open the terminal on the grails project folder.
Then, run the following command on your terminal:
grails integrate-with --eclipse

Friday, April 24, 2015

How to Execute a bin File on Linux

Problem
How do I execute a .bin file on Linux?

Solution
1. Open your terminal

2. Run the following command to make the file executable:
chmod u+x <file name>

3. Execute the bin file using the following command:
./<file name>

If the installer needs administrator rights, try this command instead:
sudo ./<file name>

Friday, April 17, 2015

How to Run Integration Tests on Grails

Problem
How do I run integration tests on Grails?

Solution
Run the following command on the console:
grails test-app integration:integration

Friday, April 10, 2015

How to Drop All User Tables in Oracle

Problem
You want to remove/drop all user tables from on Oracle Database.

Solution
1. Run the following SQL query
select 'drop table '||table_name||' cascade constraints;' from user_tables;

2. Run the SQL query generated after the 1st step above.

Sunday, February 1, 2015

How to Show Hibernate SQL Statements in Grails

Problem
You want to see all Hibernate SQL statements when using grails.

Solution
You must have these line of codes inside your conf/Config.groovy configuration file.

log4j = { debug 'org.hibernate.SQL' trace 'org.hibernate.type' }
The SQL statements will appear on the standard output console.

Monday, January 19, 2015

Update MySQL User Password

SET PASSWORD FOR 'root'@'localhost' = '';

The SQL script above sets the password for the user root to blank.
The script will run successfully if the current user has UPDATE privilege on the MySQL database.