Shellshare: Difference between revisions
(19 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
Versioon 1.1.0 lisab MS Windowsi toetuse ilma emuleerimiseta. | Versioon 1.1.0 lisab MS Windowsi toetuse ilma emuleerimiseta. | ||
Võimalus jagada [https://et.wikipedia.org/wiki/K%C3%A4surida käsurida] [https://en.wikipedia.org/wiki/Python_(programming_language) Pythoni] abil reaalajas veebipõhiselt ja võimaldada õppuritel paremini jälgida tunnis antud käske ja nende väljundit ja vältida ümberkirjutamisest tekkivaid vigu. Võimalus ka [https://et.wikipedia.org/wiki/Virtuaalmasin virtuaalmasinast] otse käsurida edastada. Edastamine toimub vaid vaatamisrežiimis. Kui soovitakse muutmisrežiimis (''aka collaborative hacking'') siis näiteks [https:// | Võimalus jagada [https://et.wikipedia.org/wiki/K%C3%A4surida käsurida] [https://en.wikipedia.org/wiki/Python_(programming_language) Pythoni] abil reaalajas veebipõhiselt ja võimaldada õppuritel paremini jälgida tunnis antud käske ja nende väljundit ja vältida ümberkirjutamisest tekkivaid vigu. Võimalus ka [https://et.wikipedia.org/wiki/Virtuaalmasin virtuaalmasinast] otse käsurida edastada. Edastamine toimub vaid vaatamisrežiimis. Kui soovitakse muutmisrežiimis (''aka collaborative hacking'') siis näiteks vabavaraline [https://upterm.dev/ upterm] võib huvi pakkuda. | ||
==Paigaldamine== | ==Paigaldamine== | ||
''' | '''Uusima shellshare'i versiooni kiire paigaldus Linuxis kestprogrammi [https://en.wikipedia.org/wiki/Bash_(Unix_shell) Bash] korral''' | ||
mkdir -p ~/.local/bin/ && wget -q --show-progress https://raw.githubusercontent.com/vitorbaptista/shellshare/master/public/bin/shellshare -O ~/.local/bin/shellshare && chmod u+x ~/.local/bin/shellshare | mkdir -p ~/.local/bin/ && wget -q --show-progress https://raw.githubusercontent.com/vitorbaptista/shellshare/master/public/bin/shellshare -O ~/.local/bin/shellshare && chmod u+x ~/.local/bin/shellshare | ||
Line 15: | Line 15: | ||
Palun asendada ''lühikäsunimi, ruuminimi, ruumisalasõna'' soovitud väärtustega. | Palun asendada ''lühikäsunimi, ruuminimi, ruumisalasõna'' soovitud väärtustega. | ||
Edaspidi piisab terminali avamisest ja saab määratud lühikäsunime sisestades kiirelt kasutada. Selle käivitamisel öeldakse terminalis ka aadress, mille pealt teised siis terminali sisestatud käske näevad, peaaegu reaalajas. Seda aadressi saab aegsasti ka | Kasutatud otsiteekonna (''path'') toimimiseks [https://en.wikipedia.org/wiki/Bash_(Unix_shell) Bash'i] korral tuleb jälgida, et ''~/.bashrc'' sisaldaks ridu: | ||
# set PATH so it includes user's private bin if it exists | |||
if [ -d "$HOME/.local/bin" ] ; then | |||
PATH="$HOME/.local/bin:$PATH" | |||
fi | |||
''~/.bashrc'' muudatuste jõustamiseks: | |||
source ~/.bashrc | |||
... või siis sulgeda kõik senised terminalide sessioonid ja avada uuesti terminal. | |||
Kui on mõni [https://en.wikipedia.org/wiki/Category:Unix_shells teine kestprogramm] kasutusel, siis tuleb jälgida selle seadistuse nõudeid. | |||
Edaspidi piisab terminali avamisest ja saab määratud lühikäsunime sisestades kiirelt kasutada. Selle käivitamisel öeldakse terminalis ka aadress, mille pealt teised siis terminali sisestatud käske näevad, peaaegu reaalajas. Seda aadressi saab aegsasti ka õppuritele jagada, mida tunni ajal siis avada saab. | |||
* skripti allalaadimine https://github.com/vitorbaptista/shellshare/releases - valida ''Latest Release'' | * skripti allalaadimine https://github.com/vitorbaptista/shellshare/releases - valida ''Latest Release'' | ||
Line 22: | Line 32: | ||
==Edastamine== | ==Edastamine== | ||
* käsurea reaalajas edastamise alustamiseks: | * käsurea (peaaegu) reaalajas edastamise alustamiseks: | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
python /asukoht/shellshare.py --server http://linux.itcollege.ee:3000 --room ruuminimi --password salasõna | python /asukoht/shellshare.py --server http://linux.itcollege.ee:3000 --room ruuminimi --password salasõna | ||
Line 51: | Line 61: | ||
==Erilised tänud== | ==Erilised tänud== | ||
'''Erilised tänud | '''Erilised tänud TalTechi IT Kolledži Linuxi administraatorile Veiko Tuul serveripoole käivitamise ja selle suurepärase võimaluse loomise eest!''' | ||
==Viited== | ==Viited== | ||
Line 63: | Line 73: | ||
Version 1.1.0 adds MS Windows support without emulation. | Version 1.1.0 adds MS Windows support without emulation. | ||
There is an option to share [https://en.wikipedia.org/wiki/Command-line_interface command-line] over Internet in real time using [https://en.wikipedia.org/wiki/Python_(programming_language) Python]. This allows for students to follow lecturer commands and its output and avoid mistakes of rewriting commands. Streaming is going only in read-only mode. If there is edit mode needed (''aka collaborative hacking'') then probably [https:// | There is an option to share [https://en.wikipedia.org/wiki/Command-line_interface command-line] over Internet in real time using [https://en.wikipedia.org/wiki/Python_(programming_language) Python]. This allows for students to follow lecturer commands and its output and avoid mistakes of rewriting commands. Streaming is going only in read-only mode. If there is edit mode needed (''aka collaborative hacking'') then probably free and open-source [https://upterm.dev/ upterm] is one of the choices you may be interested in. | ||
==Setup== | ==Setup== | ||
'''Quick install for newest version in Linux''' | '''Quick install for newest version of shellshare in Linux in case of [https://en.wikipedia.org/wiki/Bash_(Unix_shell) Bash] shell''' | ||
mkdir -p ~/.local/bin/ && wget https://raw.githubusercontent.com/vitorbaptista/shellshare/master/public/bin/shellshare -O ~/.local/bin/shellshare && chmod +x ~/.local/bin/shellshare | mkdir -p ~/.local/bin/ && wget -q --show-progress https://raw.githubusercontent.com/vitorbaptista/shellshare/master/public/bin/shellshare -O ~/.local/bin/shellshare && chmod u+x ~/.local/bin/shellshare | ||
echo "alias shortname='shellshare --server linux.itcollege.ee:3000 --room roomname --password roompassword'" >> ~/.bash_aliases && source ~/.bash_aliases | echo "alias shortname='shellshare --server http://linux.itcollege.ee:3000 --room roomname --password roompassword'" >> ~/.bash_aliases && source ~/.bash_aliases | ||
Please replace ''shortname, roomname, roompassword'' with appropriate values, you wish to use. | Please replace ''shortname, roomname, roompassword'' with appropriate values, you wish to use. | ||
For ensuring the used path works in case of [https://en.wikipedia.org/wiki/Bash_(Unix_shell) Bash] there must be in ''~/.bashrc'' the following lines: | |||
# set PATH so it includes user's private bin if it exists | |||
if [ -d "$HOME/.local/bin" ] ; then | |||
PATH="$HOME/.local/bin:$PATH" | |||
fi | |||
for applying changes in ''~/.bashrc'': | |||
source ~/.bashrc | |||
... or close all existing Bash terminal sessions and reopen the terminal. | |||
If there is any [https://en.wikipedia.org/wiki/Category:Unix_shells other shell] in use, then its configuration requirements must be followed. | |||
From now on, it is enough to open the terminal and you can quickly use it by entering the specified short command name. When started, the terminal also says the address from which others can then see the commands entered in the terminal, in near real time. This address can also be shared with students in a timely manner, which students can then open during class. | From now on, it is enough to open the terminal and you can quickly use it by entering the specified short command name. When started, the terminal also says the address from which others can then see the commands entered in the terminal, in near real time. This address can also be shared with students in a timely manner, which students can then open during class. | ||
Line 81: | Line 101: | ||
==Streaming== | ==Streaming== | ||
* to start streaming the command-line in real time: | * to start streaming the command-line in (almost) real time: | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
python /location/shellshare.py --server linux.itcollege.ee:3000 --room roomname --password qwerty | python /location/shellshare.py --server http://linux.itcollege.ee:3000 --room roomname --password qwerty | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* replace | * replace | ||
Line 110: | Line 130: | ||
==Special thanks== | ==Special thanks== | ||
'''Special thanks goes to | '''Special thanks goes to TalTech IT College Linux administrator Veiko Tuul to set up server side and offering such a great opportunity!''' | ||
==Links== | ==Links== |
Latest revision as of 00:47, 28 April 2023
Eesti keeles
IT Kolledž: http://linux.itcollege.ee:3000
avalik teenus: https://shellshare.net/
Versioon 1.1.0 lisab MS Windowsi toetuse ilma emuleerimiseta.
Võimalus jagada käsurida Pythoni abil reaalajas veebipõhiselt ja võimaldada õppuritel paremini jälgida tunnis antud käske ja nende väljundit ja vältida ümberkirjutamisest tekkivaid vigu. Võimalus ka virtuaalmasinast otse käsurida edastada. Edastamine toimub vaid vaatamisrežiimis. Kui soovitakse muutmisrežiimis (aka collaborative hacking) siis näiteks vabavaraline upterm võib huvi pakkuda.
Paigaldamine
Uusima shellshare'i versiooni kiire paigaldus Linuxis kestprogrammi Bash korral
mkdir -p ~/.local/bin/ && wget -q --show-progress https://raw.githubusercontent.com/vitorbaptista/shellshare/master/public/bin/shellshare -O ~/.local/bin/shellshare && chmod u+x ~/.local/bin/shellshare
echo "alias lühikäsunimi='shellshare --server http://linux.itcollege.ee:3000 --room ruuminimi --password ruumisalasõna'" >> ~/.bash_aliases && source ~/.bash_aliases
Palun asendada lühikäsunimi, ruuminimi, ruumisalasõna soovitud väärtustega.
Kasutatud otsiteekonna (path) toimimiseks Bash'i korral tuleb jälgida, et ~/.bashrc sisaldaks ridu:
# set PATH so it includes user's private bin if it exists if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH" fi
~/.bashrc muudatuste jõustamiseks:
source ~/.bashrc
... või siis sulgeda kõik senised terminalide sessioonid ja avada uuesti terminal. Kui on mõni teine kestprogramm kasutusel, siis tuleb jälgida selle seadistuse nõudeid.
Edaspidi piisab terminali avamisest ja saab määratud lühikäsunime sisestades kiirelt kasutada. Selle käivitamisel öeldakse terminalis ka aadress, mille pealt teised siis terminali sisestatud käske näevad, peaaegu reaalajas. Seda aadressi saab aegsasti ka õppuritele jagada, mida tunni ajal siis avada saab.
- skripti allalaadimine https://github.com/vitorbaptista/shellshare/releases - valida Latest Release
- on olemas ka programmi koduleht kus allalaadimise viide kuid võib juhtuda, et see ei tööta
- lahtipakitud kaustast leiab skripti public/bin/shellshare - selle võib ka ringi nimetada shellshare.py ja kopeerida endale meelepärasesse asukohta, võib paralleelselt ka sobivasse kohta veebis paigutada, et kiirelt näiteks virtuaalmasinasse alla laadida
Edastamine
- käsurea (peaaegu) reaalajas edastamise alustamiseks:
python /asukoht/shellshare.py --server http://linux.itcollege.ee:3000 --room ruuminimi --password salasõna
- asendada
- asukoht tegeliku shellshare.py asukohaga arvuti kõvakettal
- ruuminimi soovitud nimega
- salasõna soovitud salasõnaga
- terminali edastamine on nähtav peale ülalnimetatud käsu käivitamist käsureal näidatud aadressil http://linux.itcollege.ee:3000/r/ruuminimi kus ruuminimi asemel on valitud nimetus
- veebi edastatud käsud on kopeeritavad, ajalugu vaadatav tagasi kerides (ei ole soovitav käsurida vahepeal puhastada)
- ka käsureal avatavad failid, man-lehed jne on kuvatavad; liikumine, klaviatuuri abil teksti märkimine kuvatakse ka veebivoos
Toetatud on ka mitmest terminalist korraga samale aadressile käsurea edastamine - nii on võimalik samaaegselt edastada käsurida klassiarvutist, virtuaalmasinast jne korraga samale sessioonile - nii on õppuri jaoks info ühes kohas. Info tuleb ära kopeerida, sest edastamise lõppemisel ja akna sulgemisel ajalugu ei säili.
Kui kirjutada:
python /asukoht/shellshare.py --room ruuminimi --password salasõna
... siis edastatakse shellshare.net serveri kaudu kui see töötab.
Kiire kasutamine
Võimalus teha ka lühikäsk ehk alias (vt Alias bash shellis, .bash_aliases), skript vms käsurea jagamise kiireks käivitamiseks soovitud ruuminimega
Edastamise lõpetamine
Käsurea edastamise lõpetamine: exit+Enter, sageli toimib ka CTRL+D
Erilised tänud
Erilised tänud TalTechi IT Kolledži Linuxi administraatorile Veiko Tuul serveripoole käivitamise ja selle suurepärase võimaluse loomise eest!
Viited
in English
IT College: http://linux.itcollege.ee:3000
public service: https://shellshare.net/
Version 1.1.0 adds MS Windows support without emulation.
There is an option to share command-line over Internet in real time using Python. This allows for students to follow lecturer commands and its output and avoid mistakes of rewriting commands. Streaming is going only in read-only mode. If there is edit mode needed (aka collaborative hacking) then probably free and open-source upterm is one of the choices you may be interested in.
Setup
Quick install for newest version of shellshare in Linux in case of Bash shell
mkdir -p ~/.local/bin/ && wget -q --show-progress https://raw.githubusercontent.com/vitorbaptista/shellshare/master/public/bin/shellshare -O ~/.local/bin/shellshare && chmod u+x ~/.local/bin/shellshare
echo "alias shortname='shellshare --server http://linux.itcollege.ee:3000 --room roomname --password roompassword'" >> ~/.bash_aliases && source ~/.bash_aliases
Please replace shortname, roomname, roompassword with appropriate values, you wish to use.
For ensuring the used path works in case of Bash there must be in ~/.bashrc the following lines:
# set PATH so it includes user's private bin if it exists if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH" fi
for applying changes in ~/.bashrc:
source ~/.bashrc
... or close all existing Bash terminal sessions and reopen the terminal. If there is any other shell in use, then its configuration requirements must be followed.
From now on, it is enough to open the terminal and you can quickly use it by entering the specified short command name. When started, the terminal also says the address from which others can then see the commands entered in the terminal, in near real time. This address can also be shared with students in a timely manner, which students can then open during class.
- download the appropriate script at https://github.com/vitorbaptista/shellshare/releases - choose Latest Release
- there is also program homepage where download command is described but it might happen that the site is offline
- from unpacked folder there can be found the script in public/bin/shellshare - this can be renamed to shellshare.py and copy whenever needed. There is also possible to copy unpacked shellshare script to somewhere in the web so you can quickly download e.g. into virtual machine.
Streaming
- to start streaming the command-line in (almost) real time:
python /location/shellshare.py --server http://linux.itcollege.ee:3000 --room roomname --password qwerty
- replace
- location with real shellshare.py location on computer hard drive
- roomname with wanted name
- qwerty with real password
- command-line streaming is visible at http://linux.itcollege.ee:3000/r/roomname after running mentioned command, where instead of roomname there is chosen name
- streamed commands online can be copied, history is reviewable by scrolling up (do not clear the screen in command-line)
- also files that can be opened in command-line, man-pages, etc; moving, marking text with keyboard are shown in web stream
Also streaming simultaneously from multiple command-line interfaces to the same address is supported. You can stream from classroom computer, virtual machine, etc to the same session - in that way all information is on the same place. The information should be copied to permanent place because after stopping the streaming and closing the window also history will be gone.
If to write:
python /asukoht/shellshare.py --room roomname --password qwerty
... then through the shellshare.net server will be streamed if it works.
Fast usage
There can be an alias created (see also .bash_aliases), script etc to start quickly streaming command-line with appropriate settings.
Stop streaming
To stop command-line streaming: exit+Enter, usually also CTRL+D works.
Special thanks
Special thanks goes to TalTech IT College Linux administrator Veiko Tuul to set up server side and offering such a great opportunity!