Image

How to share iPhone Internet connection with Ubuntu Linux

How to configure owncloud client in CentOS / Red Hat

rpm --import https://download.owncloud.org/download/repositories/stable/CentOS_7/repodata/repomd.xml.key

curl -L https://download.owncloud.org/download/repositories/stable/CentOS_7/ce:stable.repo -o /etc/yum.repos.d/ownCloud.repo

yum clean expire-cache
yum install -y epel-release
yum update -y
yum install -y owncloud-client

mkdir owncloud

owncloudcmd -u jm2_site01 -p jm2_site01 owncloud/ http://192.168.225.145/owncloud

How to embed Javascript code in HTML

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")
</script>

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 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 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 install kibana in centos / redhat

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

       rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
    2. /etc/yum.repos.d/elasticsearch.repo

      [elasticsearch-6.x]
      name=Elasticsearch repository for 6.x packages
      baseurl=https://artifacts.elastic.co/packages/6.x/yum
      gpgcheck=1
      gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
      enabled=1
      autorefresh=1
      type=rpm-md
  2. yum install -y kibana
  3. configure elasticsearch /etc/kibana/kibana.yml server.host: “0.0.0.0”
  1. enable firewall

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

– systemctl enable kibana

  1. test

    curl 127.0.0.1:9200
    {
      "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 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 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 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
linux-vdso.so.1 =>  (0x00007fff8a372000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x00007fa53a974000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa53a770000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa53a3db000)
        /lib64/ld-linux-x86-64.so.2 (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`
        linux-vdso.so.1 =>  (0x00007fff855ff000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x00007f0cc4c11000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0cc4a0d000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0cc4678000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0cc4e7f000)

        Version information:
        /bin/bash:
                libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2
                libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.8) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.11) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/libncurses.so.5:
                libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2
                libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/libdl.so.2:
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/libc.so.6:
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2

Top