Paste.sh is a simple command-line tool that allows you to easily paste files and generate shareable URLs. It provides a convenient way to share files with others by creating a temporary web server and hosting the pasted files.
- Paste files from the command line
- Generate unique URLs for each pasted file
- Automatically create HTML pages for easy viewing of pasted files
- Start a simple web server to serve the pasted files
- Display the public IP address and local IP address for accessing the pasted files
- Bash shell
curl
command-line toolnc
(netcat) command-line tool
-
Clone the repository:
git clone https://github.com/inabakumori/paste.sh.git
-
Navigate to the project directory:
cd paste.sh
-
Make the script executable:
chmod +x paste.sh
To paste a file and generate a shareable URL, follow these steps:
-
Run the script with the path to the file you want to paste:
./paste.sh /path/to/your/file
-
The script will generate a unique URL for the pasted file and display it in the console.
-
Access the pasted file using the provided URL in a web browser.
- If you are running the script on the same machine, you can use the
localhost
URL (e.g.,http://localhost:55554/filename.html
). - If you want to access the pasted file from another device on the same network, use the local IP address URL (e.g.,
http://192.168.0.10:55554/filename.html
). - If you want to access the pasted file from a different network or the internet, use the public IP address URL (e.g.,
http://203.0.113.10:55554/filename.html
). However, note that you might be behind a NAT (Network Address Translation), and the public IP address may not be directly accessible. In such cases, you may need to configure port forwarding on your router to allow incoming connections to the specified port (55554).
- If you are running the script on the same machine, you can use the
-
The script will start a simple web server using
nc
(netcat) and serve the pasted files. It will continue running until you stop it manually by pressingCtrl+C
.
Note: This script has been successfully tested on macOS and Linux.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more information.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
- The script uses the
curl
command-line tool to retrieve the public IP address fromhttp://ifconfig.me
. - The script uses the
nc
(netcat) command-line tool to start a simple web server.
This script is provided as-is and comes with no warranty or guarantee. Use it at your own risk. The author is not responsible for any misuse or damage caused by this script.