Archive for the ‘Power User’ Category
Posted by jpluimers on 2017/09/21
Interesting piece: Don’t Use Regular Expressions To Parse IP Addresses! [WayBack]
TL;DR:
When have neither then for quad-dotted decimal IPv4 addresses (ignoring for instance octals and grouped quads), this is suitable: regex – Regular expression to match DNS hostname or IP Address? – Stack Overflow [WayBack]
ValidIpAddressRegex = "^(([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])$";
Which explained looks like this:
https://regex101.com/r/Wyr2Zd/1
Regular expression:
/ ^(([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)
–jeroen
Posted in *nix, Communications Development, Development, Internet protocol suite, Network-and-equipment, Power User, Software Development, TCP | Leave a Comment »
Posted by jpluimers on 2017/09/21
Reminder to self as it would be useful to have these Mikrotik functions in the new function syntax:
–jeroen
Posted in Internet, MikroTik, Power User, routers | Leave a Comment »
Posted by jpluimers on 2017/09/15
I totally missed this announcement 2 months ago:
after this update, zypper dup will default to –no-allow-vendor-change, whichhas been the recommended way for Tumbleweed for a long time now.
Source: Re: [opensuse-factory] dup –no-allow-vendor-change is now default
So Dominique was glad to “rub the salt” a bit (:
[WayBack/Archive.is] Dominique / DimStar @DimStar Replying to @sysrich @jpluimers: for the record: –no-allow-vendor-change has become the default in Tumbleweed, see also http://dominique.leuenberger.net/blog/2017/06/review-of-the-week-201726/
It was documented at least on these places:
- [Archive.is] Review of the week 2017/26 – Dominique a.k.a. DimStar (Dim*):
libzypp: change of default setting for ‘allow vendor change to false’ during zypper dup (just a change in the default shipped zypp.conf file)
- [WayBack] openSUSE News: Tumbleweed Snapshots Update AppStream, Mesa, Frameworks – July 13th, 2017 by Douglas DeMaioThe 20170708 snapshot had a big change to
libzypp 16.13.0. The new version update 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, according to an email post on the openSUSE Factory Mailing List from Dominique Leuenberger. That is if the user did not change /etc/zypp/zypp.conf -.
- [WayBack] [opensuse-factory] New Tumbleweed snapshot 20170708 released!
– Adjust zypp.conf for openSUSE Tumbleweed (bsc#1031756)
- [WayBack] Re: [opensuse-factory] dup –no-allow-vendor-change is now default
– 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.
–jeroen
Read the rest of this entry »
Posted in *nix, Linux, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »
Posted by jpluimers on 2017/09/14
Some inspiration for writing a proper bookmarklet that finds or saves a WayBack machine page:
On the last link, I was hoping that the https://web.archive.org/liveweb/https://www.example.org would work but it doesn’t work for many URLs and I’m not sure yet why that is.
It has a nice tip that works though:
Read the rest of this entry »
Posted in Bookmarklet, Conference Topics, Conferences, Development, Event, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers | Leave a Comment »
Posted by jpluimers on 2017/09/14
Just in case someone has a better alternative than youtube-dl alias:
alias youtube-dl-audio-and-video='youtube-dl --keep-video --extract-audio --audio-quality 0 --audio-format mp3'
It extracts the audio and keeps the video.
The result is that also all intermediate downloads are being kept.
So even after studying the README extensively the only alternative seems to be a double download like this:
youtube-dl-audio-and-video() { youtube-dl --extract-audio --audio-quality 0 --audio-format mp3 $1; youtube-dl $1; }
–jeroen
Posted in *nix, *nix-tools, bash, bash, Development, Power User, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2017/09/13
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.
Permission to access 'http://download.opensuse.org/ports/aarch64/tumbleweed/repo/oss/suse/setup/descr/appdata-icons.tar.gz' denied.
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.
I got there as the search for “Permission to access ‘http://download.opensuse.org/ports/aarch64/” got me to [WayBack] TUMBLEWEED Zypper Permission to access:
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).
–jeroen
Read the rest of this entry »
Posted in *nix, Linux, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »