#creates a new file descriptor 3 that redirects to 1 (STDOUT)
exec 3>&1
# Run curl in a separate command, capturing output of -w "%{http_code}" into HTTP_STATUS
# and sending the content to this command's STDOUT with -o >(cat >&3)
HTTP_STATUS=$(curl -w "%{http_code}" -o >(cat >&3) 'http://example.com')
In this article we will review sed, the well-known stream editor, and share 15 tips to use it in order to accomplish the goals mentioned earlier, and more.
Sort of tanslated from the first “via” (note that “mit Alles und Scharf” is hard to translate; it’s somewhere between “everything but the kitchen sink, but done right” and “right on the money”):
Bash Prompt Overkill: https://github.com/nojhan/liquidprompt is a Bash “Prompt doing it all right”-extension, which doesn’t care how much any feature costs as we have cores, gigabytes and SSD.
Liquid Prompt automagically recognises context and enables a plethora of features in the prompt when needed based on that context.
It’s like pixie dust for your prompt.
You can configure everything, but you don’t have to: the out of the box experience is already like pixie dust for your prompt.
It works on OS X too and is part of homebrew:
$ brew install liquidprompt
==> Using the sandbox
==> Downloading https://github.com/nojhan/liquidprompt/archive/v_1.11.tar.gz
==> Downloading from https://codeload.github.com/nojhan/liquidprompt/tar.gz/v_1.11
######################################################################## 100.0%
==> Caveats
Add the following lines to your bash or zsh config (e.g. ~/.bash_profile):
if [ -f /usr/local/share/liquidprompt ]; then
. /usr/local/share/liquidprompt
fi
If you'd like to reconfigure options, you may do so in ~/.liquidpromptrc.
A sample file you may copy and modify has been installed to
/usr/local/share/liquidpromptrc-dist
Don't modify the PROMPT_COMMAND variable elsewhere in your shell config;
that will break things.
==> Summary
🍺 /usr/local/Cellar/liquidprompt/1.11: 7 files, 125.6K, built in 3 seconds
[jeroenp:~/Versioned] 10s $
I thought my locale issues were solved and they sort of were. Until I had to logon locally and managed to get one or more of these characters in my password:
Then logon would fail locally but work via ssh. Go figure!
Lot’s of people outside the UK using their Raspberry Pi with keyboard and monitor will now say: you’ve the default GB keyboard layout and your keyboard is not GB.
Bingo!
This is how US keys look when using a GB keyboard layout:
As a Linux administrator you’ve got various tools to use in order to configure network connections, such as: nmtui, NetworkManager GUI and nmcli in Linux
/ ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ / g
Explanation:
^ asserts position at start of the string
1st Capturing Group (([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}
{3} Quantifier — Matches exactly 3 times
A repeated capturing group will only capture the last iteration. Put a capturing group around the repeated group to capture all iterations or use a non-capturing group instead if you’re not interested in the data
2nd Capturing Group ([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])
1st Alternative [0-9]
Match a single character present in the list below [0-9] 0-9 a single character in the range between 0 (ASCII 48) and 9 (ASCII 57) (case sensitive)
2nd Alternative [1-9][0-9]
Match a single character present in the list below [1-9] 1-9 a single character in the range between 1 (ASCII 49) and 9 (ASCII 57) (case sensitive)
Match a single character present in the list below [0-9] 0-9 a single character in the range between 0 (ASCII 48) and 9 (ASCII 57) (case sensitive)
3rd Alternative 1[0-9]{2}
1 matches the character 1 literally (case sensitive)
Match a single character present in the list below [0-9]{2} {2} Quantifier — Matches exactly 2 times 0-9 a single character in the range between 0 (ASCII 48) and 9 (ASCII 57) (case sensitive)
4th Alternative 2[0-4][0-9]
2 matches the character 2 literally (case sensitive)
Match a single character present in the list below [0-4] 0-4 a single character in the range between 0 (ASCII 48) and 4 (ASCII 52) (case sensitive)
Match a single character present in the list below [0-9] 0-9 a single character in the range between 0 (ASCII 48) and 9 (ASCII 57) (case sensitive)
5th Alternative 25[0-5]
25 matches the characters 25 literally (case sensitive)
Match a single character present in the list below [0-5] 0-5 a single character in the range between 0 (ASCII 48) and 5 (ASCII 53) (case sensitive)
\. matches the character . literally (case sensitive)
3rd Capturing Group ([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])
1st Alternative [0-9]
Match a single character present in the list below [0-9]
0-9 a single character in the range between 0 (ASCII 48) and 9 (ASCII 57) (case sensitive)
2nd Alternative [1-9][0-9]
Match a single character present in the list below [1-9] 1-9 a single character in the range between 1 (ASCII 49) and 9 (ASCII 57) (case sensitive)
Match a single character present in the list below [0-9] 0-9 a single character in the range between 0 (ASCII 48) and 9 (ASCII 57) (case sensitive)
3rd Alternative 1[0-9]{2}
1 matches the character 1 literally (case sensitive)
Match a single character present in the list below [0-9]{2} {2} Quantifier — Matches exactly 2 times 0-9 a single character in the range between 0 (ASCII 48) and 9 (ASCII 57) (case sensitive)
4th Alternative 2[0-4][0-9]
2 matches the character 2 literally (case sensitive)
Match a single character present in the list below [0-4] 0-4 a single character in the range between 0 (ASCII 48) and 4 (ASCII 52) (case sensitive)
Match a single character present in the list below [0-9] 0-9 a single character in the range between 0 (ASCII 48) and 9 (ASCII 57) (case sensitive)
5th Alternative 25[0-5]
25 matches the characters 25 literally (case sensitive)
Match a single character present in the list below [0-5] 0-5 a single character in the range between 0 (ASCII 48) and 5 (ASCII 53) (case sensitive)
$ asserts position at the end of the string, or before the line terminator right at the end of the string (if any)
Global pattern flags g modifier: global. All matches (don’t return after first match)
– Adjust zypp.conf for openSUSE Tumbleweed (bsc#1031756)
^^^^ This change hides the switch of the default for zypper dup: after
this update, zypper dup will default to –no-allow-vendor-change, which
has been the recommended way for Tumbleweed for a long time now.
NOTE: This will ONLY update your default configuration if you did not
touch /etc/zypp/zypp.conf – If you had local modifications, rpm will
have put a file NEXT to it (zypp.conf.rpmnew), in which case you have
to adjust the settings manually (or you likely already did)
Hope this will eliminate a good part of the issues people kept on
reporting about updates – bringing Tumbleweed one step closer to what
you expect it to do in all situations.
If you see error message like below when performing zypper refresh or zypper dist-upgrade, then please inform the opensuse team (for instance Twitter or the #openSUSE-factory IRC channel) as this is part of the aftermath of the download.opensuse.org trouble that started last week.
What happened to me with Raspberry Pi 3 and Tumbleweed is below and fixed because after I got in touch: the data restore had worked out OK, but the permissions didn’t.
Unfortunately there was a catastrophic issue last week with the openSUSE download system (read: stuff is still broken and not all mirrors are fully functional).