Regex Between Two Strings

cat mobile_errors.txt.txt | grep -o -P '(?<=returned for booking ).*(?= with error code)' | sort | uniq > mobile_error_bookings.txt

The magic of this search is here:

grep -o -P '(?<=beginning string with space at end ).*(?= ending string with space at start of it)

RegEx

Visual Studo Code Tricks

Remove Blank Lines

Search for:

^(?:[\t ]*(?:\r?\n|\r))+

Replace with NOTHING.

Update Canon G7020 Firmware

G7020 printer issue - "The latest firmware is on the server. Install the firmware update" message

I see the constant message "The latest firmware is on the server. Install the firmware update" on the printer's screen. If I am pressing OK, the message is dissaperaing, but in an hour or two I can see it again. A cannot update firmware as official Canon servers do not contain any firmware versions

To update the firmware, please follow these steps:

  • Press the wrench and screwdriver button 1 time
  • Press the right arrow 2 times to select Device settings and press OK
  • Press the right arrow 5 times to select Firmware update and press OK
  • Press OK on Install update

Refer: https://community.usa.canon.com/t5/Desktop-Inkjet-Printers/G7020-printer-issue-quot-The-latest-firmware-is-on-the-server/td-p/342675

Disable IPv6 from the command line on a Macbook

Run a command through the Terminal app:

  • Open Launchpad.
  • Search for Terminal.
  • Click on the Terminal.app.
  • If your active network is WiFi enter the following command:
networksetup -setv6off Wi-Fi
  • If you are on Ethernet:
networksetup -setv6off Ethernet

To re-enable IPv6, you need to replace setv6off to setv6automatic for Wi-Fi or Ethernet:

networksetup -setv6automatic Wi-Fi 
networksetup -setv6automatic Ethernet