The Things' Engine – Blog

Table of Contents

Step by Step

<2020-03-17 Tue>

A long journey begins with the first step – Lao Tzu

Test

<2020-09-26 Sat>   Test

This is a test.

Org Macros

<2020-08-09 Sun>   Emacs Orgmode

The macros in Org allow you to add text or code to an Org document that will be expanded during export: the text between the 3 pairs of accolades is expanded so that readers can see it in the exported versions of the document.

It can be used to construct complex HTML or LaTeX code.

#+MACRO: color @@html:<span style="color: $1">$2</span>@@
{{{color(blue, This text is colored in blue.)}}}
{{{color(red, This other text is in red.)}}}

This text is colored in blue. This other text is in red.

Org-bullet symbol set

<2020-08-09 Sun>   Emacs Orgmode

  • Hexagrams
    “✡” “⎈” “✽” “✲” “✱” “✻” “✼” “✽” “✾” “✿” “❀” “❁” “❂” “❃” “❄” “❅” “❆” “❇”
  • Circles
    “○” “☉” “◎” “◉” “○” “◌” “◎” “●” “◦” “◯” “⚪” “⚫” “⚬” “❍” “○” “⊙” “⊚” “⊛” “∙” “∘”
  • Special Circles
    “◐” “◑” “◒” “◓” “◴” “◵” “◶” “◷” “⚆” “⚇” “⚈” “⚉” “♁” “⊖” “⊗” “⊘”
  • Crosses
    “✙” “♱” “♰” “☥” “✞” “✟” “✝” “†” “✠” “✚” “✜” “✛” “✢” “✣” “✤” “✥”
  • Poker Sybmols
    “♠” “♣” “♥” “♦” “♤” “♧” “♡” “♢”
  • Yinyang
    “☯” “☰” “☱” “☲” “☳” “☴” “☵” “☶” “☷”
  • Special Symbols
    “☀” “♼” “☼” “☾” “☽” “☣” “§” “¶” “‡” “※” “✕” “△” “◇” “▶” “◀” “◈”
1: ;; use org-bullets-mode for utf8 symbols as org bullets
2: (require 'org-bullets)
3: ;; make available "org-bullet-face" such that I can control the font size individually
4: (setq org-bullets-face-name (quote org-bullet-face))
5: (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
6: (setq org-bullets-bullet-list '("✙" "♱" "♰" "☥" "✞" "✟" "✝" "†" "✠" "✚" "✜" "✛" "✢" "✣" "✤" "✥"))

org-ellipsis candidate symbols

  • right arrows
    “↝” “⇉” “⇝” “⇢” “⇨” “⇰” “➔” “➙” “➛” “➜” “➝” “➞”
    “➟” “➠” “➡” “➥” “➦” “➧” “➨”
    “➩” “➪” “➮” “➯” “➱” “➲”
    “➳” “➵” “➸” “➺” “➻” “➼” “➽”
  • arrow heads
    “➢” “➣” “➤” “≪”, “≫”, “«”, “»”
  • other arrows
    “↞” “↠” “↟” “↡” “↺” “↻”
  • lightening
    “⚡”
  • other symbols
    …, ▼, ↴, , ∞, ⬎, ⤷, ⤵
1: ;; org ellipsis options, other than the default Go to Node...
2: ;; not supported in common font, but supported in Symbola (my fall-back font) ⬎, ⤷, ⤵
3: (setq org-ellipsis "⚡⚡⚡");; ⤵ ≫

Org as a spreadsheet system: using Emacs lisp as formulas

<2020-08-08 Sat>   Emacs Orgmod

It is how to use Emacs Lisp as formulas in Org tables. Example 1: manipulate cells. Here is a simple table:

First Name Last Name Email
Jone Doe Jone.Doe@abc.edu
Alice Susan Alice.Susan@abc.edu
Bob Wash Bob.Wash@abc.edu
Even Yellow  

Now type C-c } to display the table's coordinates.

1: '(concat $1 "." $2 "@emacs.edu")

Now copy this formula, type C-c = in the bottom right field to insert a column formula2 and copy the formula here. Hitting RET will immediately insert the result in this field (Even.Yellow@emacs.edu) and add the #+TBLFM line (#+TBLFM: $3='(concat $1 "." $2 "@abc.edu")) at the bottom of the table.

For paragraph

<2020-07-29 Wed>   Emacs Orgmod notetaking

Paragraphs are separated by at least one empty line. If you need to enforce a line break within a paragraph, use ‘\\’ at the end of a line.

To preserve the line breaks, indentation and blank lines in a region, but otherwise use normal formatting, you can use this construct, which can also be used to format poetry.

Great clouds overhead
Tiny black birds rise and fall
Snow covers Emacs

   —AlexSchroeder

When quoting a passage from another document, it is customary to format this as a paragraph that is indented on both the left and the right margin. You can include quotations in Org documents like this:

Everything should be made as simple as possible, but not any simpler —Albert Einstein

If you would like to center some text, do it like this:

Everything should be made as simple as possible,
but not any simpler

Visual alignment Org tables for GUI Emacs

<2020-07-28 Tue>   Emacs Orgmode

Valign.el

This package provides visual alignment for Org and Markdown tables on GUI Emacs. It can properly align tables containing variable-pitch font, CJK characters and images. Meanwhile, the text-based alignment generated by Org mode (or Markdown mode) is left untouched.

To use this package, load it and add valign-mode to org-mode-hook or markdown-mode-hook:

1: (add-hook org-mode-hook #valign-mode)

Learning Tree

<2020-07-27 Mon>   Research

learningTree.png

Some Practical TCP dump Examples** <2020-07-19 Sun>   NetworkSecurity

Practical tcpdump examples to lift your network troubleshooting and security testing game. Commands and tips to not only use tcpdump but master ways to know your network.

Knowing tcpdump is an essential skill that will come in handy for any system administrator, network engineer or security professional.

Markdown to Org documenting conversion

<2020-07-19 Sun>   Documenting

To simply convert one file from Markdown to Org the following command can be used:

pandoc -f markdown -t org -o newfile.org original-file.markdown

The solution was to export the VoodooPad document to a folder as text (File > Export Document > Export as Text…). Then call pandoc via the find command to convert them all in one go:

$ find . -name \*.txt -type f -exec pandoc  -f markdown -t org -o {}.org {} \; 
for f in `ls *.md`; do 
  pandoc -f markdown -t org -o ${f}.org ${f}; 
done
(defun markdown-convert-buffer-to-org ()
   "Convert the current buffer's content from markdown to orgmode format and save it with the current buffer's file name but with .org extension."
   (interactive)
   (shell-command-on-region (point-min) (point-max)
                            (format "pandoc -f markdown -t org -o %s"
                                    (concat (file-name-sans-extension (buffer-file-name)) ".org"))))

Linux Cron Job

<2020-05-13 Wed>   Linux

Cron job

How to generate a job just running in lipe year

For example: At 12:00am on February 29th

0 0 29 2 * root /bin/echo "Hello World"

Controlling Access to the crontab Command

You can control access to the crontab command by using two files in the /etc/cron.d directory: cron.deny and cron.allow. These files permit only specified users to perform crontab command tasks such as creating, editing, displaying, or removing their own crontab files. The cron.deny and cron.allow files consist of a list of user names, one user name per line.

These access control files work together as follows:

  • If cron.allow exists, only the users who are listed in this file can create, edit, display, or remove crontab files.
  • If cron.allow does not exist, all users can submit crontab files, except for users who are listed in cron.deny.
  • If neither cron.allow nor cron.deny exists, superuser privileges are required to run the crontab command.

Superuser privileges are required to edit or create the cron.deny and cron.allow files.

Emacs-Table

TODO <2020-05-02 Sat>   Emacs Org

Plan to write an article to talk about "Tables in Emacs with Org-mode"

Tables in Emacs with Org-mode

In Emacs, the Org mode comes with a fast and intuitive table editor. Spreadsheet-like calculations are supported by using the Emacs calc package and Emacs Lisp programming language.

Youth

<2020-04-29 Wed>   Literature

By Samuel Ullman

Youth is not a time of life; it is a state of mind; it is not a matter of rosy cheeks, red lips and supple knees; it is a matter of the will, a quality of the imagination, a vigor of the emotions; it is the freshness of the deep springs of life.

Youth means a temperamental predominance of courage over timidity of the appetite, for adventure over the love of ease. This often exists in a man of sixty more than a boy of twenty. Nobody grows old merely by a number of years. We grow old by deserting our ideals.

Years may wrinkle the skin, but to give up enthusiasm wrinkles the soul. Worry, fear, self-distrust bows the heart and turns the spirit back to dust.

Whether sixty or sixteen, there is in every human being's heart the lure of wonder, the unfailing child-like appetite of what's next, and the joy of the game of living. In the center of your heart and my heart there is a wireless station; so long as it receives messages of beauty, hope, cheer, courage and power from men and from the infinite, so long are you young.

When the aerials are down, and your spirit is covered with snows of cynicism and the ice of pessimism, then you are grown old, even at twenty, but as long as your aerials are up, to catch the waves of optimism, there is hope you may die young at eighty.

End – New Beginning

<2020-03-17 Tue>

End is a new beginning – YF Lin

Date: 2020-04-28 Tue 00:00

Created: 2020-09-26 Sat 21:17

By YF Lin

Validate