About webmaster

dirrty dirrty sean
Latest Posts | By webmaster

How to embed Javascript code in HTML

By  •  JavaScript

Javascript can be included in HTML by whether embedding it to the HTML file itself, or by calling an external file.

There are few options to include Javascript code into HTML, but current best practice is as in the example below;

<script type="text/javascript">
    window.alert("Hello World")

The above example using type and MIME type, when called from anywhere in the HTML page will pop up an alert with the Hello World text.

How to create MySQL user

User account can be created by using MySQL’s GRANT statement. For this, you’ll need to login to MySQL using the root account, which has full privilege on the mysql.user table.

The following statement will create a user account named myusername which will have full access to the mydatabase database from localhost and set the password to mypassword

 GRANT ALL ON mydatabase.* TO 'myusername'@'localhost' IDENTIFIED BY 'mypassword';

How to view tar.bz2 file content in Linux

By  •  Linux

tar.bz2 is a file format for bzip2-compressed tar archive. tar.bz2 files are normally small in size but require more CPU power to compress and extract as compared to tar.gz files.

To view the content of a tar.bz2 file without uncompressing, use tar with the tf options as follows;

$ tar tf filename.tar.bz2

The command will produce a list of files contained in the archive. Use less if the list is too long;

$ tar tf filename.tar.bz2 | less

How to install kibana in centos / redhat

  1. Add elasticsearch repo to yum
    1. Download and install the public signing key

       rpm --import
    2. /etc/yum.repos.d/elasticsearch.repo

      name=Elasticsearch repository for 6.x packages
  2. yum install -y kibana
  3. configure elasticsearch /etc/kibana/kibana.yml “”
  1. enable firewall

    firewall-cmd --add-port=5601/tcp --permanent
    firewall-cmd --reload
  2. systemctl start kibana

– systemctl enable kibana

  1. test

      "name" : "l_cUCzP",
      "cluster_name" : "elasticsearch",
      "cluster_uuid" : "ueCIZ5AqSEWsMRb7VU90cw",
      "version" : {
        "number" : "6.2.1",
        "build_hash" : "7299dc3",
        "build_date" : "2018-02-07T19:34:26.990113Z",
        "build_snapshot" : false,
        "lucene_version" : "7.2.1",
        "minimum_wire_compatibility_version" : "5.6.0",
        "minimum_index_compatibility_version" : "5.0.0"
      "tagline" : "You Know, for Search"

How to increase PHP memory limit

By  •  PHP

PHP scripts are only allocated a certain amount of memory that it can use, and whet it reaches the limit, it will produce the following error;

PHP Fatal error: Allowed memory size of xxxx bytes exhausted (tried to allocate yyyy) in yourscript.php

To fix this, you’ll need to increase the memory limit for PHP scripts using any of the following methods;

How to increase backlinks to your website

Link building or the process of getting backlinks to your website is very important because other than to increase referral traffic to your site, it’ll also increase search engine traffic by increasing your site’s PageRank. Link building is therefore the most important step in increasing your website’s traffic.

How to crack Windows password using ophcrack

By  •  Linux

Ophcrack is a Microsoft Windows password cracker. It’s uses Rainbow table to crack the passwords, while still be able to use brute-force to do the job. Ophcrack can recover password from all version of Windows.

For this example, we’ll be using Ophcrack Live CD which already has all the software and required packages installed and can do the password cracking automatically.

To recover your Windows passwords, follow the following steps.

How to show shared library dependency in Linux

By  •  Linux

Programs compiled for Linux normally use shared libraries rather than being statically linked. The advantage to this is that it’ll save disk spaces as programs don’t need to include libraries in their package. The disadvantage to this is that a program compiled for one system, might not work on another system (distribution) as libraries might not be identically configured on different systems.

The program ldd can be used to display shared libraries used by a program, along with the path of where the library is expected to be found in the filesystem.

The following example shows dependencies of the program bash in a 64 bit machine:

$ ldd /bin/bash =>  (0x00007fff8a372000) => /lib/ (0x00007fa53a974000) => /lib/x86_64-linux-gnu/ (0x00007fa53a770000) => /lib/x86_64-linux-gnu/ (0x00007fa53a3db000)
        /lib64/ (0x00007fa53abe2000)

To display more information and to not need to type the program’s full path, run the command as the following.

$ ldd -v `which bash` =>  (0x00007fff855ff000) => /lib/ (0x00007f0cc4c11000) => /lib/x86_64-linux-gnu/ (0x00007f0cc4a0d000) => /lib/x86_64-linux-gnu/ (0x00007f0cc4678000)
        /lib64/ (0x00007f0cc4e7f000)

        Version information:
       (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/
       (GLIBC_2.4) => /lib/x86_64-linux-gnu/
       (GLIBC_2.8) => /lib/x86_64-linux-gnu/
       (GLIBC_2.3) => /lib/x86_64-linux-gnu/
       (GLIBC_2.11) => /lib/x86_64-linux-gnu/
       (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/
       (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/
       (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/
       (GLIBC_2.4) => /lib/x86_64-linux-gnu/
       (GLIBC_2.3) => /lib/x86_64-linux-gnu/
       (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/
       (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/
       (GLIBC_PRIVATE) => /lib64/
       (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/
       (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/
       (GLIBC_PRIVATE) => /lib64/
       (GLIBC_2.3) => /lib64/

How to use PHP 7 in cPanel hosting

By  •  cPanel

cPanel ships with PHP 7, but PHP 5 is still used by default instead. Even if you don’t use PHP 7 specific functions, the performance benefit that PHP 7 brings is a good enough reason to switch. This is especially important in shared hosting such as cPanel as performance is especially lacking.

Make sure your application is compatible with PHP 7 before making the switch.

To start using PHP 7 within your cPanel hosting, log in to cPanel and follow these steps;

  1. Go to the Software section and click on Select PHP Version.
  2. Here you’ll see the PHP version used for your cPanel hosting. Click on the select box, and choose 7.0 or whatever latest version of PHP version available.
  3. Click Set as current for the changes to be effective, and notice Current PHP version in the example is now 7.0.
  4. Check your current PHP version to confirm.