The Things' Engine – Blog
Table of Contents
- Update the title for this website
- Emacs
- Insert screenshots into org files
- Run Elisp Script in Shell on MacOS Emacs
- A motto for Git
- Step by Step
- API Testing
- Org Macros
- Org-bullet symbol set
- Org as a spreadsheet system: using Emacs lisp as formulas
- For paragraph
- Visual alignment Org tables for GUI Emacs
- Learning Tree
- Some Practical TCP dump Examples** NetworkSecurity
- Markdown to Org documenting conversion
- Linux Cron Job
- Emacs-Table
- Youth
- End – New Beginning
Update the title for this website
The title is update from "The Things Engine"(物联引擎) to "Something Great" (稻盛和夫), then to "Something Good" (一点有益)
Emacs
Emacs is … and more.
Insert screenshots into org files
Mojave has a new screenshot capability you get with SHIFT-COMMAND-5. After typing SHIFT-COMMAND-5, select OPTIONS, then select "Clipboard". (save to desktop" and then the Dropbox saving funtionality.)
(use-package org-download :after org :defer nil :custom (org-download-method 'directory) (org-download-image-dir "images") (org-download-heading-lvl nil) (org-download-timestamp "%Y%m%d-%H%M%S_") (org-image-actual-width 300) (org-download-screenshot-method "/usr/local/bin/pngpaste %s") :bind ("C-s-y" . org-download-screenshot) :config (require 'org-download))
See the reference: https://zzamboni.org/post/how-to-insert-screenshots-in-org-documents-on-macos/
Run Elisp Script in Shell on MacOS Emacs
Emacs
-
Create a emacs lisp script, HelloWorld.el
(message "Hello Elisp World!")
-
Run a elisp script on a MacOS from the command line
/Applications/Emacs.app/Contents/MacOS/Emacs --script HelloWorld.el
Most useful options for running emacs lisp as a script:
- "–no-init-file" or "-q"
- "–no-site-file"
- "–batch"
-
"–load=
path
" or "-lpath
" - "–script
path
"
Two more things:
- What is site-start.el The site-start.el is a int file for site-wide running of emacs, a init file for all users fo the installed emacs. On MacOS, The path is "/Applications/Emacs.app/Contents/Resources/site-lisp".
-
How to prepare your emacs lisp scrip to run in batch mode
- self-contained
- load all needed libraies properly
-
set the necessary load path set in the script, such as follows:
(add-to-list 'load-path lib_path)
A motto for Git
While exploring difference, never lose sight of sameness for it is sameness that brings us together. – John Briggs
Step by Step
A long journey begins with the first step – Lao Tzu
API Testing
Test
<div id="jinrishici-sentence" style="font-weight: 700;">千里之行,始于足下</div> <script src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8"></script>
Org Macros
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
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
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 | |
---|---|---|
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
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
Emacs Orgmode
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
Research
Some Practical TCP dump Examples** 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
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
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 [B] 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
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
End is a new beginning – YF Lin