Linux.com

usmangt

usmangt

  • Linux.com Member
  • Posts: 42
  • Member Since: 22 Aug 09
  • Last Logged In: 15 Aug 12

Latest Posts

Posted by
Topic
Post Preview
Posted
  • usmangt
    RE: Using keepalived load balancer for the MySQL Cluster
    Since, in the forum the file attachment is not working so i am pasting it in here [code] global_defs { router_id OX } vrrp_sync_group OX_GROUP { group { OX_GOUP } } vrrp_instance OX_VRRP { state BACKUP interface eth0 garp_master_delay 10 virtual_router_id 10 priority 101 nopreempt advert_int 1 authentication { auth_type PASS # Simple 'PASS' can use auth_pass example # example password '1234' } virtual_ipaddress { 10.10.10.249/24 brd 10.10.10.255 dev eth0 # virtual service ip 10.10.10.249 } virtual_ipaddress_excluded { } } virtual_server_group OX_HTTP { 10.10.10.249 3306 # virtual ip and port 3306 } virtual_server group OX_HTTP { delay_loop 3 lvs_sched rr lvs_method DR protocol TCP virtualhost 10.10.10.249 real_server 10.10.10.187 3306 { weight 1 inhibit_on_failure TCP_CHECK { connect_port 3306 connect_timeout 10 } } real_server 10.10.10.189 3306 { weight 1 inhibit_on_failure TCP_CHECK { connect_port 3306 connect_timeout 10 } } } [/code]
    Link to this post 15 Aug 12

    Since, in the forum the file attachment is not working so i am pasting it in here


    global_defs {
    router_id OX
    }

    vrrp_sync_group OX_GROUP {
    group {
    OX_GOUP
    }
    }

    vrrp_instance OX_VRRP {
    state BACKUP
    interface eth0
    garp_master_delay 10
    virtual_router_id 10
    priority 101
    nopreempt
    advert_int 1
    authentication {
    auth_type PASS # Simple 'PASS' can use
    auth_pass example # example password '1234'
    }
    virtual_ipaddress {
    10.10.10.249/24 brd 10.10.10.255 dev eth0 # virtual service ip 10.10.10.249
    }
    virtual_ipaddress_excluded {
    }
    }

    virtual_server_group OX_HTTP {
    10.10.10.249 3306 # virtual ip and port 3306
    }

    virtual_server group OX_HTTP {
    delay_loop 3
    lvs_sched rr
    lvs_method DR
    protocol TCP
    virtualhost 10.10.10.249

    real_server 10.10.10.187 3306 {
    weight 1
    inhibit_on_failure
    TCP_CHECK {
    connect_port 3306
    connect_timeout 10
    }
    }

    real_server 10.10.10.189 3306 {
    weight 1
    inhibit_on_failure
    TCP_CHECK {
    connect_port 3306
    connect_timeout 10
    }
    }
    }

  • usmangt
    Using keepalived load balancer for the MySQL Cluster
    Hello Everyone, I have a working MySQL cluster which is based on 2 nodes. Now on my 3rd server i want to use it as a Load balancer for the MySQL cluster. As, i do not have that much experience in load balancing part so i Google for it and i finally made my configuration file. Kindly take a look at the attached config file. And please tell me if i am missing some parameters. Thanks, usmangt
    Link to this post 15 Aug 12

    Hello Everyone,

    I have a working MySQL cluster which is based on 2 nodes.

    Now on my 3rd server i want to use it as a Load balancer for the MySQL cluster.

    As, i do not have that much experience in load balancing part so i Google for it and i finally made my configuration file.

    Kindly take a look at the attached config file.

    And please tell me if i am missing some parameters.

    Thanks,
    usmangt

  • usmangt
    Project idea
    Hello, I am looking for some idea for a small to mid size project. What i am looking for is a project which is a web application (but not making any kind of fancy ecommerce, cms, paypal-shopping etc.) that help Linux administrators in most of their daily life routines. So for this i am looking for ideas. I want to use PHP for the web interface and use the scripting languages such as Perl/Python (because PHP is good but it cannot do all the things) to find different information in the system. Also it will be excellent to use MySQL Database for this (Right now i am not sure where is should use it but really looking forward to it.) So kindly suggest me your ideas/opinion about this. I am really excited to hear from you Thanks in advance Usman
    Link to this post 09 Jun 12

    Hello,

    I am looking for some idea for a small to mid size project.

    What i am looking for is a project which is a web application (but not making any kind of fancy ecommerce, cms, paypal-shopping etc.) that help Linux administrators in most of their daily life routines. So for this i am looking for ideas. I want to use PHP for the web interface and use the scripting languages such as Perl/Python (because PHP is good but it cannot do all the things) to find different information in the system. Also it will be excellent to use MySQL Database for this (Right now i am not sure where is should use it but really looking forward to it.)

    So kindly suggest me your ideas/opinion about this.

    I am really excited to hear from you

    Thanks in advance

    Usman

  • usmangt
    Which users can login
    Hello, Is there a way to show which users could log onto the system and all groups available on the system. NOT which users were currently online and which groups you belong to. Thanks, Usman
    Link to this post 18 Feb 12

    Hello,

    Is there a way to show which users could log onto the system and all groups available on the system. NOT which users were currently online and which groups you belong to.

    Thanks,
    Usman

  • usmangt
    RE: Need help using multiple variables within a line
    Hi, I have tried the syntax but it still giving me error of bad subsitution. [code]#!/bin/bash pre_result1=( 12.00 1.28 ) pre_result2=( 2.92 12.00 ) pre_result3=( 2.92 12.00 ) test1=( s 3 3 4 5 ) test2=( p 2 5 7 ) test3=( r 2 5 7 ) for i in 1 2 3 do ./testelectronic <<< "${test$i[0]}" "${test$i[1]}" "${test$i[2]}" "${test$i[3]}" "${test$i[4]}" > "test$i".txt result1=`head -n 6 test"$i".txt | tail -n 1` result2=`tail -1 test"$i".txt` echo $result1 | awk '{print $NF}' > result1.txt echo $result2 | awk '{print $NF}' > result2.txt val1=0 val2=0 FILENAME="result1.txt" while read line do val1=$line done < $FILENAME FILENAME="result2.txt" while read line do val2=$line done < $FILENAME if [ "$val1" == "${pre_result$i[0]}" ] && [ "$val2" == "${pre_result$i[1]}" ] then echo "Test$i Passed" else echo "Test$i Failed" fi done [/code] Thank you usmangt
    Link to this post 01 Jan 12

    Hi,

    I have tried the syntax but it still giving me error of bad subsitution.

    #!/bin/bash 

    pre_result1=( 12.00 1.28 )
    pre_result2=( 2.92 12.00 )
    pre_result3=( 2.92 12.00 )

    test1=( s 3 3 4 5 )
    test2=( p 2 5 7 )
    test3=( r 2 5 7 )

    for i in 1 2 3

    do

    ./testelectronic <<< "${test$i[0]}" "${test$i[1]}" "${test$i[2]}" "${test$i[3]}" "${test$i[4]}" > "test$i".txt

    result1=`head -n 6 test"$i".txt | tail -n 1`
    result2=`tail -1 test"$i".txt`

    echo $result1 | awk '{print $NF}' > result1.txt
    echo $result2 | awk '{print $NF}' > result2.txt


    val1=0
    val2=0
    FILENAME="result1.txt"
    while read line
    do
    val1=$line
    done < $FILENAME

    FILENAME="result2.txt"
    while read line
    do
    val2=$line
    done < $FILENAME

    if [ "$val1" == "${pre_result$i[0]}" ] && [ "$val2" == "${pre_result$i[1]}" ]
    then
    echo "Test$i Passed"

    else
    echo "Test$i Failed"

    fi

    done


    Thank you

    usmangt

  • usmangt
    Need help using multiple variables within a line
    I have made a script which works fine. But when i include the for loop in my script in give errors. I know that this is an syntax error ./test.sh: line 17: ${test"$i"[0]} ${test"$i"[1]} ${test"$i"[2]} ${test"$i"[3]} ${test"$i"[4]}: bad substitution Test1 Passed ./test.sh: line 17: ${test"$i"[0]} ${test"$i"[1]} ${test"$i"[2]} ${test"$i"[3]} ${test"$i"[4]}: bad substitution Test1 Failed ./test.sh: line 17: ${test"$i"[0]} ${test"$i"[1]} ${test"$i"[2]} ${test"$i"[3]} ${test"$i"[4]}: bad substitution Here is my script [code]#!/bin/bash pre_result1=( 12.00 1.28 ) pre_result2=( 2.92 12.00 ) pre_result3=( 2.92 12.00 ) #pre_result3=12 test1=( s 3 3 4 5 ) test2=( p 2 5 7 ) test3=( r 2 5 7 ) for (( i=1; i<=3; i++ )) do ./testelectronic <<< "${test"$i"[0]} ${test"$i"[1]} ${test"$i"[2]} ${test"$i"[3]} ${test"$i"[4]}" > test"$i".txt #extracting required lines from file result1=`head -n 6 test"$i".txt | tail -n 1` result2=`tail -1 test"$i".txt` #printing for testing purpose #echo $result1 #echo $result2 #extracting required values from lines #compare=result1 | awk '{print $NF}' echo $result1 | awk '{print $NF}' > result1.txt echo $result2 | awk '{print $NF}' > result2.txt val1=0 val2=0 FILENAME="result1.txt" while read line do val1=$line done < $FILENAME FILENAME="result2.txt" while read line do val2=$line done < $FILENAME #printing for testing purpose #echo $val1 #echo $val2 if [ "$val1" == "${pre_result1[0]}" ] && [ "$val2" == "${pre_result1[1]}" ] then echo "Test1 Passed" else echo "Test1 Failed" fi done[/code] I Google for this and found an example and i use like this [code]./testelectronic <<< "${test[$i][0]} ${test[$i][1]} ${test[$i][2]} ${test[$i][3]} ${test[$i][4]}" > test$i.txt[/code] It remove the error but now this line do not take parameters correctly. Kindly help Thanks in advance usmangt
    Link to this post 29 Dec 11

    I have made a script which works fine. But when i include the for loop in my script in give errors. I know that this is an syntax error


    ./test.sh: line 17: ${test"$i"[0]} ${test"$i"[1]} ${test"$i"[2]} ${test"$i"[3]} ${test"$i"[4]}: bad substitution
    Test1 Passed
    ./test.sh: line 17: ${test"$i"[0]} ${test"$i"[1]} ${test"$i"[2]} ${test"$i"[3]} ${test"$i"[4]}: bad substitution
    Test1 Failed
    ./test.sh: line 17: ${test"$i"[0]} ${test"$i"[1]} ${test"$i"[2]} ${test"$i"[3]} ${test"$i"[4]}: bad substitution


    Here is my script


    #!/bin/bash

    pre_result1=( 12.00 1.28 )
    pre_result2=( 2.92 12.00 )
    pre_result3=( 2.92 12.00 )
    #pre_result3=12

    test1=( s 3 3 4 5 )
    test2=( p 2 5 7 )
    test3=( r 2 5 7 )

    for (( i=1; i<=3; i++ ))

    do


    ./testelectronic <<< "${test"$i"[0]} ${test"$i"[1]} ${test"$i"[2]} ${test"$i"[3]} ${test"$i"[4]}" > test"$i".txt
    #extracting required lines from file
    result1=`head -n 6 test"$i".txt | tail -n 1`
    result2=`tail -1 test"$i".txt`
    #printing for testing purpose
    #echo $result1
    #echo $result2

    #extracting required values from lines
    #compare=result1 | awk '{print $NF}'
    echo $result1 | awk '{print $NF}' > result1.txt
    echo $result2 | awk '{print $NF}' > result2.txt


    val1=0
    val2=0
    FILENAME="result1.txt"
    while read line
    do
    val1=$line
    done < $FILENAME

    FILENAME="result2.txt"
    while read line
    do
    val2=$line
    done < $FILENAME

    #printing for testing purpose
    #echo $val1
    #echo $val2



    if [ "$val1" == "${pre_result1[0]}" ] && [ "$val2" == "${pre_result1[1]}" ]
    then
    echo "Test1 Passed"

    else
    echo "Test1 Failed"

    fi

    done

    I Google for this and found an example and i use like this

    ./testelectronic <<< "${test[$i][0]} ${test[$i][1]} ${test[$i][2]} ${test[$i][3]} ${test[$i][4]}" > test$i.txt

    It remove the error but now this line do not take parameters correctly.

    Kindly help

    Thanks in advance

    usmangt

  • usmangt
    bash script to join files
    Hi, I am creating a bash script which search video files in a folder and join video files which are splitted into multiple parts. for e.g. shark.cd1.avi shark.cd2.avi catroon.cd1.avi cartoon.cd2.avi cartoon.cd3.avi so as to make a single file for e.g. shark.avi and cartoon.avi Please tell me some tips and suggestions, how to do it. i.e. what way i can find and join the files accordingly ordered by ther cd number. Thanks usmangt
    Link to this post 20 Aug 11

    Hi,

    I am creating a bash script which search video files in a folder and join video files which are splitted into multiple parts.

    for e.g.

    shark.cd1.avi
    shark.cd2.avi

    catroon.cd1.avi
    cartoon.cd2.avi
    cartoon.cd3.avi


    so as to make a single file for e.g. shark.avi and cartoon.avi

    Please tell me some tips and suggestions, how to do it. i.e. what way i can find and join the files accordingly ordered by ther cd number.

    Thanks

    usmangt

  • usmangt
    Python Gstreamer Basic Help
    Hello Everyone, I need help regarding the basic of use of Gstreamer with Python bindings. I have Google a lot and i found many good examples but all of them using the GTK library for the GUI. I just want to find a basic example of Python-Gstreamer without the use of GTK. So i can understand how it works, and what is used for pipeline when we want to record a video from webcam. Please guys help me with one. Thank you usman
    Link to this post 09 Jul 11

    Hello Everyone,

    I need help regarding the basic of use of Gstreamer with Python bindings. I have Google a lot and i found many good examples but all of them using the GTK library for the GUI.

    I just want to find a basic example of Python-Gstreamer without the use of GTK. So i can understand how it works, and what is used for pipeline when we want to record a video from webcam.

    Please guys help me with one.


    Thank you

    usman

  • usmangt
    Bind DNS help!
    Hi, i have setup a forward dns entry and i have specified the ip 192.169.x.x (i got this ip from the ifconfig command) Now when i do nslookup finds the domain perfectly but the problem is that it can be only viewable privately not publically viewable. I am not sure how to make the domain publically viewable , but what i was thinking is that If i check the main ip address from the www.whatismyip.com and replace my private ip with it. Will that work. or need some other way. Please help. usmangt
    Link to this post 18 Apr 11

    Hi,

    i have setup a forward dns entry and i have specified the ip 192.169.x.x (i got this ip from the ifconfig command)

    Now when i do nslookup finds the domain perfectly but the problem is that it can be only viewable privately not publically viewable.


    I am not sure how to make the domain publically viewable , but what i was thinking is that If i check the main ip address from the www.whatismyip.com and replace my private ip with it. Will that work. or need some other way.

    Please help.

    usmangt

  • usmangt
    RE: php user input
    well the user input will not be used for some website. what i am trying to achieve is that to get the input from the command line argument e.g. ./file.php 23 45 29 so that i can save these three input values in my script for their sum calculation
    Link to this post 17 Apr 11

    well the user input will not be used for some website. what i am trying to achieve is that to get the input from the command line argument e.g.

    ./file.php 23 45 29

    so that i can save these three input values in my script for their sum calculation

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board