Broken script – January 5, 2020

I got this mail from cron about a script I setup.

I got this mail from cron about a script I setup.

Return-path: <maintenance@jackson-mattermost> Envelope-to: maintenance@jackson-mattermost Delivery-date: Tue, 05 Jan 2021 21:47:01 +0000 Received: from maintenance by Jackson-Mattermost with local (Exim 4.92) (envelope-from <maintenance@jackson-mattermost>) id 1kwuAP-0001UJ-Cj for maintenance@jackson-mattermost; Tue, 05 Jan 2021 21:47:01 +0000 From: root@jackson-mattermost (Cron Daemon) To: maintenance@jackson-mattermost Subject: Cron <maintenance@Jackson-Mattermost> /home/maintenance/mattermost-intergration-shell/intergration.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Cron-Env: <SHELL=/bin/sh> X-Cron-Env: <HOME=/home/maintenance> X-Cron-Env: <PATH=/usr/bin:/bin> X-Cron-Env: <LOGNAME=maintenance> Message-Id: <E1kwuAP-0001UJ-Cj@Jackson-Mattermost> Date: Tue, 05 Jan 2021 21:47:01 +0000 jq - commandline JSON processor [version 1.5-1-a5b5cbe] Usage: jq [options] <jq filter> [file...] jq is a tool for processing JSON inputs, applying the given filter to its JSON text inputs and producing the filter's results as JSON on standard output. The simplest filter is ., which is the identity filter, copying jq's input to its output unmodified (except for formatting). For more advanced filters see the jq(1) manpage ("man jq") and/or https://stedolan.github.io/jq Some of the options include: -c compact instead of pretty-printed output; -n use `null` as the single input value; -e set the exit status code based on the output; -s read (slurp) all inputs into an array; apply filter to it; -r output raw strings, not JSON texts; -R read raw strings, not JSON texts; -C colorize JSON; -M monochrome (don't colorize JSON); -S sort keys of objects on output; --tab use tabs for indentation; --arg a v set variable $a to value <v>; --argjson a v set variable $a to JSON value <v>; --slurpfile a f set variable $a to an array of JSON texts read from <f>; See the manpage for more n-shell/intergration.sh: line 16: Executing: command not found

A public version of the script (which is slightly behind the one that produced this output) can be found at https://github.com/minecraftchest1/mattermost-intergration-shell/blob/main/intergration.sh

dd Mayhem – How I Overwrote my Linux Install

If you have used the linux command line, you may have used dd to write disk images to disk. And if you have used dd, you may have heard the joke that dd means disk destroyer. You may find the joke funny, at least until you have set of to the wrong block device. Here is the story of how I learned what dd can do.

If you have used the linux command line, you may have used dd to write disk images to disk. And if you have used dd, you may have heard the joke that dd means disk destroyer. You may find the joke funny, at least until you have set of to the wrong block device. Here is the story of how I learned what dd can do.

The day was December 23, 2020. Just two days before Christmas. I had previously compiled a PR for ReactOS to test it, copied it to my Raspberry Pi 4b, and configured it to share the .iso file as a mass storage device over the USB port. After rebooting and choosing USB as my boot device, it loaded the drivers and went to a black screen which didn’t supprise me.

Booting ReactOS from my Raspberry Pi 4 in mass storage mode.

After trying a few times, I decided to try a more common method, use a physical USB drive. That is where my mistake came in. I verified that /dev/sdb was my USB drive with fdisk -l, formatting it with parted, I was ready to write my .iso file to my drive with dd. I ran the command sudo dd if=bootcd.iso of=/dev/sda. And there goes the first couple megabytes of data on my hard drive. That’s right, I overwrote the boot sector, boot partition, and who knows what else on my hard drive. Woopse. Look for part 2 where I will attempt to recover the data on my drive.

Using mutt mail client

I have recently discovered mutt (and neomutt which has a few patches that haven’t made it into mutt) in my search for a command line mail client. While it is a simple mail client that works nicely when a Display server is not available, or you choose to go command line only, there are a few things to be aware of when using it for the first time. I have set this program up fairly recently, and here is my experience.

I have recently discovered mutt (and neomutt which has a few patches that haven’t made it into mutt) in my search for a command line mail client. While it is a simple mail client that works nicely when a Display server is not available, or you choose to go command line only, there are a few things to be aware of when using it for the first time. I have set this program up fairly recently, and here is my experience.

Installing

I have installed neomutt on my Archlinux laptop. Unlike some packages I have installed on Arch, both mutt and neomutt were available in the arch repros to be installed with sudo pacman -S mutt or sudo pacman -S neomutt.

Configuring

The config file for mutt and neomutt go in a file in ~/.muttrc unless another is specified on the command line. Below is a sample config file that I use.

set editor=/opt/bin/nano
#-----------#
# Passwords #
#-----------#
#gpg --textmode -d ~/outlook.password.asc
#---------------#
# Account Hooks #
#---------------#
account-hook . "unset imap_user; unset imap_pass; unset tunnel" # unset first!
account-hook        "imaps://[email protected]@smtp.office365.com" "\
    set imap_user   = [email protected]\
        imap_pass   = ywqowraeupaewbcf"
# -------------------------- #
# Ignore unnecessary header  #
# -------------------------- #
ignore *                                                                        
unignore From: To: Cc: Date: Subject:   
#-------------------------------------#
# Folders, mailboxes and folder hooks #
#------------------------------------#
# Setup for wyattcjackson2006
  set folder          = imaps://[email protected]@smtp.office365.com/
  mailboxes           = +INBOX
  set spoolfile       = +INBOX
  folder-hook         imaps://[email protected]@smtp.office365.com"\
      set folder      = imaps://[email protected]@smtp.office365.com\
          spoolfile   = +INBOX \
          postponed   = +Drafts \
          record      = +'Sent Mail' \
          from        = 'Wyatt Jackson <[email protected]>' \
          realname    = 'Wyatt Jackson' \
          smtp_url    = smtp://[email protected]@smtp.office365.com:587\
          ssl_starttls = yes \
          smtp_pass   = ywqowraeupaewbcf"

Using mutt

Using mutt is fairly simple. Use the arrow keys to move up and down the listings (page up/down to move 1 screenful), [enter] to select mail, [q] to quit mutt, and [i] to leave the mail reader. [m] to compose new message and view drafts. More keybindings are listed at the top of the screen, and more can be configured.

More information

Design a site like this with WordPress.com
Get started