How to check the total size of files matching a pattern. (Linux)

To find files along with their sizes, in a directory ( including sub-directories) matching a specific pattern,

Use the below command.

 find . -name "pattern" -ls 

The 7th column shows the size of the file.
example

 find . -name "*20120127_0259.zip" -ls
22612310    8 -rw-r--r--   1 root     root         4691 Jan 26 18:59 ./1789/stats_1789_1790_20120127_0259.zip
22612344   36 -rw-r--r--   1 root     root        36293 Jan 26 18:59 ./1789/stats_1789_1797_20120127_0259.zip
22612348   80 -rw-r--r--   1 root     root        77241 Jan 26 18:59 ./1789/stats_1789_1761_20120127_0259.zip
22612243    4 -rw-r--r--   1 root     root          884 Jan 26 18:59 ./1789/stats_1789_1818_20120127_0259.zip
13534698   32 -rw-r--r--   1 root     root        30533 Jan 26 18:59 ./17/stats_17_9264_20120127_0259.zip
13534592   12 -rw-r--r--   1 root     root        10037 Jan 26 18:59 ./17/stats_17_9289_20120127_0259.zip

To find the total size of all such files.

 find . -name "pattern" -ls | awk '{total += $7} END {print total}' 

example

 find . -name "*20120127_0259.zip" -ls | awk '{total += $7} END {print total}' 
1088968

How to check mysql version.

To check the mysql version running on a server.

Use the command.

show variables like '%VERSION%';

mysql> show variables like ‘%VERSION%’;
+————————-+——————————+
| Variable_name | Value |
+————————-+——————————+
| protocol_version | 10 |
| version | 5.1.42-log |
| version_comment | MySQL Community Server (GPL) |
| version_compile_machine | x86_64 |
| version_compile_os | unknown-linux-gnu |
+————————-+——————————+
5 rows in set (0.00 sec)

QuickTabs javascript loading problem with block cache enabled.

Quicktabs is a nice drupal module to set up tabbed interfaces.

I was just trying to set up a quicktab block on my drupal site, but found it does’t work always.
Found that the quicktab javascripts sources, are not loaded on some user roles.

So dispaly fails back to just HTML list with bullets, and clicking on the list reloads the entire page too.

After digging for some time, understood that its the block cache, that’s creating the problems for quicktabs.
Seems quicktabs is not compatible with block cache.

So work around is to just disable the block cache for this particular block, and quicktab works fine then.

How to show user privileges on mysql.

select * from mysql.user;

Result:


mysql> select * from mysql.user;
+-----------+-----------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------
+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-------
----------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+----
----------------+------------------+------------+--------------+----------+------------+-------------+--------------+---------------+-------------+---
--------------+----------------------+
| Host      | User      | Password                                  | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv
| Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create
_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alt
er_routine_priv | Create_user_priv | Event_priv | Trigger_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | ma
x_connections | max_user_connections |
+-----------+-----------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------
+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-------
----------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+----
----------------+------------------+------------+--------------+----------+------------+-------------+--------------+---------------+-------------+---
--------------+----------------------+
| localhost | root      |                                           | Y           | Y           | Y           | Y           | Y           | Y
| Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y
                | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y
                | Y                | Y          | Y            |          |            |             |              |             0 |           0 |
            0 |                    0 |
| 127.0.0.1 | root      |                                           | Y           | Y           | Y           | Y           | Y           | Y
| Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y
                | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y
                | Y                | Y          | Y            |          |            |             |              |             0 |           0 |
            0 |                    0 |
| localhost |           |                                           | N           | N           | N           | N           | N           | N
| N           | N             | N            | N         | N          | N               | N          | N          | N            | N          | N
                | N                | N            | N               | N                | N                | N              | N                   | N
                | N                | N          | N            |          |            |             |              |             0 |           0 |
            0 |                    0 |
| localhost | nikhilesh | *B4B62B9A05AFC70D55C8FE24B729A6E961B75117 | Y           | Y           | Y           | Y           | Y           | Y
| Y           | Y             | Y            | Y         | N          | Y               | Y          | Y          | Y            | Y          | Y
                | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y
                | Y                | Y          | Y            |          |            |             |              |             0 |           0 |
            0 |                    0 |
+-----------+-----------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------
+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-------
----------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+----
----------------+------------------+------------+--------------+----------+------------+-------------+--------------+---------------+-------------+---
--------------+----------------------+
4 rows in set (0.00 sec)

Or to see the grant script given, use

SHOW GRANTS FOR username@ipaddress;

Or for the current user(default)

SHOW GRANTS;
mysql> show grants;
+---------------------------------------------------------------------+
| Grants for root@localhost                                           |
+---------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
+---------------------------------------------------------------------+
1 row in set (0.00 sec)

To see all privilege types.

 show privileges;

Result:

mysql> show privileges;
+-------------------------+---------------------------------------+-------------------------------------------------------+
| Privilege               | Context                               | Comment                                               |
+-------------------------+---------------------------------------+-------------------------------------------------------+
| Alter                   | Tables                                | To alter the table                                    |
| Alter routine           | Functions,Procedures                  | To alter or drop stored functions/procedures          |
| Create                  | Databases,Tables,Indexes              | To create new databases and tables                    |
| Create routine          | Databases                             | To use CREATE FUNCTION/PROCEDURE                      |
| Create temporary tables | Databases                             | To use CREATE TEMPORARY TABLE                         |
| Create view             | Tables                                | To create new views                                   |
| Create user             | Server Admin                          | To create new users                                   |
| Delete                  | Tables                                | To delete existing rows                               |
| Drop                    | Databases,Tables                      | To drop databases, tables, and views                  |
| Event                   | Server Admin                          | To create, alter, drop and execute events             |
| Execute                 | Functions,Procedures                  | To execute stored routines                            |
| File                    | File access on server                 | To read and write files on the server                 |
| Grant option            | Databases,Tables,Functions,Procedures | To give to other users those privileges you possess   |
| Index                   | Tables                                | To create or drop indexes                             |
| Insert                  | Tables                                | To insert data into tables                            |
| Lock tables             | Databases                             | To use LOCK TABLES (together with SELECT privilege)   |
| Process                 | Server Admin                          | To view the plain text of currently executing queries |
| References              | Databases,Tables                      | To have references on tables                          |
| Reload                  | Server Admin                          | To reload or refresh tables, logs and privileges      |
| Replication client      | Server Admin                          | To ask where the slave or master servers are          |
| Replication slave       | Server Admin                          | To read binary log events from the master             |
| Select                  | Tables                                | To retrieve rows from table                           |
| Show databases          | Server Admin                          | To see all databases with SHOW DATABASES              |
| Show view               | Tables                                | To see views with SHOW CREATE VIEW                    |
| Shutdown                | Server Admin                          | To shut down the server                               |
| Super                   | Server Admin                          | To use KILL thread, SET GLOBAL, CHANGE MASTER, etc.   |
| Trigger                 | Tables                                | To use triggers                                       |
| Update                  | Tables                                | To update existing rows                               |
| Usage                   | Server Admin                          | No privileges - allow connect only                    |
+-------------------------+---------------------------------------+-------------------------------------------------------+
29 rows in set (0.00 sec)

Useful Grails Commands

To start a grails application. Run the below command from Application root folder.
This will start the grails internal webserver and deploy the application.

grails run-app

To start the application in a port other than the default port (8080)

grails -Dserver.port=XXXX run-app

Shell Script – Passing arguments to function.

To pass arguments to a shell script function.

#!/bin/sh

#function definition
func()
{
 echo "Argument 1: $1"
 echo "Argument 2: $2"
}

arg1=10
arg2=15

#call the function
func $arg1 $arg2

Output is.

Argument 1: 10
Argument 2: 15

To see MySQL system variables.

To see the values of mysql variables of the currently running mysql system use the below command.

show global variables;

It will list the current values of all the variables like shown below.


mysql> show global variables;
+-----------------------------------------+-------------------------------------------------------------------------------------------+
| Variable_name                           | Value                                                                                     |
+-----------------------------------------+-------------------------------------------------------------------------------------------+
| auto_increment_increment                | 1                                                                                         |
| auto_increment_offset                   | 1                                                                                         |
| autocommit                              | ON                                                                                        |
| automatic_sp_privileges                 | ON                                                                                        |
| back_log                                | 50                                                                                        |
| basedir                                 | C:\Program Files\MySQL\MySQL Server 5.1\                                                  |
| big_tables                              | OFF                                                                                       |
| binlog_cache_size                       | 32768                                                                                     |
| binlog_format                           | STATEMENT                                                                                 |
| bulk_insert_buffer_size                 | 8388608                                                                                   |
| character_set_client                    | latin1                                                                                    |
| character_set_connection                | latin1                                                                                    |
| character_set_database                  | latin1                                                                                    |
| character_set_filesystem                | binary                                                                                    |
| character_set_results                   | latin1                                                                                    |
| character_set_server                    | latin1                                                                                    |
| character_set_system                    | utf8                                                                                      |
| character_sets_dir                      | C:\Program Files\MySQL\MySQL Server 5.1\share\charsets\                                   |
| collation_connection                    | latin1_swedish_ci                                                                         |
| collation_database                      | latin1_swedish_ci                                                                         |
| collation_server                        | latin1_swedish_ci                                                                         |
| completion_type                         | 0                                                                                         |
| concurrent_insert                       | 1                                                                                         |
| connect_timeout                         | 10                                                                                        |
| datadir                                 | C:\ProgramData\MySQL\MySQL Server 5.1\Data\                                               |
| date_format                             | %Y-%m-%d                                                                                  |
| datetime_format                         | %Y-%m-%d %H:%i:%s                                                                         |
| default_week_format                     | 0                                                                                         |
| delay_key_write                         | ON                                                                                        |
| delayed_insert_limit                    | 100                                                                                       |
| delayed_insert_timeout                  | 300                                                                                       |
| delayed_queue_size                      | 1000                                                                                      |
| div_precision_increment                 | 4                                                                                         |
| engine_condition_pushdown               | ON                                                                                        |
| error_count                             | 0                                                                                         |
| event_scheduler                         | OFF                                                                                       |
| expire_logs_days                        | 0                                                                                         |
| flush                                   | OFF                                                                                       |
| flush_time                              | 1800                                                                                      |
| foreign_key_checks                      | ON                                                                                        |
| ft_boolean_syntax                       | + -><()~*:""&|                                                                            |
| ft_max_word_len                         | 84                                                                                        |
| ft_min_word_len                         | 4                                                                                         |
| ft_query_expansion_limit                | 20                                                                                        |
| ft_stopword_file                        | (built-in)                                                                                |
| general_log                             | OFF                                                                                       |
| general_log_file                        | C:\ProgramData\MySQL\MySQL Server 5.1\Data\INBELNIKHILESH1.log                            |
| group_concat_max_len                    | 1047552                                                                                   |
| have_community_features                 | YES                                                                                       |
| have_compress                           | YES                                                                                       |
| have_crypt                              | NO                                                                                        |
| have_csv                                | YES                                                                                       |
| have_dynamic_loading                    | YES                                                                                       |
| have_geometry                           | YES                                                                                       |
| have_innodb                             | YES                                                                                       |
| have_ndbcluster                         | NO                                                                                        |
| have_openssl                            | DISABLED                                                                                  |
| have_partitioning                       | YES                                                                                       |
| have_query_cache                        | YES                                                                                       |
| have_rtree_keys                         | YES                                                                                       |
| have_ssl                                | DISABLED                                                                                  |
| have_symlink                            | YES                                                                                       |
| hostname                                | INBELNIKHILESH1                                                                           |
| identity                                | 0                                                                                         |
| ignore_builtin_innodb                   | OFF                                                                                       |
| init_connect                            |                                                                                           |
| init_file                               |                                                                                           |
| init_slave                              |                                                                                           |
| innodb_adaptive_hash_index              | ON                                                                                        |
| innodb_additional_mem_pool_size         | 2097152                                                                                   |
| innodb_autoextend_increment             | 8                                                                                         |
| innodb_autoinc_lock_mode                | 1                                                                                         |
| innodb_buffer_pool_size                 | 49283072                                                                                  |
| innodb_checksums                        | ON                                                                                        |
| innodb_commit_concurrency               | 0                                                                                         |
| innodb_concurrency_tickets              | 500                                                                                       |
| innodb_data_file_path                   | ibdata1:10M:autoextend                                                                    |
| innodb_data_home_dir                    |                                                                                           |
| innodb_doublewrite                      | ON                                                                                        |
| innodb_fast_shutdown                    | 1                                                                                         |
| innodb_file_io_threads                  | 4                                                                                         |
| innodb_file_per_table                   | OFF                                                                                       |
| innodb_flush_log_at_trx_commit          | 1                                                                                         |
| innodb_flush_method                     |                                                                                           |
| innodb_force_recovery                   | 0                                                                                         |
| innodb_lock_wait_timeout                | 50                                                                                        |
| innodb_locks_unsafe_for_binlog          | OFF                                                                                       |
| innodb_log_buffer_size                  | 1048576                                                                                   |
| innodb_log_file_size                    | 25165824                                                                                  |
| innodb_log_files_in_group               | 2                                                                                         |
| innodb_log_group_home_dir               | .\                                                                                        |
| innodb_max_dirty_pages_pct              | 90                                                                                        |
| innodb_max_purge_lag                    | 0                                                                                         |
| innodb_mirrored_log_groups              | 1                                                                                         |
| innodb_open_files                       | 300                                                                                       |
| innodb_rollback_on_timeout              | OFF                                                                                       |
| innodb_stats_on_metadata                | ON                                                                                        |
| innodb_support_xa                       | ON                                                                                        |
| innodb_sync_spin_loops                  | 20                                                                                        |
| innodb_table_locks                      | ON                                                                                        |
| innodb_thread_concurrency               | 8                                                                                         |
| innodb_thread_sleep_delay               | 10000                                                                                     |
| innodb_use_legacy_cardinality_algorithm | ON                                                                                        |
| insert_id                               | 0                                                                                         |
| interactive_timeout                     | 28800                                                                                     |
| join_buffer_size                        | 131072                                                                                    |
| keep_files_on_create                    | OFF                                                                                       |
| key_buffer_size                         | 26214400                                                                                  |
| key_cache_age_threshold                 | 300                                                                                       |
| key_cache_block_size                    | 1024                                                                                      |
| key_cache_division_limit                | 100                                                                                       |
| language                                | C:\Program Files\MySQL\MySQL Server 5.1\share\english\                                    |
| large_files_support                     | ON                                                                                        |
| large_page_size                         | 0                                                                                         |
| large_pages                             | OFF                                                                                       |
| last_insert_id                          | 0                                                                                         |
| lc_time_names                           | en_US                                                                                     |
| license                                 | GPL                                                                                       |
| local_infile                            | ON                                                                                        |
| log                                     | OFF                                                                                       |
| log_bin                                 | OFF                                                                                       |
| log_bin_trust_function_creators         | OFF                                                                                       |
| log_bin_trust_routine_creators          | OFF                                                                                       |
| log_error                               | C:\ProgramData\MySQL\MySQL Server 5.1\Data\INBELNIKHILESH1.err                            |
| log_output                              | FILE                                                                                      |
| log_queries_not_using_indexes           | OFF                                                                                       |
| log_slave_updates                       | OFF                                                                                       |
| log_slow_queries                        | OFF                                                                                       |
| log_warnings                            | 1                                                                                         |
| long_query_time                         | 10.000000                                                                                 |
| low_priority_updates                    | OFF                                                                                       |
| lower_case_file_system                  | ON                                                                                        |
| lower_case_table_names                  | 1                                                                                         |
| max_allowed_packet                      | 1048576                                                                                   |
| max_binlog_cache_size                   | 4294963200                                                                                |
| max_binlog_size                         | 1073741824                                                                                |
| max_connect_errors                      | 10                                                                                        |
| max_connections                         | 100                                                                                       |
| max_delayed_threads                     | 20                                                                                        |
| max_error_count                         | 64                                                                                        |
| max_heap_table_size                     | 16777216                                                                                  |
| max_insert_delayed_threads              | 20                                                                                        |
| max_join_size                           | 18446744073709551615                                                                      |
| max_length_for_sort_data                | 1024                                                                                      |
| max_prepared_stmt_count                 | 16382                                                                                     |
| max_relay_log_size                      | 0                                                                                         |
| max_seeks_for_key                       | 4294967295                                                                                |
| max_sort_length                         | 1024                                                                                      |
| max_sp_recursion_depth                  | 0                                                                                         |
| max_tmp_tables                          | 32                                                                                        |
| max_user_connections                    | 0                                                                                         |
| max_write_lock_count                    | 4294967295                                                                                |
| min_examined_row_limit                  | 0                                                                                         |
| multi_range_count                       | 256                                                                                       |
| myisam_data_pointer_size                | 6                                                                                         |
| myisam_max_sort_file_size               | 107374182400                                                                              |
| myisam_recover_options                  | OFF                                                                                       |
| myisam_repair_threads                   | 1                                                                                         |
| myisam_sort_buffer_size                 | 36700160                                                                                  |
| myisam_stats_method                     | nulls_unequal                                                                             |
| myisam_use_mmap                         | OFF                                                                                       |
| named_pipe                              | OFF                                                                                       |
| net_buffer_length                       | 16384                                                                                     |
| net_read_timeout                        | 30                                                                                        |
| net_retry_count                         | 10                                                                                        |
| net_write_timeout                       | 60                                                                                        |
| new                                     | OFF                                                                                       |
| old                                     | OFF                                                                                       |
| old_alter_table                         | OFF                                                                                       |
| old_passwords                           | OFF                                                                                       |
| open_files_limit                        | 622                                                                                       |
| optimizer_prune_level                   | 1                                                                                         |
| optimizer_search_depth                  | 62                                                                                        |
| optimizer_switch                        | index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on |
| pid_file                                | C:\ProgramData\MySQL\MySQL Server 5.1\Data\INBELNIKHILESH1.pid                            |
| plugin_dir                              | C:\Program Files\MySQL\MySQL Server 5.1\lib/plugin                                        |
| port                                    | 3306                                                                                      |
| preload_buffer_size                     | 32768                                                                                     |
| profiling                               | OFF                                                                                       |
| profiling_history_size                  | 15                                                                                        |
| protocol_version                        | 10                                                                                        |
| pseudo_thread_id                        | 0                                                                                         |
| query_alloc_block_size                  | 8192                                                                                      |
| query_cache_limit                       | 1048576                                                                                   |
| query_cache_min_res_unit                | 4096                                                                                      |
| query_cache_size                        | 0                                                                                         |
| query_cache_type                        | ON                                                                                        |
| query_cache_wlock_invalidate            | OFF                                                                                       |
| query_prealloc_size                     | 8192                                                                                      |
| rand_seed1                              |                                                                                           |
| rand_seed2                              |                                                                                           |
| range_alloc_block_size                  | 4096                                                                                      |
| read_buffer_size                        | 65536                                                                                     |
| read_only                               | OFF                                                                                       |
| read_rnd_buffer_size                    | 262144                                                                                    |
| relay_log                               |                                                                                           |
| relay_log_index                         |                                                                                           |
| relay_log_info_file                     | relay-log.info                                                                            |
| relay_log_purge                         | ON                                                                                        |
| relay_log_space_limit                   | 0                                                                                         |
| report_host                             |                                                                                           |
| report_password                         |                                                                                           |
| report_port                             | 3306                                                                                      |
| report_user                             |                                                                                           |
| rpl_recovery_rank                       | 0                                                                                         |
| secure_auth                             | OFF                                                                                       |
| secure_file_priv                        |                                                                                           |
| server_id                               | 0                                                                                         |
| shared_memory                           | OFF                                                                                       |
| shared_memory_base_name                 | MYSQL                                                                                     |
| skip_external_locking                   | ON                                                                                        |
| skip_networking                         | OFF                                                                                       |
| skip_show_database                      | OFF                                                                                       |
| slave_compressed_protocol               | OFF                                                                                       |
| slave_exec_mode                         | STRICT                                                                                    |
| slave_load_tmpdir                       | C:\Users\NIKHIL~1\AppData\Local\Temp                                                      |
| slave_net_timeout                       | 3600                                                                                      |
| slave_skip_errors                       | OFF                                                                                       |
| slave_transaction_retries               | 10                                                                                        |
| slow_launch_time                        | 2                                                                                         |
| slow_query_log                          | OFF                                                                                       |
| slow_query_log_file                     | C:\ProgramData\MySQL\MySQL Server 5.1\Data\INBELNIKHILESH1-slow.log                       |
| socket                                  | MySQL                                                                                     |
| sort_buffer_size                        | 262144                                                                                    |
| sql_auto_is_null                        | ON                                                                                        |
| sql_big_selects                         | ON                                                                                        |
| sql_big_tables                          | OFF                                                                                       |
| sql_buffer_result                       | OFF                                                                                       |
| sql_log_bin                             | ON                                                                                        |
| sql_log_off                             | OFF                                                                                       |
| sql_log_update                          | ON                                                                                        |
| sql_low_priority_updates                | OFF                                                                                       |
| sql_max_join_size                       | 18446744073709551615                                                                      |
| sql_mode                                | STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION                            |
| sql_notes                               | ON                                                                                        |
| sql_quote_show_create                   | ON                                                                                        |
| sql_safe_updates                        | OFF                                                                                       |
| sql_select_limit                        | 18446744073709551615                                                                      |
| sql_slave_skip_counter                  |                                                                                           |
| sql_warnings                            | OFF                                                                                       |
| ssl_ca                                  |                                                                                           |
| ssl_capath                              |                                                                                           |
| ssl_cert                                |                                                                                           |
| ssl_cipher                              |                                                                                           |
| ssl_key                                 |                                                                                           |
| storage_engine                          | InnoDB                                                                                    |
| sync_binlog                             | 0                                                                                         |
| sync_frm                                | ON                                                                                        |
| system_time_zone                        | India Standard Time                                                                       |
| table_definition_cache                  | 256                                                                                       |
| table_lock_wait_timeout                 | 50                                                                                        |
| table_open_cache                        | 256                                                                                       |
| table_type                              | InnoDB                                                                                    |
| thread_cache_size                       | 8                                                                                         |
| thread_handling                         | one-thread-per-connection                                                                 |
| thread_stack                            | 196608                                                                                    |
| time_format                             | %H:%i:%s                                                                                  |
| time_zone                               | SYSTEM                                                                                    |
| timed_mutexes                           | OFF                                                                                       |
| timestamp                               | 1310401674                                                                                |
| tmp_table_size                          | 18874368                                                                                  |
| tmpdir                                  | C:\Users\NIKHIL~1\AppData\Local\Temp                                                      |
| transaction_alloc_block_size            | 8192                                                                                      |
| transaction_prealloc_size               | 4096                                                                                      |
| tx_isolation                            | REPEATABLE-READ                                                                           |
| unique_checks                           | ON                                                                                        |
| updatable_views_with_limit              | YES                                                                                       |
| version                                 | 5.1.42-community                                                                          |
| version_comment                         | MySQL Community Server (GPL)                                                              |
| version_compile_machine                 | ia32                                                                                      |
| version_compile_os                      | Win32                                                                                     |
| wait_timeout                            | 28800                                                                                     |
| warning_count                           | 0                                                                                         |
+-----------------------------------------+-------------------------------------------------------------------------------------------+
273 rows in set (0.00 sec)

To see some specific variables.

show global variables like 'group_concat_max%';

To Enable PHP5 using htaccess

To enable PHP5 for apache server, for a particular folder, edit the file “.htaccess” and add the below line.

AddHandler application/x-httpd-php5 .php

This will enabled the appliaction PHP5 for filetype “php”

Javassist Enhancement failed : java.lang.RuntimeException: java.lang.IllegalArgumentException

Just got this error. In case any one land up in the same error, here is some useful information.

Environment – Jboss 4.2.3, Struts2 and hibernate.

2010-08-31 12:50:16,873 ERROR [org.hibernate.proxy.pojo.BasicLazyInitializer] Javassist Enhancement failed: 
java.lang.RuntimeException: java.lang.IllegalArgumentException
	at javassist.util.proxy.ProxyFactory.setField(ProxyFactory.java:356)
	at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:339)
	at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:312)
	at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:271)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxyFactory(JavassistLazyInitializer.java:162)
	at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.postInstantiate(JavassistProxyFactory.java:66)
	at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:183)
	at org.hibernate.tuple.entity.AbstractEntityTuplizer.(AbstractEntityTuplizer.java:158)
	at org.hibernate.tuple.entity.PojoEntityTuplizer.(PojoEntityTuplizer.java:76)
	at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.(EntityEntityModeToTuplizerMapping.java:80)
	at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:325)
	at org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:457)
	at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:131)
	at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
	at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:261)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)

The issue : Conflicting javassist classes. Javssisst is bundled in the struts ( xwork-core-2.1.6.jar) and Jboss ( server/default/lib/javaassist.jar).

Work Around : Remove javassist from xwork-core-2.1.6.jar.

More details : WW-3308

How to change Jboss deployment order

In one of my application I wanted to change the default order of deployment in Jboss, so as to have my ear file deployed before my web application (war)  is started.

Make the below change to achieve this.

 

In the file

Jboss directory\server\default\conf\xmdesc\org.jboss.deployment.MainDeployer-xmbean.xml

Change this line to adjust the order by package type.


<value value="250:.rar,300:-ds.xml,400:.jar,500:.ear,550:.jse,650:.war,800:.bsh"/>


<attribute access='read-write' setMethod='setEnhancedSuffixOrder' getMethod='getEnhancedSuffixOrder'>
<description>Allows the override of the suffix order declared by subdeployers, using the syntax [order:]suffix
</description>
<name>EnhancedSuffixOrder</name>
<type>[Ljava.lang.String;</type>
<!--
Statically set one or more enhanced suffix orders, independent of the value proposed by subdeployers.
Some deployers may also allow the suffixes/orders to be set locally, so that's preferable too.
For reference, this is the list of enhanced suffixes likely to be set by deployers (it may not
be completely up-to-date, or there can be user-defined deployers).

050:.deployer,050:-deployer.xml,100:.aop,100:-aop.xml,150:.sar,150:-service.xml,200:.beans,250:.rar,300:-ds.xml,350:.har,400:.jar,400:.ejb3,400:.par,500:.war,600:.wsr,650:.ear,700:.jar,750:.zip,800:.bsh,900:.last

Until we resolve some startup issues, we'll setup some static enhanced suffix orders bellow
and leave the rest of the suffixes contributed dynamically by registering deployers.
-->
<descriptors>
<value value="250:.rar,300:-ds.xml,400:.jar,500:.ear,550:.jse,650:.war,800:.bsh"/>
</descriptors>
</attribute>