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 1,862 other subscribers

Archive for the ‘*nix’ Category

bash + sed: quadruple backslash for proper escaping within an alias

Posted by jpluimers on 2020/06/09

This is part of a bash alias where I had to use quadruple backslash in order to escape it for sed:

# The sed with quad //// is to prevent 'unterminated substitute in regular expression':
alias x='... | sed "s/=.*/ \\\\/"'

This is needed because bash will escape \\\\ into \\ which sed then escapes to \.

The easiest way to find this is to replace the sed with echo to see the expansion.

References:

–jeroen

Posted in *nix, *nix-tools, bash, bash, Development, Power User, Scripting, sed, Software Development | 2 Comments »

GitHub – gpakosz/.tmux: Oh My Tmux! My pretty + versatile tmux configuration that just works (imho the best tmux configuration)

Posted by jpluimers on 2020/06/08

On my list of things to try some dotfiles including [WayBackGitHub – gpakosz/.tmux: Oh My Tmux! My pretty + versatile tmux configuration that just works (imho the best tmux configuration).

–jeroen

Posted in *nix, *nix-tools, Power User, tmux | Leave a Comment »

Good read for starting to intermediate ssh users is “SSH Essentials: Working with SSH Servers, Clients, and Keys | DigitalOcean” and pointers to more advanced reading material

Posted by jpluimers on 2020/06/08

For a really nice overview of most basic and intermediate usage of ssh, read [WayBackSSH Essentials: Working with SSH Servers, Clients, and Keys | DigitalOcean.

It is large (printed to PDF it is 30+ pages in either A4 or Letter format) but well worth reading as it covers a lot in manageable bits.

Does it mean I won’t write about ssh again?

I will continue, as most of my blog posts are relatively short highlighting a small thing at a time (that is how I learn best, hopefully some of you do as well).

It does not explain really advanced stuff (like ProxyCommand), so here is a start of things I want to learn more about:

–jeroen

Posted in *nix, *nix-tools, Power User, ssh/sshd | Leave a Comment »

Cursor Movement in bash: either echo escape sequences or use tput

Posted by jpluimers on 2020/06/03

I read [WayBackCursor Movement earlier than [WayBack] Colours and Cursor Movement With tput and [WayBack] The Floating Clock Prompt.

So in one of my scripts I’ve now used an escape sequence, but I might change it to tput in a future version:

## Move one line up, then write finished scripts:
echo -e "\033[1A$finished\r"

I would probably have started with put if I had read [WayBack] bash – Set or change vertical position of the cursor – Stack Overflow first.

–jeroen

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

How do I delete a Bash function? – Stack Overflow

Posted by jpluimers on 2020/06/02

I hardly do this, so I tend to forget that unset -f functionname deletes a function and unset variablename or unset -v variablename deletes a variable.

From:

I have done this:bash $ z() { echo ‘hello world’; }How do I get rid of it?

Source: [WayBackHow do I delete a Bash function? – Stack Overflow

Reference: [WayBack] unset Man Page – Bash – SS64.com

–jeroen

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

Force NTP Time Update on Linux | KrazyWorks

Posted by jpluimers on 2020/06/01

A while ago, I had a problem that one of my Raspberry Pi machines hadn’t been turned on for a while, so after a reboot the clock was way off.

This resulted in errors like the below: SEC_ERROR_OCSP_FUTURE_RESPONSE errors indicating the TLS certificates being not yet valid (and numerous other TLS certificate issues).

The /etc/ntp.conf was OK, and rcntpd status indicated the service was running. Looking at /var/log/ntp.log I saw a few syncing issues:

11 Feb 20:04:15 ntpd[1419]: receive: Unexpected origin timestamp 0xde15bc7f.59622c55 does not match aorg 0000000000.00000000 from server@93.94.224.67 xmt 0xde2b122f.0d222048
11 Feb 20:04:15 ntpd[1419]: receive: Unexpected origin timestamp 0xde15bc7f.595fec0e does not match aorg 0000000000.00000000 from server@213.154.236.182 xmt 0xde2b122f.0dc06af7
11 Feb 20:04:15 ntpd[1419]: receive: Unexpected origin timestamp 0xde15bc7f.595d4584 does not match aorg 0000000000.00000000 from server@149.210.199.182 xmt 0xde2b122f.0df70400

My guess was that the time was so much of (more than a month) that syncing would not work, so a manual force was needed.

[Archive.is] Force NTP Time Update on Linux | KrazyWorks provides two solutions:

sntp -r pool.ntp.org
# or
ntpdate -u pool.ntp.org

Only the last one works; I’m not sure why yet:

daisy:/etc # ntpdate -u pool.ntp.org
15 Mar 19:20:59 ntpdate[2516]: step time server 131.211.8.244 offset 4140423.716209 sec

Further reading:

–jeroen

SEC_ERROR_OCSP_FUTURE_RESPONSE

SEC_ERROR_OCSP_FUTURE_RESPONSE

Posted in *nix, *nix-tools, ntpdate, Power User | Leave a Comment »

Remote Desktop Auto Login Powershell Script · GitHub

Posted by jpluimers on 2020/05/29

Interesting: some PowerShell scripts that pipe a user and password through cmdkey.exe /generic:TERMSRV/$Computer /user:$User /pass:$Pass

–jeroen

Posted in *nix, Development, Linux, Power User, Software Development | Leave a Comment »

rrdtool: MRTG next level graphing | Syed Jahanzaib Personal Blog to Share Knowledge !

Posted by jpluimers on 2020/05/29

Even though the below link is to a draft post, it sill provides quite some guidance on how to use RRD graphs in an MRTG environment.

[WayBack] rrdtool: MRTG next level graphing | Syed Jahanzaib Personal Blog to Share Knowledge !

–jeroen

DRAFT VERSION: This is incomplete Post ! Some points may be missing, I will update them later .. We all know what is MRTG. You can graph so many information including temperature humidity, speed, v…

 

Posted in *nix, *nix-tools, Power User | Leave a Comment »

Getting rid of Docker plain text credentials – Hacker Noon

Posted by jpluimers on 2020/05/29

For my research list: [WayBack] Getting rid of Docker plain text credentials – Hacker Noon

Repository at [WayBack] GitHub – docker/docker-credential-helpers

–jeroen

Posted in *nix, *nix-tools, Cloud, Containers, Docker, Infrastructure, Power User | Leave a Comment »

GitHub – dschmenk/apple2pi: Apple II client/server for Raspberry Pi

Posted by jpluimers on 2020/05/28

[WayBack] GitHub – dschmenk/apple2pi: Apple II client/server for Raspberry Pi: hybrid computer of a Raspberry Pi inside an Apple II (either ][, or ][+, or //e) so the Apple II can be a front-end to the Raspberry Pi which then can run an Apple IIGS emulator, talk to the Apple II storage hardware and much more.

It can run [WayBack] RASPPLE II: A2CLOUD, A2SERVER, Apple II Pi for Raspberry Pi

Lot’s of videos below, all by David Schmenk https://www.youtube.com/user/dschmenk/videos

Via:

–jeroen

 

 

Posted in *nix, *nix-tools, //e, 6502, Apple, Apple ][, Development, Hardware Development, Hardware Interfacing, History, Power User, Raspberry Pi, USB | Leave a Comment »