Friday, September 9, 2022

Tailwind carousel slide show for React website

////////////////////////////////////////////////index.css

@tailwind base;

@tailwind components;

@tailwind utilities;

///////////////////////////////////////////////////////////////////

////////////////////////////////////////tailwind.config.js

/** @type {import('tailwindcss').Config} */

module.exports = {

  content: ['./src/**/*.{html,js,jsx}'],

  theme: {

    extend: {},

  },

  plugins: [],

};

///////////////////////////////////////////////////////////////////

Nano text editor basic commands

nano --version // /usr/share/nano // /etc/nanorc // include "/usr/share/nano/*.nanorc"

Shortcuts are written as follows: Control-key sequences are notated with a '^' and can be entered either by using the Ctrl key or pressing the Esc key twice. Meta-key sequences are notated with 'M-' and can be entered using either the Alt, Cmd, or Esc key, depending on your keyboard setup. Also, pressing Esc twice and then typing a three-digit decimal number from 000 to 255 will enter the character with the corresponding value. The following keystrokes are available in the main editor window. Alternative keys are shown in parentheses:

^G     (F1)      Display this help text

^X     (F2)      Close the current buffer / Exit from nano

^O     (F3)      Write the current buffer (or the marked region) to disk

^R     (Ins)     Insert another file into current buffer (or into new buffer)

Vim text editor basic commands

             ^                 :q! <ENTER> // exit

             k                 x // delete the character under the cursor

       < h       l >        i // insert text

               j                A // append text

               v               :wq // save file and exit

dd // delete a whole line => d+

w - until the start of the next word, EXCLUDING its first character.

e - to the end of the current word, INCLUDING the last character.

$ - to the end of the line, INCLUDING the last character.

2w  to move the cursor two words forward.

3e  to move the cursor to the end of the third word forward.

0  (zero) to move to the start of the line.

y  // yank (copy) the highlighted text.

p  // put (paste) the text.  Then type:  a second <ESC> .

u  // undo the last commands.

:!  // followed by an external command to execute that command.

/ignore <ENTER> // search ignore

n // search ignore again (next instance)

CTRL-G // show your location in the file and the file status.

G  // move to a line in the file.

:help w // help for any subject - currently for w.

https://coderwall.com/p/adv71w/basic-vim-commands-for-getting-started

https://vim.rtorr.com/

Date, Math, Number built-in objects in JavaScript

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Numbers_and_dates

http://www.lingoes.net/en/translator/langcode.htm

Most useful String methods in JavaScript

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String

padStart

Most useful Array methods in JavaScript

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array

Prefer using methods instead of loops!!!

filter

forEach

map

push

reduce

slice

sort

Thursday, September 8, 2022

journalctl - query the systemd journal in Linux

journalctl -b

journalctl --since "30 minutes ago" > journal_last_30min.txt


sudo nano /etc/systemd/journald.conf

SystemMaxUse=128M // remove # => uncomment

MaxFileSec=2day // remove # => uncomment

sudo systemctl restart systemd-journald


sudo journalctl --rotate

sudo journalctl --vacuum-time=2d

journalctl --vacuum-size=128M


sudo rm /var/log/syslog.1 // 9.2 GB

/run/log/journal

/var/log/journal

https://www.freedesktop.org/software/systemd/man/journald.conf.html

https://manpages.ubuntu.com/manpages/kinetic/man1/journalctl.1.html