No protocol specified: Unknown Error couldn't connect to display ":0"

76

I only used xhost + then ran sudo ./manager-linux-x64.run and it came up for me.

Share:
76

Related videos on Youtube

Andrew Benavides
Author by

Andrew Benavides

Updated on September 18, 2022

Comments

  • Andrew Benavides
    Andrew Benavides almost 2 years

    I have a file that is a 10000 line perl variable. This variable defines apps and their given dependencies. here is what that file looks like:

    'im-an-app' =>
    {    
        do-this =>
        {    
            needs => [ 'ruby', 'jboss', 'jquery' ],
            process =>
            [    
                { say => 'hi' },
                { speak => 'loudly' },
                { read => 'qucikly' },
            ],
        },
    },
    
    'im-an-app2' =>
    {
        do-this =>
        {
            needs => [ 'ruby' ], # there is a comment here
        },
    },
    
    'im-an-app3' =>
    {
        needs =>
        {
            requires => [ 'ruby', 'jboss', 'jquery', 'sass' ],
            process =>
            [
                { say => 'hi' },
                { speak => 'loudly' },
                { read => 'quickly' },
            ],
        },
    },
    

    I have a list of the apps i'd like to remove from the file in a seperate list.txt file that looks like:

    im-an-app1
    im-an-app3
    im-an-app16
    im-an-app17
    im-an-app29
    

    These apps are all different names and i'm using placeholders, I have about 500 i need to iterate over, match, and remove from my app file.

    I've loaded the file IRB and when i read the file I get output in a format like this:

    instances\n\t##\n\n\t'im-an-app' =>\n\t{\n\t\tdo-this =>\n\t\t{\n\t\t\tneeds => [ 'ham-and-cheese-sandwich' ],\n\t\t},\n\t},\n\n\t'im-the-next-app' =>\n\t{\n\t\tneeds =>\n\t\t{\n\t\t\t# im a comment about this app\n\t\t\t# im another comment\n\t\t\tneeds => [ 'backlava', 'cand-corns', 'popscicles', 'yum-yum-bars', 'the-bomb-sauce', 'corndogs' ],\n\t\t\tdo-this =>\n\t\t\t[\n\t\t\t\t{ say => 'hi' },\n\t\t\t\t{ say => 'bye' },\n\t\t\t\t{ yell => 'i-love-gold' },\n\t\t\t],\n\t\t},\n\t},\n\n\t'im-the-third-app' =>\n\t{\n\t\tdothis =>\n\t\t{\n\t\t\tneeds => [ 'junk', 'jazz', 'json', 'jiffylube ],\n\t\t\tprocess =>\n\t\t\t[\n\t\t\t\t{ say => 'hi' },\n\t\t\t\t{ say => 'bye' },\n\t\t\t\t{ say => 'goonies' },\n\t\t\t],\n\t\t},\n\t},\n\n\t'im-yet-anotherapp'

    I have noticed that the only constant delimiter is a \n\n\t that exists only before the definition of the new app. I'd like to search through the read file, delete the reference to each application in my list and all of its subsequent information up to and including the \n\n\t.

    I'm using Ruby and IRB to do this but I'm open to using other forms of manipulation.

    Thanks guys!

    • PM 2Ring
      PM 2Ring over 8 years
      Tool recommendations are off-topic for SO. You'll get a much better response to your question if you make an attempt at coding the solution yourself and paste your code into your question.
    • Hastur
      Hastur over 7 years
      Maybe you mean xhost + instead of xauth +? Note that ~ is expanded in the home directory... so it depends on how you gain root.
    • DarkCoffee
      DarkCoffee over 7 years
      Thank you for your comment. I've tried both. Also with "xhost + root" I don't get any results. When I write "xhost + root" with the root user I get the error, meanwhile when I write it with the user I get "root being added to access control list", but nothing happen
    • Hastur
      Hastur over 7 years
      Comment from one answer of your link: xhost + does work as a temporary measure before going in as sudo. Try this: open a terminal, write xhost +, gain the root access su -, try to run a graphic program (e.g. xlogo)... Sorry I've to go.
    • DarkCoffee
      DarkCoffee over 7 years
      Wow! It worked! Can you explain to me the meaning of the operations? Thank you!
    • DarkCoffee
      DarkCoffee over 7 years
      I've restarted the pc and still the same problem as before. Is there a command to keep the configuration?
  • Andrew Benavides
    Andrew Benavides over 8 years
    This is the exact behavior I'm looking for, but i've tried the awk command and it just prints out my apps file. Your second awk command looks to be the same as the first one listed.
  • jas
    jas over 8 years
    Yes, the second is the same as the first. It was only to show the command "in action". If you edit your question to include sample data from both the apps file and the list-of-apps file, with four or five complete apps, I'm sure we can work it out. Note that my list-of-apps file includes the single-quotes around the app names. Does yours?
  • Andrew Benavides
    Andrew Benavides over 8 years
    Wow! I think that solved it!! awk is super fast also! Can you break this down this command for me so I can leverage this in the future?