Jump to content

gulshan212

Members
  • Content Count

    8
  • Joined

  • Last visited

Posts posted by gulshan212


  1. Updating kernel on a linux system require additional storage in the /boot partition. Here are some options to address the issues.

    1. Check available space

    2. Remoce old kernels

    3. Clean package cache

    4. Install new kernel

    5. Reboot 

    Hope it will help you to ger what you are looking for.

    Thanks


  2. Well, if SSH is not  working in linux system then there are some steps that you can follow to resolve this issue.

    1. Check SSH serice status

    2. Check SSH port

    3. Check SSH configuration

    4. Check SSH logs

    5. Check disk space

    6. Check network connectivity

    Thanks 


  3. Well, I search about it and found this code that may help you to do what you are looking for.

    Quote

     

    import netifaces
    from configobj import ConfigObj

    def change_ip_address(interface_name, new_ip, new_subnet, new_gateway):
        iface = netifaces.ifaddresses(interface_name)
        current_ip = iface[netifaces.AF_INET][0]['addr']
        current_subnet = iface[netifaces.AF_INET][0]['netmask']

        config = ConfigObj('/etc/NetworkManager/system-connections/Wired Ethernet1.nmconnection', encoding='utf8')
        config['ipv4']['address1'] = f"{new_ip}/{new_subnet}"
        config['ipv4']['gateway'] = new_gateway
        config.write()

        print(f"IP address for {interface_name} changed from {current_ip}/{current_subnet} to {new_ip}/{new_subnet}")

    interface_name = 'eth0'
    new_ip = '192.168.1.220'
    new_subnet = '24'
    new_gateway = '192.168.1.1'

    change_ip_address(interface_name, new_ip, new_subnet, new_gateway)

     

    Quote

     


     

    Thanks


  4. Hello this is Gulshan Negi

    Well, I am writing a program for making Hangman game in python but it shows some error at the time of its execution.

    Here is my source code:

    import random
    def select_word():
        words_in_computer_memory = ['magazine','stars','computer','python','organisation']
        word = random.choice(words_in_computer_memory)
        return word
    def is_gussed(word, guessed_letter_list):
        count=0
        for letters in word:
            if letters in guessed_letter_list:
                count+=1
        if count==len(word):
            return True
        else:
            return False
    def guessed_word(word, guessed_letter_list): 
        string=""
        for key in word:
            if key in guessed_letter_list:
                string+=key
            else:
                string+="_ "
        return string
    def available_letters(guessed_letter_list):
      
        string=""
        count=0
        s='abcdefghijklmnopqrstuvwxyz'
        for letter in s:
            if letter in guessed_letter_list:
                count+=1
            else:
                string+=letter
        return string
    def hangman_game(word):  
        length=len(word)
        print('''------------------WELCOME TO HANGMAN GAME---------------------------
                                        O   
                                       /|\  
                                       / \  
            ''')
        print("The word you have to guess is of ",length, "letters long.")
        chances=2*len(word)
        i=0:
        guessed_letter_list=[]
        while (chances!=0):     
    
            if word!=guessed_word(word, guessed_letter_list):
                print("You Got", chances, "Chances.")
                print("Letters you can enter should be from these ",available_letters(guessed_letter_list))
                guess=input("ENTER A LETTER ")
                print('\n'*50)
    
                guessInLowerCase = guess[0].lower()      
                if guessInLowerCase  in guessed_letter_list:
                    print("SORRY! YOU HAVE GUSSED THIS LETTER ALREADY! ",guessed_word(word, guessed_letter_list))
                elif guessInLowerCase not in word: 
                    print(" SORRY! THE LETTER IS NOT IN WORD",guessed_word(word, guessed_letter_list))
                    chances-=1
                else:
                    guessed_letter_list.append(guessInLowerCase)
                    print("NICE YOU GUSESSED THE RIGHT LETTER! ",guessed_word(word, guessed_letter_list))
               
            elif word==guessed_word(word, guessed_letter_list):
                print("YOU WON!")
                break
    
        else:
            print('''
            ********************************************
       YOU LOSS!!
                                     O 
                                    /|\  
                                    / \  
         ******************************************''')
            print('The word was',word,)
    
    word = select_word()
    hangman_game(word)

    Can anyone give their suggestions on this.

    Thanks  

     


  5. Hello this is Gulshan Negi

    Well, I did a search about your problem and in my opinion to resolve this issue you can follow the steps below: 

    1. You need to check loaded kernel module.

    2. You need to verify network interfaces.

    3. You need to restart network manager.

    Well, anyone step from above can help you to resolve your problem.

    Thanks


  6. Hello this is Gulshan Negi

    Well, to resolve this issue you can follow below steps:

    1. Check if the SSD is detected by the system.

    2. Check if the bootloader is configured to boot from the SSD.

    I hope it can help you.

    Thanks


  7. Hello this is Gulshan Negi

    Well, there are n numbers of Online Linux Terminals to do this, some of which are listed below: 

    1. GNOME Terminal
    2. Konsole
    3. Terminator
    4. Tilix
    5. Xterm

    Thanks 

×
×
  • Create New...