Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Butterfly easy-to-use tutorial

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Butterfly lets you display everyday terminals in your browser, like it? Let's try it together.

install butterfly$ sudo pip install butterfly #Install butterfly$butterfly.server.py--insecure #Start an insecure web server

Then all you have to do is open: localhost:57575

How to use: Server side

Run at startup using systemd

Since it depends on services running in the background, you can download the systemd file where butterfly.service is located from here, in/etc/systemd/system/or equivalent, and:

$ sudo systemctl enable butterfly$ sudo systemctl start butterfly

The server will now always be running.

Run as root and multiple users

Butterfly can be used as both end user and root user. When running as root, privileges are granted to the user who initiated the connection, that is, the user who opened the web page. You can change the end user by going to localhost:57575/user/.

Access from remote machines

You can use butterfly.server.py --host="0.0.0.0" to set up a binding host, which will allow other users to connect to your terminal. Will ask for password, but password is not secure! Therefore, it is recommended that you run this program only on your local network for testing purposes from now on.

Run a specific shell

Using shell command-line options:

butterfly.server.py--shell=/bin/fish client

Butterfly works the same as any other terminal, but with some specific features.

Enter browser shortcuts

When the terminal is in focus, all hotkeys are captured (except those that the browser prevents). If you try to use CTRL + L to access the address bar, it will not work properly. That's why ALT + Z is telling Butterfly that it can't grab the next key combination. In other words, you can access the address bar by pressing ALT + Z and then CTRL + L. (If your browser supports css3 filters, the screen will turn tan).

Quick selection history text

I've been hoping to find this feature in the terminal for quick selection of history. You can try navigating through selections by pressing CTRL + SHIFT + UP, then using CTRL + SHIFT + UP/DOWN and the arrow keys. Once set correctly, press ENTER and Butterfly will enter the selection directly at the prompt:

other functions

Visual styles are done using CSS and are therefore fully editable.

You can easily extend the behavior of terminals within browsers by writing JavaScript (just like quick select actions).

in this way

The repository is hosted on github.

If you have any more ideas, please leave your valuable comments, thank you!

Original address: https://www.linuxprobe.com/butterfly-web.html

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report