GithubHelp home page GithubHelp logo

ishare2-org / ishare2-cli Goto Github PK

View Code? Open in Web Editor NEW
72.0 3.0 13.0 1.59 MB

A tool to automate the download of images from labhub.eu.org

Home Page: https://labhub.eu.org

License: GNU General Public License v3.0

Shell 97.46% Roff 2.54%
eve-ng ishare2 networking pnetlab unetlab bash bash-script cli-app dynamips iol

ishare2-cli's Introduction

ishare2-cli

A CLI tool written in Bash to easily download and manage images in your PNetLab server

Table of contents

Quick start ๐Ÿš€

ishare2 is a tool that helps you download and manage images in your network emulators easily. ishare2 can download qemu, dynamips, bin/iol and docker images. It can also download images needed for labs automatically. To get started, use the one of the installation methods below.

One-line installation

wget

wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/ishare2-org/ishare2-cli/main/ishare2 && chmod +x /usr/sbin/ishare2 && ishare2

curl

curl -O /usr/sbin/ishare2 https://raw.githubusercontent.com/ishare2-org/ishare2-cli/main/ishare2 && chmod +x /usr/sbin/ishare2 && ishare2

Note: Run the command as root or using sudo

Line by line installation

  1. Download ishare2
wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/ishare2-org/ishare2-cli/main/ishare2
  1. Make ishare2 executable
chmod +x /usr/sbin/ishare2
  1. Run ishare2
ishare2

Note: Run the command as root or using sudo

Install by cloning the repository

  • Download or clone this repository.

    git clone https://github.com/ishare2-org/ishare2-cli.git
  • Copy the file to /usr/sbin/ishare2

    cp ishare2-cli/ishare2 /usr/sbin/ishare2
  • Make the file executable using

    chmod +x /usr/sbin/ishare2
  • Run ishare2 to start using it

    ishare2

Note: Run the command as root or using sudo

ishare2 commands

ishare2 uses the following syntax to execute different actions, each action is explained in detail below:

    ishare2 [action] [param1] [param2]

    action:
      search      : Search for images by type
      pull        : Download an image by type and number
      installed   : Show installed images on server
      labs        : Show labs on server and download images for those labs
      mylabs      : Same as labs command but using a customized path to labs
      relicense   : Generate a new iourc license for bin images
      upgrade     : Retrieves a menu that allows users to upgrade ishare2 and PNETLab VM
      changelog   : Show the latest changes made to ishare2
      gui         : Web app to use ishare2 in browser
      help        : Show useful information
      test        : Test if ishare2 dependencies are reachable (GitHub, Google Spreadsheets)

    param1:
      type = all, bin, qemu, dynamips, docker or name

    param2:
      number = This number can be obtained using ishare2 search <type>

How to use ishare2

Search for images

Search by name

You can search for images by simply typing the name of the image you want to search for using the following syntax:

ishare2 search <name> # Example: ishare2 search vios

Searches by name should be done taking into account the naming conventions used by emulators. For example, if you want to search for images of Cisco IOSv, you should use the following command:

ishare2 search vios # Will show all Cisco IOSv images available

For qemu images, you can follow the conventions used by eve-ng. For example, if you want to search for images of Windows 7, you should use the following command:

ishare2 search win- # Will show all Windows images available

Other examples:

ishare2 search winserver  # Will show all Windows Server images available
ishare2 search linux      # Will show all Linux images available
ishare2 search forti      # Will show all Fortinet images available
ishare2 search palo       # Will show all Palo Alto images available
ishare2 search Licensed   # Will show all images with keyword "Licensed" in their name

Note: You can also also search for images using common keywords for specific Operating Systems.

Search by type

You can search for images by type using the following commands:

ishare2 search all      # This command will show all available images of all types
ishare2 search bin      # This command will show all available images of bin/iol type
ishare2 search qemu     # This command will show all available images of qemu type
ishare2 search dynamips # This command will show all available images of dynamips type

You can narrow your search by specifying the type of image you are looking for by using the following syntax:

ishare2 search <type> <name> # Example: ishare2 search bin vios

For example, if you want to search for images of Cisco IOSv, you should use the following command:

ishare2 search iol vios # Will show all Cisco IOSv images of the type bin/iol available

For qemu images, you can do the following:

ishare2 search qemu win- # Will show all Windows images of the type qemu available

For dynamips images, you can do the following:

ishare2 search dynamips c7200 # Will show all Cisco 7200 images of the type dynamips available

Pull images

In order to download images, you have to specify the type of image and id number using the following syntax:

ishare2 pull <type> <id>

Syntax for each type:

ishare2 pull bin <id>
ishare2 pull qemu <id>
ishare2 pull dynamips <id>

Note: You get the id number from the search results ishare2 displays after running the search command.

Download all images at once

You can download all images at once using the following syntax:

ishare2 pull all <type>

Commands for each type:

ishare2 pull bin all      # Will download all bin/iol images available
ishare2 pull qemu all     # Will download all qemu images available
ishare2 pull dynamips all # Will download all dynamips images available

Note: This is not recommended because it will take a long time to download all images, you will use a lot of our bandwidth and you will probably run out of disk space.

Show installed images

You can see which images are installed on your server using the following commands:

ishare2 installed all       # Will show all installed images from all types
ishare2 installed bin       # Will show all bin/iol images installed
ishare2 installed qemu      # Will show all qemu images installed
ishare2 installed dynamips  # Will show all dynamips images installed
ishare2 installed docker    # Will show all docker images installed

Download images for a lab

ishare2 can automatically download all images needed for a lab. This feature is available for .unl labs (usually downloaded from the PNetLab Store).

ishare2 labs          # Will show all labs available
ishare2 labs <number> # Will download images for the lab with the specified number
ishare2 labs all      # Will download images for all labs available

Note: Feature not available for encrypted labs since ishare2 can't read the contents of those labs.

Download images for a lab using a custom path

You can specify a custom path for ishare2 to look for labs using the following syntax:

ishare2 mylabs <path>           # Will show all labs available in the specified path
ishare2 mylabs <path> <number>  # Will download images for the lab with the specified number
ishare2 mylabs <path> all       # Will download images for all labs available in the specified path

ishare2 GUI

ishare2 has a web app that allows you to use ishare2 in your browser. To use it, you have to install it using the following command:

ishare2 gui install

Control the ishare2 GUI service using the following commands:

ishare2 gui start
ishare2 gui stop
ishare2 gui restart
ishare2 gui status

Extra features

We have covered the most important features of ishare2, but there are some extra features that you might find useful:

Generate a new iourc license for bin images

You can generate a new iourc license for bin images using the following command:

ishare2 relicense

This command will generate a new iourc license and restore the needed files to make it work in case you have accidentally deleted them.

Upgrade ishare2, ishare2-gui or PNETLab server

Use the following command to upgrade ishare2, ishare2-gui or your PNETLab server:

ishare2 upgrade

Select the option you want to upgrade and wait for the process to finish.

Show the latest changes made to ishare2

You can see the latest registered changes made to ishare2 using the following command:

ishare2 changelog

Show useful information

You can see useful information about ishare2 using the following command:

ishare2 help

Test connectivity

You can test if ishare2 online dependencies are reachable using the following command:

ishare2 test

Useful information

HELP.md

See the latest changes on ishare2

CHANGELOG.md

Known limitations

  • Quota Limits:
    You might encounter quota limits when downloading images. If that happens, you can wait a few minutes and try again. If the problem persists, please contact us through our Telegram group. Search the link to the group chat in the channel's pinned message or click the chat icon in the channel's description: @NetLabHub (By not sharing the link here, we avoid spam and bots in the group chat)

Links of interest

  • LabHub: Source of images indexed by ishare2. You can also download images from here using your browser.
  • PNETLab Store: Download labs for PNETLab.

Devices credentials

Visit the following links to see the credentials for devices available in LabHub:

Ask for help

You can get help by contacting us through our Telegram group. Search the link to the group chat in the channel's pinned message or click the chat icon in the channel's description: @NetLabHub (By not sharing the link here, we avoid spam and bots in the group chat)

ishare2-cli's People

Contributors

pnetlabrepo avatar renovate[bot] avatar sudoalx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ishare2-cli's Issues

I can't remove the system

Why is there no option to remove ishar2? I need to remove it and now I can't figure out how to do it

GPG error: http://i-share.top/repo

I'm receiving the following error:

Reading package lists... Done
E: GPG error: http://i-share.top/repo ./ Release: Signed file isn't valid, got 'NODATA' (does the network require authentication?)
 [-] Failed to update package lists.

Upon accessing http://i-share.top/repo I verify that the domain is for sale.

How to release the online mode owner without the owner password?

After installing and upgrading pnetlab v6 through ishare2, I found that the owner in online mode is not free box but jsilva. How should I release the owner jsilva? I don't have his password.

system online mode on system online mode off

If this problem cannot be solved, my pnetlab box will not be able to log in to its own online users.

pnetlab online login interface

Ishare2 GUI notworking

Hello everyone,
I have installed Ishare2 GUI many times, but today I can't install Ishare2 GUI anymore,

root@pnetlab:/opt/unetlab/addons/qemu# isare2 upgrade

  1. Upgrade ishare2
  2. Upgrade PNETLab
  3. Upgrade isshare2 GUI
  4. Exit
    Please, choose an option: 3
    [+] isare2 GUI is being downloaded and installed. Please, wait until the process is done...
    [!] Stopping isare2 GUI service...

[-] isare2 GUI installation was canceled.
root@pnetlab:/opt/unetlab/addons/qemu# ishare2 gui install
[+] isare2 GUI is being downloaded and installed. Please, wait until the process is done...
[!] Stopping isare2 GUI service...

[-] isare2 GUI installation was canceled.

ishare2: 3.3.5-main Up to date
ishare2 Channel: main
PNETLab v6.0.0-100 is installed.
OS: Ubuntu 20.04

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

None detected


  • Check this box to trigger a request for Renovate to run again on this repository

can't install gui python error

got this error:

root@pnetlab:~# ishare2 gui install
Error: Python 3.11 is not installed.
Do you want to install Python 3.11?

[-] ishare2 GUI installation was canceled.
root@pnetlab:~#

Cant get gui to work

Tried clean install of pnetlab and ishare2cli

when I do ishare2 gui start or upgrade or install I get this error.

root@pnetlab:~# ishare2 gui start
Failed to start ishare2_gui.service: Unit ishare2_gui.service not found.
[-] Error starting ishare2 GUI service.
[-] Please see the logs for troubleshooting. Run: systemctl status ishare2_gui.service

I've tried both OVA file from pnetlab and clean install with ubuntu ubuntu-20.04.6-live-server-amd64 installing ishare and pnetlab v6 there.

Always have issue with ishare2. I used to have a working ishare2 before it was ishare2cli.

if i use only ishare2 pull/search it will work just not the gui part.

Installing ishare2 dependencies... ERROR https://repo.pnetlab.com ./ Packages - Certificate verification failed

root@pnetlab:~# wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/ishare2-org/ishare2-cli/main/ishare2 && chmod +x /usr/sbin/ishare2 && ishare2
--2023-12-25 08:55:55-- https://raw.githubusercontent.com/ishare2-org/ishare2-cli/main/ishare2
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.111.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 65034 (64K) [text/plain]
Saving to: โ€˜/usr/sbin/ishare2โ€™

/usr/sbin/ishare2 100%[====================================================================================================================================================================================================>] 63.51K --.-KB/s in 0.03s

2023-12-25 08:55:55 (1.81 MB/s) - โ€˜/usr/sbin/ishare2โ€™ saved [65034/65034]

[*] Installing ishare2 dependencies...
Reading package lists... Done
Building dependency tree
Reading state information... Done
curl is already the newest version (7.58.0-2ubuntu3.24).
The following packages were automatically installed and are no longer required:
libnetplan0 python3-netifaces
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 380 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
wget is already the newest version (1.19.4-1ubuntu2.2).
The following packages were automatically installed and are no longer required:
libnetplan0 python3-netifaces
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 380 not upgraded.
[+] jq is not installed.
[+] Updating package lists...
Hit:1 http://vn.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://vn.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://vn.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:5 http://vn.archive.ubuntu.com/ubuntu bionic-security InRelease
Ign:4 https://repo.pnetlab.com ./ InRelease
Ign:6 https://repo.pnetlab.com ./ Release
Ign:7 https://repo.pnetlab.com ./ Packages
Ign:8 https://repo.pnetlab.com ./ Translation-en
Ign:7 https://repo.pnetlab.com ./ Packages
Ign:8 https://repo.pnetlab.com ./ Translation-en
Ign:7 https://repo.pnetlab.com ./ Packages
Ign:8 https://repo.pnetlab.com ./ Translation-en
Ign:7 https://repo.pnetlab.com ./ Packages
Ign:8 https://repo.pnetlab.com ./ Translation-en
Ign:7 https://repo.pnetlab.com ./ Packages
Ign:8 https://repo.pnetlab.com ./ Translation-en
Ign:7 https://repo.pnetlab.com ./ Packages
Ign:8 https://repo.pnetlab.com ./ Translation-en
Err:7 https://repo.pnetlab.com ./ Packages
Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. Could not handshake: Error in the certificate verification. [IP: 14.225.16.78 443]
Ign:8 https://repo.pnetlab.com ./ Translation-en
Reading package lists... Done
E: Failed to fetch https://repo.pnetlab.com/./Packages Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. Could not handshake: Error in the certificate verification. [IP: 14.225.16.78 443]
E: Some index files failed to download. They have been ignored, or old ones used instead.
[-] Failed to update package lists.

Resource temporarily unavailable

Reading package lists... Done
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
[-] Failed to update package lists.
[!] Attempting to fix APT sources...
Reading package lists... Done
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
[-] Failed to fix APT sources.

Can you helpme for this ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.