Expand/transform an URL which is inside a credential accessed site
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The quota here will be quickly filled, if i start using it.
That's not supported by the evidence.
You've only included/mentioned imgbox in 27 posts in the past four years, and your average image size is almost certainly below 100KB - despite your lack of concern over size - so at that rate it'd be at least a couple of decades before you needed to worry about filling the quota.
In any case, it's your choice how you provide the code, just keep in mind that posting (a) screenshots of code and (b) via a third-party service both reduce the number of people willing to even consider helping.
You can always do the manual bit of putting the code tags on separate lines above and below the quoted text. On some sites the code block is displayed differently when the tags are on the same line as the text vs when they are not.
I agree about the empty line after the enclosed text within the code box, but since it is not actually an issue other than to certain persons perception I ignore that and continue.
The code tags maintain formatting in the way the text was pasted in, so it is not needed to manually try to guess how the reader will see the posted data.
Last edited by computersavvy; 08-02-2021 at 11:50 AM.
In any case, it's your choice how you provide the code, just keep in mind that posting (a) screenshots of code and (b) via a third-party service both reduce the number of people willing to even consider helping.
I do not use imgbox just with LQ.
And i never posted code with an image. This was a misinterpretation of what i originally wrote in the my first (or second) post here).
You can always do the manual bit of putting the code tags on separate lines above and below the quoted text.
It takes more complex operations and, thus, it is annoying.
Quote:
Originally Posted by computersavvy
On some sites the code block is displayed differently when the tags are on the same line as the text vs when they are not.
LQ is not "some sites". LQ has its own code, and can have a good feature if compared with them.
Quote:
Originally Posted by computersavvy
I agree about the empty line after the enclosed text within the code box, but since it is not actually an issue other than to certain persons perception I ignore that and continue.
It is something that looks so simple to fix, that it is even strange that it could never be done in (probably) more than a decade of existence of LQ.
Quote:
Originally Posted by computersavvy
The code tags maintain formatting in the way the text was pasted in, so it is not needed to manually try to guess how the reader will see the posted data.
You are wrong. The code tags do *not* wrap the code to the window width, like our text editors do. For code, the width is usually kept, but it is commonly wider than what is more confortable to read in the LQ pages, in my opinion. Further, when we use code tags to enclose the output of programs, the lines WILL BE, much commonly, really long. It does not affect what we see in terminals, they wrap long lines to their screen width - but it affects how LQ displays that output, if we copy it. In a simple sentence, LQ is disappointing for displaying command output. So, what i did was a manual work to make all those lines of output easily readable by every person who wanted to help me with this issue. I spent a couple of hours doing it because the output of wget is complicated with lines; and also because the way vim reformat lines considers a single "paragraph" a group of short lines without empty lines between them, and join them all in a single long line and, after that, splits them to the chosen width... it is horrible. I did not find a clear solution to what i needed in vim, but (after i gave up) i solved it fairly quickly by adding a lot of empty lines to separate the false paragraphs. The result is pretty good, in my opinion. I can quickly read and understand all those 259 lines of output i putted in #3.
It takes more complex operations and, thus, it is annoying.
You are wrong. The code tags do *not* wrap the code to the window width, like our text editors do. For code, the width is usually kept, but it is commonly wider than what is more confortable to read in the LQ pages, in my opinion. Further, when we use code tags to enclose the output of programs, the lines WILL BE, much commonly, really long. It does not affect what we see in terminals, they wrap long lines to their screen width - but it affects how LQ displays that output, if we copy it. In a simple sentence, LQ is disappointing for displaying command output. So, what i did was a manual work to make all those lines of output easily readable by every person who wanted to help me with this issue. I spent a couple of hours doing it because the output of wget is complicated with lines; and also because the way vim reformat lines considers a single "paragraph" a group of short lines without empty lines between them, and join them all in a single long line and, after that, splits them to the chosen width... it is horrible. I did not find a clear solution to what i needed in vim, but (after i gave up) i solved it fairly quickly by adding a lot of empty lines to separate the false paragraphs. The result is pretty good, in my opinion. I can quickly read and understand all those 259 lines of output i putted in #3.
I did not say it wrapped the lines. What I said was that it maintained the format seen on the terminal. If the terminal emulator wraps the lines to display width then that is different than the display in a virtual terminal which acts almost identical to the old physical dumb terminals, and long lines are not wrapped. Copy & Paste do not change the actual (physical) formatting, and the code block puts scroll bars where needed.
What you may prefer is not what should be.
For example, the output of the inxi command has what are basically stanzas, some lines of which are long, some are indented, some have a lot of white space.
Using a code block maintains the display as seen on the terminal while not using the code block scrunches everything into single white space caracters and eliminates the stanza formatting. Even the free command benefits from a code block as this shows
$ free
total used free shared buff/cache available
Mem: 32785232 4460616 1020808 58772 27303808 27790352
Swap: 8388604 512 8388092
Code:
$ free
total used free shared buff/cache available
Mem: 32785232 4460616 1020808 58772 27303808 27790352
Swap: 8388604 512 8388092
The exact same data without the code block and with the code block. It is tremendously obvious that the code block maintains readability while without it the data is almost indecipherable.
The obvious conclusion here is that what you deem "pretty" can quickly become difficult to interpret since the formatting is not what was seen on the screen when you first ran the command.
Last edited by computersavvy; 08-04-2021 at 11:06 AM.
In my Debian, resetting COLUMNS to 64 (its normal value is 80, in my default terminals) did not make the (pretty!) output of inxi be wrapped to 64 chars. I even tried to adjust it in a few ways. None changed the output.
Code:
COLUMNS=64 inxi -Fxx
COLUMNS=64; inxi -Fxx
set COLUMNS=64; inxi -Fxx
And I still think that a having a "wordwrapable" mono spaced way to write things, instead of simply the hardcore [dode] tag. 'free' output is planned for an 80 columns mono spaced width, so it is not a good example to compare to what i did/pointed here.
Which is better to read? The first, where you have to scroll with the mouse, holding the thin scroll bar button? Giving focus to it with the keyboard is not easy, if it is possible, only with the keyboard (i tried and gave up). Or the second, which we read just scrolling down the page... there is nothing even close to "almost indecipherable" in it. The only thing we could do there is keeping the colors the command use, which are what i called pretty.
In my Debian, resetting COLUMNS to 64 (its normal value is 80, in my default terminals) did not make the (pretty!) output of inxi be wrapped to 64 chars.
Interesting. It works with inxi 3.0.38, but not with inxi 2.3.56. They provide binaries, so you can always try out the latest inxi version:
Format your post in a text editor. Then copy it into the
forum. Make it viewable the way that you wish.
Example:
Code:
man ls | head -n 20
LS(1) User Commands LS(1)
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List information about the FILEs (the current directory
by default). Sort entries alphabetically if none of
-cftuvSUX nor --sort is specified.
Mandatory arguments to long options are mandatory for
short options too.
-a, --all
do not ignore entries starting with .
-A, --almost-all
do not list implied . and
For a really long command line.
Code:
curl -A "$agent" http://www.aaaaaaaaaaaaaaaaaaa\
aaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbb/ccccccccccccc\
cccccccccccc/dddddddddddd/something.html
Or if it is a programming language, then use the syntax
rules of the language.
Python
Code:
a = ('Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) '
'AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 '
'Mobile/14A403 Safari/602.1')
cpp
Code:
#include <iostream>
int main()
{
std::cout << "This is a really long "
<< "or error message that exceeds "
<< "the maximum permitted length, "
<< "or is too long for the editor\n";
return 0;
}
I don't always do that, but you can.
I don't have inxi installed. Let me use
Code:
lspci -k | head -n 20 | fold -w 60
00:00.0 Host bridge: Intel Corporation 4 Series Chipset DRAM
Controller (rev 03)
Subsystem: Dell Device 0400
Kernel modules: intel_agp
00:01.0 PCI bridge: Intel Corporation 4 Series Chipset PCI E
xpress Root Port (rev 03)
Kernel driver in use: pcieport
00:02.0 VGA compatible controller: Intel Corporation 4 Serie
s Chipset Integrated Graphics Controller (rev 03)
Subsystem: Dell Device 0400
Kernel driver in use: i915
Kernel modules: i915
00:02.1 Display controller: Intel Corporation 4 Series Chips
et Integrated Graphics Controller (rev 03)
Subsystem: Dell Device 0400
00:1b.0 Audio device: Intel Corporation NM10/ICH7 Family Hig
h Definition Audio Controller (rev 01)
Subsystem: Dell Device 0400
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel
00:1c.0 PCI bridge: Intel Corporation NM10/ICH7 Family PCI E
xpress Port 1 (rev 01)
Kernel driver in use: pcieport
00:1d.0 USB controller: Intel Corporation NM10/ICH7 Family U
SB UHCI Controller #1 (rev 01)
Subsystem: Dell Device 0400
Kernel driver in use: uhci_hcd
I'm not sure what you are wanting. Why are there spaces in your urls like that?
Code:
#!/usr/bin/python
from http.client import HTTPSConnection
from time import sleep
#Example list, some good, some bad, on purpose.
u = ('/questions/linux-newbie-8/', 'questions/linux-newbie-8/',
'/questions/linux-software-2/', 'questions/linux-software-2/')
url = 'linuxquestions.org'
for i in u:
a = HTTPSConnection(url)
a.request('GET', i)
b = a.getresponse()
print('\n', i)
print(b.status, b.reason)
data = b.read().decode('utf-8', errors='ignore')
a.close()
sleep(2)
Why am i unable to run this code? Even after installing:
Forcing a linux user to use the mouse to see all the output is ugly, stupid and bad.
That's a browser (and screen dimension) issue. In other words, it's a local issue on your side.
Browsers address this specific requirement. Vanilla FF does, but also addons exist, or other browsers that strive to be keyboard friendly.
Anyhow, once again, your overall attitude becomes abundantly clear (from a multitude of comments you made here, not just the quote above): "I want to put in as little effort as possible to get free help with my problem. How much effort others have to put in, incl. the site maintainers, is of no interest to me."
That's a browser (and screen dimension) issue. In other words, it's a local issue on your side.
Yes, but it is a problem that i think is common for all other LQ users, or to most of them. And i think that LQ will be improved, if it eventually changes some "details".
Quote:
Originally Posted by ondoho
Browsers address this specific requirement. Vanilla FF does, but also addons exist, or other browsers that strive to be keyboard friendly.
I use a "vanilla firefox" for that. It is hard and very slow to browse a wide code block with the keyboard.
I never heard about an addon to improve keyboard navigation. I have an addon to choose keys to use for function that already exist. But these are limited.
Quote:
Originally Posted by ondoho
Anyhow, once again, your overall attitude becomes abundantly clear (from a multitude of comments you made here, not just the quote above):
"I want to put in as little effort as possible to get free help with my problem. How much effort others have to put in, incl. the site maintainers, is of no interest to me."
I am not being a lazy person. I search, try and to what i can to do whatever i want to. Only when i am unable to do it, is when i ask for help (here or in a more appropriate forum, eventually, depending on what the issue is).
And if something i ever suggested was hard to do (like the thread for removing the always present extra line in code tags), it should be just said something with the idea: "This is something nice, but hard for me/our-team do." Not even after another user agreed that this should be changed anywthing toward the needed effort was said.
About my efforts. This thread deals with many things that have many sharp points to me. Browser + fullstack project + "what is happening under the hood, from user POV" + how to mimic part of what the browser does + "programming in python (python2 x python3 is far from obvious to me, and the script given to me says -in its header- that it runs in python2, when it does not, as said a few posts below the script)" + "python documentation, which seems to assume i know several details about the language, and i had/have trouble dealing with; but after giving up the first suggestion, i found out that the third suggestion teckk gave me is not a site to suggest things that have no doc yet, as i thought; i just did not try it yet, for a lack of time".
Well, those are a lot of things that many of you here find it easy, it seems. For me, it is not. I can learn, and i have learned many things about several subjects, with the help of the forums here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.