User Tools

Site Tools


misc:asciidoc_snippet

asciidoc snippet

DRAFT: Creating a tutorial with the asciidoc markup format.
Tutorial [ ] Guide [x]

Pico Cheat Sheet

An asciidoc version of the Pico Cheat Sheet tutorial.

An asciidoc version of pico.
== Pico Cheat Sheet
 
**pico** is a simple, display-oriented text editor originally developed for the https://wiki.sdf.org/doku.php?id=email_at_sdf#email_programs_from_shell_membershipsuser_or_arpa_or_metaarpa[pine] e-mail client.
**pico** is the default editor for SDF's https://wiki.sdf.org/doku.php?id=bboard[bboard] system.
 
=== Survival Guide
 
image::https://wiki.sdf.org/lib/exe/fetch.php?media=pico-label.png[alt="UW PICO",width=400]
 
=== Control Keys
 
_(The key sequence_ ++Esc Esc x++ _can be used instead of the combination_ ++Ctrl-x++__).__
 
|===
|Ctrl-A |beginning of line | Ctrl-N | next line
|Ctrl-B |backward character |Ctrl-O |output file
|Ctrl-C |cursor position |Ctrl-P |previous line
|Ctrl-D |delete character |Ctrl-R |read insert file
|Ctrl-E |end of line |Ctrl-T |spell check
|Ctrl-F |forward character |Ctrl-U |paste
|Ctrl-G |get help |Ctrl-V |forward page
|Ctrl-I |insert tab |Ctrl-W |search
|Ctrl-J |justify paragraph |Ctrl-X |save exit
|Ctrl-K |cut region |Ctrl-Y |backward page
|Ctrl-L |refresh display |Ctrl-$$^$$ |set mark
|===
 
=== Function Keys
 
|===
|F1 |get help |F5 |read insert file |F9 |cut region
|F2 |save exit |F6 |search |F10 |paste
|F3 |output file |F7 |backward page |F11 |cursor position
|F4 |justify paragraph |F8 |forward page |F12 |spell check
|===
 
'''
$$Source:$$ http://sdf.org/?tutorials/pico

HT802

An asciidoc version of the HT802 RCS tutorial.

An asciidoc version of HT802.
== Vonage/Grandstream HT802 Factory Unlock
 
#$$WARNING:$$ This is an advanced topic and will void your warranty! Neither SDF, the authors, contributors or sources linked within this file will be liable for your own actions. Proceed with caution!#
 
#WARNING 2: This page is provided for information only. Under no circumstances should these instructions be used for any illegal purpose or in violation of any contract or user agreement.#
 
Vonage branded models of the Grandstream HT802 come loaded with a factory-locked firmware which does not allow for user configuration. These models will not permit admin login with the standard Grandstream default login of admin/admin. Removing the Vonage settings will require the following tools and abilities:
 
* A philips-head screwdriver
* A computer with a USB port
* A USB-Serial adapter such as a PL2303 or FTDI and male jumper wires
* Terminal software cabaple of interacting with a serial console (screen or minicom)
* Basic hardware hacking knowledge (think raspberry pi GPIO)
* Common sense
* An adventurous spirit
 
=== Step one: Disassembly and mainboard access
 
* Puncture or remove the sticker on the bottom of the device that says "Warranty void if removed". WARNING: This will void your warranty
* Use a philips-head screwdriver to remove the single screw in the center of the bottom of the case
* Carefully unclip and remove the top of the case. The clips are very secure, and may require some gentle force to remove.
* The devices mainboard should now be exposed, you will see the components, including the serial headers labelled below:
 
image::http://sdf.org/tutorials/images/ht802_pinout.jpg[alt="HT802 Pinout",width=600]
 
Image courtesy of dslreports.com user https://www.dslreports.com/forum/r31157705-[toro]
 
=== Step two: Connect to the serial terminal
 
* Using male jumper wires, connect the serial headers on the mainboard to the appropriate pins of your USB to serial adapter: Note: Male jumper wires _should_ slip into the through-holes on the mainboard's header. _Do not_ force anything or you may risk damage to the board.
 
** RX to TX
** TX to RX
** GND to GND
** DO NOT allow the USB to serial adapter's +5v wire to come into contact with the mainboard, as this may cause damage to the device.
 
* Connect the USB to serial adapter to your computer's USB port
* Use a serial terminal program to access they USB serial port, e.g.: 
----
screen /dev/ttyUSB0 115200
----
 
* Carefully plug the HT802 into its power source. If you have everything connected properly, you will see boot messages printed to your terminal window. If you do not see this, disconnect everything and start over, carefully.
 
=== Step three: Apply unlock and flash firmware
 
* Wait for the device to finish boothing. Once it is complete, you should see a root command prompt, indicated by the '#' character.
* Type the following commands, in order. If at any point you recieve an error, stop, and carefully check your work.
+
----
cd /tmp
dd if=/dev/mtd1 of=/tmp/fact-old.img
wget http://shriver.sdf.org/misc/ht802unlock
chmod +x ht802unlock
./ht802unlock
flash_erase /dev/mtd1
cat /tmp/fact-new.img > /dev/mtd1
flash_eraseall /dev/mtd2
----
 
* Note: the ht802unlock file is a small program that reads the file fact-old.img and creates a fact-new.img with the Vonage settings removed.
* At this point you may wish to pause and backup the two files fact-old.img and fact-new.img. Having these will allow you to restore to the factory firmware. You can save these files by doing the following:
 
** First, determin the PID of the web server that the firmware is running, using:
+
----
ps w
----
** Kill the webserver process:
+
----
kill $PID
----
** Start a new webserver in the /tmp directory:
+
----
httpd -h /tmp -p 80
----
** Using a web browser on your computer, access and download the following files:
+
----
http://grandstream_ip_address/fact-old.img
http://grandstream_ip_address/fact-new.img
----       
* Finally, reboot the device:
----
reboot -f
----
 
When your HT802 reboots, you will be able to access the web interface using the device's ip address. The default login admin/admin will allow you to configure the device without factory restrictions.
 
These instructions have been adapted from https://www.dslreports.com/forum/r31158266-[this post] on dslreports.com

AsciiDoc

asciidoc at the SDF cluster prompt:

$ asciidoc --help syntax | less
  • Save An_asciidoc_version_of_pico, as pico_cheat_sheet.adoc
$ asciidoc -s pico_cheat_sheet.adoc
$ links pico_cheat_sheet.html
  • Save An_asciidoc_version_HT820, as ht820.adoc
$ asciidoc -s ht820.adoc
$ links ht820.html

Converter

Pandoc a universal document converter; Pandoc Manual
pandoc [options] [input-file]…
  • Convert the pico_cheat_sheet.html file to a dokuwiki txt file.
$ pandoc -f html -t dokuwiki pico_cheat_sheet.html -o pico_cheat_sheet.txt
  • Convert the ht802.adoc file to a dokuwiki txt file.
$ asciidoc -b dockbook45 -s ht820.adoc
$ pandoc -f docbook -t dokuwiki ht820.xml -o ht820.txt

Editing

asciidoc table

An asciidoc version of the acme tutorial section.

An asciidoc version of acme.
== acme
 
Start acme to access the mbox.
 
----
  % acme
----
 
|===
h|Newcol Kill Putall Dump Exit
|**New Cut Paste Snarf Sort Zerox Delcol**
|===
 
|===
h|Newcol Kill Putall Dump Exit
|**New Cut Paste Snarf Sort Zerox Delcol** <= Add _Mail_ by typing ''Mail''.
|===
 
|===
h|Newcol Kill Putall Dump Exit
|**New Cut Paste Snarf Sort Zerox Delcol Mail** <= Mouse button 2 press _Mail_.
|===
 
|===
h|Newcol Kill Putall Dump Exit
|**New Cut Paste Snarf Sort Zerox Delcol Mail**
|**_/mail/fs/mbox_** **Del Snarf : Look Put Mail Delmesg Undelmesg Next**
|===
 
|===
h|Newcol Kill Putall Dump Exit
|**New Cut Paste Snarf Sort Zerox Delcol Mail**
|**_/mail/fs/mbox_** **Del Snarf : Look Put Mail Delmesg Undelmesg Next** <= Mouse button 2 press _Mail_ to compose a new mail.
|1/ <= Email messages arrive here.
|===
 
|===
h|Newcol Kill Putall Dump Exit
|**New Cut Paste Snarf Sort Zerox Delcol Mail**
|**_/mail/fs/mbox_** **Del Snarf : Look Put Mail Delmesg Undelmesg Next**
|2/ <= Email messages arrive here.
|1/
|**_/mail/fs/mbox/Compose.1_** **Del Snarf : Look Post :fmt** <= Mouse button 2 press _Post_ to send the mail; _fmt_ to format the mail.
|To:
|Subject:
|[blank]
|some text here <= Type the email text here.
|===
 
|===
h|Newcol Kill Putall Dump Exit
|**New Cut Paste Snarf Sort Zerox Delcol Mail**
|**_/mail/fs/mbox_** **Del Snarf : Look Put Mail Delmesg Undelmesg Next**
|1/ <= Email messages arrive here.
|**_/mail/fs/mbox/Compose.1_** **Del Snarf : Look Post :fmt** <= Mouse button 2 press _Post_ to send the mail; _fmt_ to format the mail.
|To:
|From: <= Type the _From:_ text here.
|Subject:
|[blank]
|some text here <= Type the email text here.
|===
 
|===
h|Newcol Kill Putall Dump Exit
|**New Cut Paste Snarf Sort Zerox Delcol Mail**
|**_/mail/fs/mbox_** **Del Snarf : Look Put Mail Delmesg Undelmesg Next**
|5/ <= Mouse button 3 press #5 (__/5__) to open the message.
|4/
|3/
|2/
|1/
|===
 
=== acme 'win'
 
|===
h|Newcol Kill Putall Dump Exit
|**New Cut Paste Snarf Sort Zerox Delcol**
|===
 
|===
h|Newcol Kill Putall Dump Exit
|**New Cut Paste Snarf Sort Zerox Delcol** <= Add _win_ by typing "win".
|===
 
|===
h|Newcol Kill Putall Dump Exit
|**New Cut Paste Snarf Sort Zerox Delcol win** <= Mouse button 2 press _win_.
|===
 
|===
h|Newcol Kill Putall Dump Exit
|**New Cut Paste Snarf Sort Zerox Delcol win**
|**_/usr/$user/-rc_** **Del Snarf : Look Send Noscroll**
|cpu:
|===
 
== acme images
 
A brief mention of acme, for those who are attending the SDF Plan 9 Boot Camp.
 
|===
|% acme
|===
 
image::https://wiki.sdf.org/lib/exe/fetch.php?media=plan9-acme-1.png[alt="plan9-acme-1",width=600]
 
. Press the middle button of your mouse while the pointer is over the text "New" (to the left), in the row marked with a **1**.
. Type the text "win" in the row, or newly created area, marked with a **2**.
. Press the middle button of your mouse while the pointer is over the text "win" in the row, or newly created area, marked with a **2**.
. Type the text "Mail" in the row marked with a **3**.
. Press the middle button of your mouse while the pointer is over the text "Mail", in the row marked with a **3**.
 
image::https://wiki.sdf.org/lib/exe/fetch.php?media=plan9-acme-2.png[alt="plan9-acme-2",width=600]
 
. Press the right button of your mouse while the pointer is used to highlight a file name.
. Once the highlight covers the filename, release the right mouse button to open the file.
 
|===
|http://acme.cat-v.org/[The Acme User Interface for Programmers]
|Plan 9 https://wiki.sdf.org/doku.php?id=plan_9_9front#videos[Acme] videos Plan 9 Acme Intro - Part 1, 2, & 3
|===
 
__1__.) From a Plan 9 Rio rc prompt.
 
== sam
 
* https://wiki.sdf.org/doku.php?id=playground:plan9_tutorial_sam[Text Editing with the sam editor]
 
Sam is a text editor. While the cursor is over the sam window, press the right button of your mouse and drag the cursor over the file name. Release the right mouse button once the cursor is over the file name. The cursor pointer will change to a square. Press the right button, while the square cursor is over the lower panel, to load the file in the lower panel.
 
image::https://wiki.sdf.org/lib/exe/fetch.php?media=sam-editor1.png[alt="sam-editor1",width=600]
 
----
  % sam /rc/bin/termrc.local
----
 
A few words about (**w**) writing the file, and how to (**q**) quit "sam". Commands (//sam -d//) are typed in the upper panel, while edits are typed in the lower panel. Press the left mouse button to activate the upper panel, or the lower panel. Type a '**w**' in the upper panel, then press the carriage return. This saves the file. Type a '**q**' in the upper panel, then press the carriage return. This quits "sam".
 
Sam uses it's own cut/paste buffer. Exchange it with Rio's cut/paste buffer by using the <**rio**> option in the middle button (2) menu of sam.
 
The following edit ('% sam -d') will work from the https://wiki.sdf.org/doku.php?id=vps_-$$_$$plan9front_-_acme_sam_abaco_mothra_and_man#sam[VM console] rc prompt, or from the upper sam panel.
 
----
  % mkdir samlearn
  % cd samlearn
----
 
----
  % cp /lib/ndb/local local2
  % sam -d local2
  -. local2
  /ip=
            "Press the Carriage return, following the line output."
  s/ip=/#ip=
  $+1
  a
  ip=YOUR_IP sys=plan9 dom=plan9 dns=205.166.94.20
  .
  w
  q
  %
----
 
----
  % cp /rc/bin/termrc.local termrc.local2
  % sam -d termrc.local2
  -. termrc.local2
  $+1
  a
  ip/ipconfig -g 205.166.94.1 ether /net/ether0 YOUR_IP 255.255.255.0
  ndb/cs
  ndb/dns -r
  .
  w
  q
  %
----
 
|===
h|**Command**|**Option**|**Quick Reference**
|SAM|'sam -d'|http://sam.cat-v.org/cheatsheet/
|===
 
== ed
 
Ed is a text editor, and similar to https://wiki.sdf.org/doku.php?id=vps_-$$_$$plan9front_-$$_$$acme_sam_abaco_mothra_and_man#sam[sam -d]. Using the '% sam -d examples from https://wiki.sdf.org/doku.php?id=vps_-$$_$$plan9front_-_acme_sam_abaco_mothra_and_man#sam[Sam], it's possible to use '% ed'. The mentioned examples are from a Drawterm Rio rc prompt.
 
----
  % cd samtest
  % cp /lib/ndb/local local-1ed
----
 
----
  % ed local-1ed
  291
  /ip=
  ip=127.0.0.1 sys=localhost dom=localhost
  s/ip=/#ip=
  #ip=127.0.0.1 sys=localhost dom=localhost
  $
  #ip=127.0.0.1 sys=localhost dom=localhost
  a
  ip=YOUR_IP sys=plan9 dom=plan9 dns=205.166.94.20
  .
  w
  341
  q
  %
----
 
----
  % cp /rc/bin/termrc.local termrc.local-1ed
  % ed termrc.local-1ed
----
 
----
  % ed termrc.local-1ed
  424
  $
  cpu=CP
  a
  ip/ipconfig -g 205.166.94.1 ether /net/ether0 YOUR_IP 255.255.255.0
  ndb/cs
  ndb/dns -r
  .
  w
  510
  q
  %
----
 
|===
h|**Command**|**Title**|**Quick Reference**
|ED|ed Cheat Sheet|http://sdf.org/?tutorials/ed
|===
 
== abaco
 
You can use http://lab-fgb.com/abaco/[Abaco] to browse the web^1^. (Abaco is available in a default Plan 9 system.) You'll need to have your IP configured and DNS working in order to browse the web. After that, you'll have to run "webfs" and [underline]#then#^2^ "abaco". If you don't have a "/usr/$user/lib/webcookies" file, _touch_ it once. (You may want to add "webfs" in your "$home/lib/profile" just before plumber and rio.)
 
image::https://wiki.sdf.org/lib/exe/fetch.php?media=plan9-abaco-1.png[alt="plan9-abaco-1",width=600]
 
----
  % touch /usr/$user/lib/webcookies
----
 
----
  % webfs
  % abaco
----
 
When abaco starts, you can go to a webpage by clicking "_New_" with the middle button of the mouse, typing the address in the row below the one with "_Del Snarf Get …_" (see the previous figure: it's the one where the current legacy address is), and pressing "[**Enter**]" on your keyboard. You can follow links by clicking on them, as is usual, with the left button (the shape of the cursor won't change, though).
 
^1^ An http URL. ^2^ Both commands are used on one line with a separator: '% webfs; abaco'. ^3^ Another way to run Abaco.
 
== mothra
 
|===
|Mothra https://wiki.sdf.org/doku.php?id=vps_-_9front#mothra
|===
 
== man
 
Editor reference:
 
|===
|Editors: https://en.wikipedia.org/wiki/List_of_Plan_9_applications#Editors[List of Plan 9 applications - Wikipedia]
|===
 
|===
|https://wiki.sdf.org/doku.php?id=vps_-$$_$$plan9front_-_acme_sam_abaco_mothra_and_man#acme[acme] interactive text editor and shell
|https://wiki.sdf.org/doku.php?id=vps_-$$_$$plan9front_-_acme_sam_abaco_mothra_and_man#ed[ed] text editor
|https://wiki.sdf.org/doku.php?id=vps_-$$_$$plan9front_-_acme_sam_abaco_mothra_and_man#sam[sam] screen editor with structural regular expressions
|===
 
|===
|Sam, Ed, Acme https://wiki.sdf.org/doku.php?id=vps_-_9front#editors
|===
 
|===
|Plan 9 Rc Survival Guide http://sdf.org/?tutorials/Plan_9_rc
|===
 
Browser reference:
 
|===
|Mothra https://wiki.sdf.org/doku.php?id=vps_-_9front#mothra
|===
 
|===
|Netsurf usage: netsurf [-cudv] [url]
|===
  • Save An_asciidoc_version_of_acme, as acme_table.adoc
$ asciidoc -s acme_table.adoc
$ links acme_table.html
  • Convert the acme_table.adoc file to a dokuwiki txt file.
$ asciidoc -b dockbook45 -s acme_table.adoc
$ pandoc -f docbook -t dokuwiki acme_table.xml -o acme_table.txt

tidy

Clean up your Web pages with HTML TIDY

  • Use 'tidy' to modify the acme_table.html file (for practice).
  • Backup the acme_table.html file before proceeding.
$ tidy -help
$ tidy -f errs.txt -m acme_table.html
misc/asciidoc_snippet.txt · Last modified: 2022/07/19 23:03 by hc9