Thursday, March 25, 2021

C Program palindrome Decimal and Binary (Decimal and of that Binary is palindrome testing program )

//  Decimal and of that Binary  is  palindrome testing  program 

// this is not a optimised program



#include <stdio.h>
#include <math.h>


long decimalToBinary(int dec_num)
{
    long bin_num = 0;
    int rem, temp = 1;

    while (dec_num!=0)
    {
        rem = dec_num%2;
        dec_num = dec_num / 2;
        bin_num = bin_num + rem*temp;
        temp = temp * 10;
    }
    return bin_num;
}

int palindrome_num(int decimalN){
     int n= decimalN,reversedN = 0, remainder;
     // reversed integer is stored in reversedN
    while (n != 0) {
        remainder = n % 10;
        reversedN = reversedN * 10 + remainder;
        n /= 10;
    }


    if (decimalN == reversedN){
        decimalN=1;
         
    }
    else{
        decimalN=0;
         
    }

    return decimalN;
}

int main()
{
      int n, flag_dec/*this is decimal palindrome flag */, flag_bin /*this is binary palindrome flag */;
      long int binary_num;
    printf("Enter an integer: ");
    scanf("%d", &n);
   
while(n) { //start while loop

    // check the decima number palindrome or not  
         flag_dec=palindrome_num(n);
    // convert Decinal into binary number
         binary_num=decimalToBinary(n);
     // check the binary number palindrome or not  
         flag_bin=palindrome_num(binary_num);
 
  if (flag_dec)
  if( flag_bin)
 {
        printf("\n ***********************YES*************************************");
        printf("\n Decinal numner is %ld ",n);
        printf("\n Decinal numner is %ld ",binary_num);
        printf("\n This decimal number and Binary numbera are palindrome");
        printf("\n ************************YES************************************");
     break;
     
  }
  n++;

   
}//end while loop

    return 0;
}

Tuesday, April 28, 2020

JITSI-MEET INSTALLATION STEPS ON UBUNTU 16.04 & 18.04


Create a Ubuntu 16.04 or 18.04 VM on your cloud server (Azure,GC , AWS or vultur,Vurtual box with ubuntu).

The minimum VM configurations require is: 
CPU:2.0
RAM:4GB 
SDD or HDD: 20GB 

Note: Please read carefully highlighted text and copy past the commands , Arrow mark is not a command , don't copy past.


  • apt update
  • java
  • => “you will get java version list “
  • apt install openjdk-8-jre-headless
  • java -version
  • nginx
  • => “you will get Nginx version list but,you have use below command only “
  • apt install nginx
  • ufw status
  • => “Active or inactive does not matter”
  • ufw allow ssh
  • ufw allow 80/tcp
  • ufw allow 443/tcp
  • ufw allow 10000:60000/tcp
  • ufw allow 10000:60000/udp
  • ufw allow 5222
  • ufw allow 5347
  • netstat -tunlp       // list out all open ports 
  • wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | sudo apt-key add -
  • sudo sh -c "echo 'deb https://download.jitsi.org stable/' > /etc/apt/sources.list.d/jitsi-stable.list"
  • sudo apt-get -y update (keep ready your IP or Domain for below command)
  • sudo apt-get -y install jitsi-meet
  • Select the self-signed certificates  
  • Open chrome browser
  • https://localhost , https://raj.xyz.com or https:// 52.34.XX.XXX

=>”if you get 404 not found then you have to restart the all services which are the below listed“
systemctl restart nginx.service
=>"if nginx throw errors then need to follow below steps"

  • nginx -t
  • sudo fuser -k 80/tcp
  • sudo fuser -k 443/tcp
  • restart again (systemctl restart nginx.service )
  • systemctl restart jitsi-videobridge2.service
  • systemctl restart jicofo.service
  • systemctl restart prosody.service

=>"Now go and check on browser"
Open with https://<domain<ip>
click on Advance 
click on proceed to node 1 example.com (unsafe). 
Now you can put your name or conference on text box and click on GO button .
=> “Don’t use https,http or any space with domain or IP be careful”
=>”Put your domain localhost, if you have domain then you can put domain ( <raj.xyz.com> name or IP<52.34.XX.XXX>)”


    =>Where is your webApp ?
    cd /usr/share/jitsi-meet

    Configurations file
    =>Where is your prosody ?
    cd /etc/prosody
    ls
    cd conf.d
    ls 
    =>“after ls command you will get configurations file of the prosody”
    =>Where is your jicofo ?
    cd /etc/jitsi/jicofo
    ls “jicofo configurations file ”
    =>Where is your videobridge ?
    cd /etc/jitsi/videobridge
    ls 
    =>“videobridge configurations file ”
    => Where is your domain<IP>.com-config.js ?
    cd /etc/jitsi/meet
    ls “jitsi-meet interface configurations file ”
    => If you have need more than two participants then you have to follow below steps .
    1. ifconfig “find your private IP”
    2. if you did not get private IP then you can use you public IP instead of private.

    =>Open your videobridge configurations file from below steps

    apt install vim
    cd /etc/jitsi/videobridge
    vi sip-communicator.properties
    or
    vi /etc/jitsi/videobridge/sip-communicator.properties

    Put the below lines on sip-communicator.properties files 

    # This line already added in sip-communicator.properties file be careful
    org.jitsi.videobridge.AUTHORIZED_SOURCE_REGEXP=focus@auth.domain<IP>.com/.*
    #you have to add from here
    org.jitsi.impl.neomedia.transform.srtp.SRTPCryptoContext.checkReplay=false
    org.jitsi.videobridge.TCP_HARVESTER_PORT=4443
    org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=10.XX.XXX.14
    org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=50.12.XX.220
    org.jitsi.videobridge.ENABLE_STATISTICS=true
    org.jitsi.videobridge.STATISTICS_TRANSPORT=pubsub
    org.jitsi.videobridge.STATISTICS_INTERVAL=5000
    org.jitsi.videobridge.PUBSUB_SERVICE=pubsub.50.12.XX.220
    org.jitsi.videobridge.PUBSUB_NODE=sharedStatsNode

    =>Restart the all services
    systemctl restart jitsi-videobridge2.service
    systemctl restart jicofo.service
    systemctl restart prosody.service 
    systemctl restart prosody.service 

    =>some basic commands
    ifconfig
    wget -qO- ifconfig.me
    ip addr show
    netstat -ntlp
    =>check the ubuntu version 
    lsb_release -a

    Uninstall all components using single command

    sudo apt-get purge jigasi jitsi-meet jitsi-meet-web-config jitsi-meet-prosody jitsi-meet-turnserver jitsi-meet-web jicofo jitsi-videobridge2