Proxy Authorization Required

48

First off all, change the network settings from manual to automatic and leave the Firefox proxy setting set to manual.

For the terminal to work with your proxy, do the following: Create the following file : /etc/apt/apt.conf, open the terminal and type:

sudo gedit /etc/apt/apt.conf

Edit this file according to your proxy details:

Acquire::http::proxy "http://username:password@yourproxyaddress:proxyport";
Acquire::https::proxy "https://username:password@yourproxyaddress:proxyport";

If your proxy doesn’t require a username, then those statements take the following form: Acquire::http::proxy yourproxyaddress:proxyport";

To be able to add a PPA, you will need to export your proxy settings open the terminal and type:

export https_proxy="https://username:password@yourproxyaddress:proxyport";

export http_proxy="http://username:password@yourproxyaddress:proxyport";

Once you have done this, to export you will need to add a -E after sudo, e.g. sudo -E apt-get install python-software-properties

Share:
48

Related videos on Youtube

UnExpendable
Author by

UnExpendable

Updated on September 18, 2022

Comments

  • UnExpendable
    UnExpendable over 1 year

    I have this thing right now, but the first part is something iffy with because the answer should be 12 because my file have 12 chapters , but i get 2726 as the answer. I also need to make a forth function called:

    analyze_book(filename, chapter_delimiter, word)

    where the task is to use the three other functions to take in a word, calculate how many times that word is in each chapter of the book, and then plot the resaults in a graf where the x-axes is the chapternumber and the y-axes is the amount of times that word is in that chapter. the graf is also going to look like this:

    1. Title of the graf is: Amount of word shows up per chapter in filename
    2. Title x-axis: Chapter
    3. Title y-axis: Amount of word
    4. x-axis goes from 1 to amount of chapters
    5. y-axis goes from 0 to highest amount og times word +3

    As said at the top, def get_chapter is a litte iffy somewhere and i dont know why And i also lack the last function and i have no idea where to go from here.

    def get_chapters(filename,chapter_delimiter):
        lines = None
        
        
        with open(filename,'r') as f:
            lines = f.readlines()
            
        
        num_chapters = 0
        
        
        for line in lines:
            chapters = line.split(chapter_delimiter)
            chapters = [chapter.strip() for chapter in chapters if len(chapter.strip())!=0]
            num_chapters += len(chapters)
        
        return num_chapters
    
    print(get_chapters('alice_in_wonderland.txt', 'CHAPTER'))
    
    
    def count_words(string_list, word):
        counts = []
        for string in string_list:
            count = 0
            for i in range(len(string)):
                if string[i:i + len(word)].lower() == word.lower():
                    count += 1
            counts.append(count)
        return counts
    
    strengliste = ["Takpapp, veggpapp, papp og papir", "Papir, stein, saks og papir"]
    count_words(strengliste, "Papir")
    
    
    def create_number_to(number):
        lst = []
        for i in range(1, number + 1):
            lst.append(i)
        return lst
    print(create_number_to(14)) 
    

    I would appreciate any help i can get

    • UnExpendable
      UnExpendable over 2 years
      The first answer is my code so far
    • Chris Doyle
      Chris Doyle over 2 years
      please just edit your question putting in the code so far and remove it as an answer
  • Community
    Community over 2 years
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.