The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,806 other followers

Archive for the ‘Linux’ Category

Zypper: list info on all patterns, so you can find out which pattern provides a package

Posted by jpluimers on 2022/05/11

I wanted to know which pattern provides [WayBack] etckeeper which is in the [WayBack] openSUSE Software package etckeeper.

It seems no built-in search query can do that, so I built one my own.

Since the result takes quite a while to produce, the output is a pattern.txt that you can manually search.

This is the command:

zypper search -t pattern | grep "|" | tail -n +2 | perl -pe 's/^.*? \| //' | perl -pe 's/ *\| .*$//' | xargs -I {} sh -c "zypper info -t pattern {}" > patterns.txt

The content is like this (the 2017 date shows I wrote this a long time ago):

Read the rest of this entry »

Posted in Software Development, Development, Power User, *nix, Scripting, Linux, Perl, bash, *nix-tools, bash, sed, etckeeper | Leave a Comment »

Bash functions to encode and decode the ‘Basic’ HTTP Authentication Scheme

Posted by jpluimers on 2022/02/24

IoT devices still often use the ‘Basic’ HTTP Authentication Scheme for authorisation, see [Wayback] RFC7617: The ‘Basic’ HTTP Authentication Scheme (RFC ) and [Wayback] RFC2617: HTTP Authentication: Basic and Digest Access Authentication (RFC ).

Often this authentication is used even over http instead of over https, for instance the Egardia/Woonveilig alarm devices I wrote about yesterday at  Egardia/Woonveilig: some notes about logging on a local gateway to see more detailed information on the security system. This is contrary to guidance in:

  • RFC7617:
       This scheme is not considered to be a secure method of user
       authentication unless used in conjunction with some external secure
       system such as TLS (Transport Layer Security, [RFC5246]), as the
       user-id and password are passed over the network as cleartext.
  • RFC2617:
       "HTTP/1.0", includes the specification for a Basic Access
       Authentication scheme. This scheme is not considered to be a secure
       method of user authentication (unless used in conjunction with some
       external secure system such as SSL [5]), as the user name and
       password are passed over the network as cleartext.

Fiddling with those alarm devices, I wrote these two little bash functions (with a few notes) that work both on MacOS and in Linux:

# `base64 --decode` is platform neutral (as MacOS uses `-D` and Linux uses `-d`)
# `$1` is the encoded username:password
function decode_http_Basic_Authorization(){
  echo $1 | base64 --decode
  echo
}

# `base64` without parameters encodes
# `echo -n` does not output a new-line
# `$1` is the username; `$2` is the password
function encode_http_Basic_Authorization(){
  echo $1:$2 | base64
}

The first decodes the <credentials> from a Authorization: Basic <credentials> header into a username:password clean text followed by a newline.

The second one encodes a pair of username and password parameters into such a <credentials> string.

They are based on these initial posts that were not cross platform or explanatory:

  1. [Wayback] Decode HTTP Basic Access Authentication – Stack Pointer
  2. [Wayback] Create Authorization Basic Header | MJ’s Web Log

–jeroen

Posted in *nix, *nix-tools, Apple, Authentication, bash, bash, Communications Development, Development, HTTP, Internet protocol suite, Linux, Mac OS X / OS X / MacOS, Power User, Scripting, Security, Software Development, TCP, Web Development | Leave a Comment »

Viewing the last lines of the postfix log with journalctl (with help from Unix & Linux Stack Exchange)

Posted by jpluimers on 2022/02/24

Two command-lines I use to view my Postfix logs:

  1. journalctl --unit postfix --since "2 days ago"
  2. journalctl --unit postfix --pager-end

Note that neither of these work well with the --follow (or equivalent -f) option, as this will effectively disable the pager (which by default is less).

The second is via [Wayback] systemd – How to see the latest x lines from systemctl service log – Unix & Linux Stack Exchange (which got the--pagerend bit wrong, as it misses a dash and should be --pager-end, but still thanks [Wayback] Daniel Kmak):

Just:

journalctl -u SERVICE_NAME -e

Parameter -e stands for:

-e –pagerend

That’s the one ! Other answers will go through the whole log to get to its end, which can be veeeeery long for large syslogs.

The last bit (by [Wayback] Léo Germond, thanks!) is why I like it most.

Similarly, specifying --since in the first example will not go through the whole log.

Some background information:

Read the rest of this entry »

Posted in *nix, *nix-tools, bash, Development, journalctl and journald, Linux, postfix, Power User, Scripting, Software Development, systemd | Leave a Comment »

Creating a bootable USB installer for ESXi on other operating systems than Windows

Posted by jpluimers on 2022/02/17

I wrote about Creating a bootable USB installer for ESXi and use it to create a bootable ESXi installation.

Just in case I ever need to do this on a non-Windows system, some links:

–jeroen

Posted in Power User, *nix, VMware, Apple, Windows, VMware ESXi, Mac OS X / OS X / MacOS, Linux, Virtualization, ESXi6, ESXi6.5, ESXi6.7, ESXi7 | Leave a Comment »

rsync backup of your ESXi box: How to make a statically linked rsync binary

Posted by jpluimers on 2022/02/09

As promised mid last year in “fixing” ESXi “rsync error: error allocating core memory buffers (code 22) at util2.c(106) [sender=3.1.2]”, I would follow up on building a static rsync for ESXi one day.

So below a few links on how to do this, roughly in the order I found them (most via [Wayback] vmware rsync “3.1.2” static – Google Search):

Boy I forgot how long ago CentOS 3.9 was: [Wayback] [CentOS-announce] CentOS 3.9 is released for i386 and x86_64

Johnny Hughes johnny at centos.org
Thu Jul 26 23:14:02 UTC 2007


The CentOS development team is please to announce the release of CentOS
3.9 for i386 and x86_64.

This is the final minor release for CentOS-3. With this release CentOS-3
has entered its maintenance phase during which time only fixes for
critical functional and security issues will be provided.

CentOS 3.9 is available on all mirrors and via bittorrent.

This release corresponds to the upstream vendor U9 release together with
updates through July 3rd 2007 (depending on architecture).

The serverCD version (1 cdrom) is available for i386 and x86_64.

The work for the other arches is still in progress.

To get CentOS 3.9, use one of these archives (I saved all in the Wayback machine as I know how short downloads can last):

There are actually very few places that still have CentOS-3.9-i386-binDVD.iso on-line. The only place I could find was [Wayback] Index of /operating_system/unix/centos/3.9

[ICO] Name Last modified Size Description

[PARENTDIR] Parent Directory
[TXT] [Wayback] CentOS-3.9-i386-CHECKSUM.txt 2012-10-02 20:09 308
[ ] [Wayback] CentOS-3.9-i386-binDVD.iso 2012-10-02 20:29 1.7G
[ ] [Wayback] CentOS-3.9-server-i386.iso 2012-10-02 20:12 680M
[ ] [Wayback] CentOS-3.9-server-x86_64.iso 2012-10-02 20:14 625M
[TXT] [Wayback] CentOS-3.9-x86_64-CHECKSUM.txt 2012-10-02 20:22 445
[ ] [Wayback] CentOS-3.9-x86_64-binDVD.iso 2012-11-28 23:08 1.9G

–jeroen

Posted in *nix, *nix-tools, CentOS, Development, Linux, Power User, RedHat, Software Development | Leave a Comment »

 
%d bloggers like this: