I made a set of custom scripts for Ubuntu. I wish to share these on the Internet. Which services for sharing code with other users are available ?
There's several options , which differ in their purpose and complexity. You may choose whichever you wish.
- Ubuntu pastebin: http://paste.ubuntu.com is simplest approach to sharing, but also the worst. The links aren't permanent, as far as I know, and you can only paste code, i.e. you cannot edit it. If you want to just share script with a few friends, that's the way to go.
- Ask Ubuntu itself is a good place to share solutions. Of course, the scripts have to be within the scopes of question where you wanna post. As a benefit, if your code is found useful, community will upvote answers. Keep in mind that anything you post is under creative commons license, so expect people will have essentially full access to the code. If you want to have it copyrighted, you can use explicit license in the script ( preferably open source one).
- Software repository wesbites, such as GitHub, GitLab, and SourceForge. Most famous is GitHub. This is one of the options that I personally use. It's not very complicated, you can get around only with the web interface alone. GitHub also has something known as Gists. You can publish a script as public or private gist, and give link to it. GitHub repository is more for a collection of specific files that tie in together somehow, and usually is for large applications. Feel free to see my gists and repositories.
- Launchpad. This is somewhat a more complex option. Users can add your PPA and install the scripts via
sudo apt-get install package-name. Follow launchpad's tutorials to get started. There's couple ways to upload code there( see discussion in comments below). Use this as reference for creating
debpackages for single scripts - these can be imported to Launchpad and built using Launchpad before placing into PPA. IMHO, single script that is not over 100 lines , isn't worth putting into deb package and then on Launchpad. GitHub gist is simpler for small scripts.
- Containers and snaps. This is also somewhat more advanced option. The big plus is portability. Most famous cross-platform container options are Docker and Snap packages. Docker has its own store: https://hub.docker.com/ I don't know about snaps,though. To my knowledge there is no app store for those.
GitHub is a good choice of sharing code.
GitHub is a great place for sharing code - But be sure to include a description of the scripts, how to use them and what their primary function is.
If your intention is to share your work and allow others to use them you will have to enable them to understand your scripts easily. You may also find that members of the community who use your scripts offer to contribute improvements and offer you support with updating and fixing any issues that may arise.