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).
The famous ISP-style mail server tutorials live here. Learn how to set up your own fully-functional mail server using Postfix, Dovecot IMAP/POP3 and MySQL backend on a Debian server just like your favorite mail or website hosting provider.
I have been maintaining the ISPmail tutorial since Debian Woody. However those older Debian versions are no longer supported. If you still like to read the old versions I have provided PDF versions of the tutorials for Squeeze, Lenny, Etch, Sarge andWoody.
Thoughts blog
My daily work leads to various discoveries and insights. Some were petty but others really brightened my day.
I am a system administrator and programmer. In my nerdy spare time I work on web applications, Python and Ruby programs, write articles or explore new software technologies. On workaround.org you can find news, solutions and hints on my findings and get help. Of course your feedback is welcome.
These are some projects I am currently working on:
IRC is a great medium for getting instant help (at least on the freenode IRC network). I have collected some tips about Getting help on IRC to help you get help instead of getting barbecued.
knoba’s factoids
I run a bot called knoba (short for knowledge base) on the freenode IRC network. Two channels I visit frequently are #postfix and #squid. So I have fed the bot with lots of factoids that you can query using !foobar in the channel. These are the factoids understood in #squid and #postfix. Please don’t play with the bot publicly. Send it a “/msg knoba help" and learn how it works.
Linux tips
My daily work leads to various discoveries and insights. Some were petty but others really brightened my day.
Squid is a powerful open-source web proxy. I was responsible for a large Squid installation at a former employer. Maybe the following articles help you save time in your daily work.
Padrino is an lean Ruby web framework. It is an interesting alternative to the heavier Ruby-on-Rails. I spent quite some time with it and created a couple of articles about it:
Zabbix is a mighty open-source monitoring software. If you need a serious system for your organisation and manage to condone its creepy web interface it is hands down the the most superior software I have ever seen. And I have been dealing with monitoring software since Nagios was called Netsaint.
These articles should help you in your daily work maintaining a monitoring system: