Thursday, June 22, 2017

How to include a RSForm to a page built with ST Page Builder in Joomla 3

We can include a RSForm to a page built with ST page builder without using RSForm's "Content Plugin for Joomla 3.0". (Currently "Content Plugin for Joomla 3.0" is not freely available)

Main steps for this are :

1. Create a RSForm using the RSForm! Pro component
2. Create a new module including that component
3. Include the module to a page built using the ST Page Builder component

1.1) Create a RSForm

2.1) Create a new Module

2.2) Choose the module type

2.3) Include the required RSForm to the module (Set required position, Access, Ordering, Language, Menu Assignment etc)

3.1) Go to the page built with ST Page builder
3.2) Drag the "Module" tool from the tool box and drop it on design where necessary

3.3) Click on the "Edit" button and choose the necessary module we created.

Now Form should be visible inside the page.

Monday, June 5, 2017

How to start & stop a VPN connection via shell

To list all available Network Manager connections:-
nmcli con

To start an available VPN connection:-
nmcli con up id ConnectionName

To stop an available VPN connection:-
nmcli con down id ConnectionName

Thursday, March 16, 2017

Print a web page with CSS styles

Assume you have created a web page with several CSS styles including several colours in it. However, when you try to print that web page through a web browser you might not see the included styles in the web pages's print preview.

To make available your styles to the page's print version, you have to import your print style sheet to your web page as follows.




<!-- If you use media="screen" styles will be only available on the screen-->
<link rel="stylesheet" href="print_style.css" type="text/css" media="print" />


<h1 class="title">I am blue</h1>


As you can see in the above print_page.html we have linked our style sheet using attribute media with value print.

Now you can see styles available in the print_style.css in the print preview but not in screen. You can use media="screen" to display styles on the screen but not in print.

Monday, January 16, 2017

Frequently used tcpdump commands

* View available network interfaces
tcpdump -D

* Capture and prints only 10 packets from a single available interface:
tcpdump -i [any_available_interface] -c 10

* Capture and prints packets from a single available interface and display more contents inside packets.
tcpdump -l -v -i [any_available_interface]

* Capture packets and grep for a specific word.
tcpdump -l -v -i [any_available_interface] | grep [any_possible_available_word]

* Capture and prints packet details including header values in ASCII and HEX
tcpdump -l -v -X -i [any_available_interface]

* Capture and prints tcp packets from specific_src_IP:port 80 to specific_dst_IP
tcpdump -l -i [any_available_interface] port 80 and dst [any_available_IP] and src [any_available_IP] and tcp

* Capture packets from specified host and write those packets to a file.
tcpdump -w /file/path.pcap -l -i lo host [any_available_IP]

* Read and filter the packets through port 80 from above saved file and print details.
tcpdump -r /file/path.pcap -l -v port 80

Friday, January 13, 2017

Useful REGEXs

^ - says start matching from the beginning of the string.
\d - says match only digits
+ - says match minimum 1 or more occurrences
* - says match minimum 0 or more occurrences
$ - says matching happens until the end of the string.

^\d+$ - Numeric Only

^\D+$ - Characters only

^true$|^false$ - True or False only

^\d+(,\d+)*$ - Comma separated digits only (1,2,3,5)

^\d+(:\d+)$ - Two digits separated by Colon (10:00)

^(\d+(:\d+)(-\d+(:\d+)))$ - Two groups of Two digits separated by colon, connected by a dash (8:00-10:00)

Wednesday, November 23, 2016

How to connect to HSQL DB via console

I was using Spring boot(1.4.0.RELEASE)  with HSQL DB(hsqldb-2.2.6) for one of my projects. For one of my purpose, I needed to log to my HSQL DB via console and execute queries manually. After few searchings, I found a specific tool called sqltool(sqltool-2.2.6) which can be used for that purpose.

  1. Download  sqltool(sqltool-2.2.6) via
  2. Place the sqltool-2.2.6.jar in the same location where hsqldb-2.2.6.jar is available.
  3. Run the sqltool jar using following command.

  4. java -jar <path_to_sql_tool_jar>/sqltool-2.2.6.jar --inlineRc=url=jdbc:hsqldb:file:<path_to_db_where_.log_.propertis_.script>/<db_name>,user=<db_user_name>

  5. Then password will be asked. After authentication, you will log to console.
  6. Remember to close all the other connections to the particular DB otherwise, Database lock acquisition failure will be occured.

Sunday, October 16, 2016

ActiveMQ Message Attribute definitions

[Details are collected from several online references to ActiveMQ documentation, StackOverflow, blogs, mailing lists etc. Expecting expert comments or reviews regarding this post since it was difficult to find a direct trustful resource related to this topic.]

Delivery Mode
Delivery mode can be either persistent(integer value 2) or nonpersistent(integer value 1).
An Unique ID for the message. Automatically assigned when the message is received to JMS server.
A priority level for each message. Priority range is 0-9. 0 is the lowest priority and 9 is highest.
Value is a boolean. If the true message will be considered for redelivery. If the false message will not be considered for redelivery.
for the time when the message is received by the JMS server.