Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thomasleplus/bazaar
All sorts of unix utilities
https://github.com/thomasleplus/bazaar
curl http https linux shell shell-script shell-scripting shell-scripts shellscript unix unix-utilities
Last synced: about 2 months ago
JSON representation
All sorts of unix utilities
- Host: GitHub
- URL: https://github.com/thomasleplus/bazaar
- Owner: thomasleplus
- License: apache-2.0
- Created: 2019-08-10T21:42:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T16:15:52.000Z (2 months ago)
- Last Synced: 2024-10-25T22:39:32.677Z (about 2 months ago)
- Topics: curl, http, https, linux, shell, shell-script, shell-scripting, shell-scripts, shellscript, unix, unix-utilities
- Language: Shell
- Homepage:
- Size: 124 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# bazaar
All sorts of unix utilities
[![ShellCheck](https://github.com/thomasleplus/bazaar/workflows/ShellCheck/badge.svg)](https://github.com/thomasleplus/bazaar/actions?query=workflow:"ShellCheck")
## [connectivity-check](connectivity-check)
### Overview
This script mimics the internet connectivity checks of various operating systems (iOS, Android, Mac OS, Windows, Linux...). Just run the script and it will start fetching various test pages.
If your network access is not working (Wi-Fi disconnected, problem with the ethernet cable or modem router), you will see error messages like `curl: (7) Couldn't connect to server`.
If you have internet access, the HTTP status codes of the responses will be from the 2XX Success class (e.g. 200 OK or 204 No Content).
> Note that if the URLs ending in `generate_204` do not return a 204 HTTP status code, or if you see error messagges like `curl: (6) Could not resolve host`, your connection might be blocked by a captive portal using [DNS Redirection](https://en.wikipedia.org/wiki/Captive_portal#Redirect_by_DNS) instead of [HTTP redirection](https://en.wikipedia.org/wiki/Captive_portal#HTTP_redirect). You can confirm this by looking to the responses to the SSL URLs.
If you have network connectivity but you do not have internet access because, for example, you have not yet signed into some sort of captive portal, you will probably get some sort of 3XX Redirection HTTP status code (e.g. 307 Temporary Redirect or 302 Found) followed by the URL of the captive portal.
Finally if you get a 4XX or 5XX HTTP error status code, it probably means that the corresponding requested URL is not valid anymore (or maybe the service is having some temporary issues).
### Samples
This is the program's output when internet is accessible:
```
$ connectivity-check
GET http://connectivity-check.ubuntu.com
HTTP/1.1 204 No ContentGET http://www.neverssl.com
HTTP/1.1 200 OKGET http://www.msftconnecttest.com/connecttest.txt
HTTP/1.1 200 OKGET http://www.msftncsi.com/ncsi.txt
HTTP/1.1 200 OKGET http://clients3.google.com/generate_204
HTTP/1.1 204 No ContentGET http://connectivitycheck.android.com/generate_204
HTTP/1.1 204 No ContentGET http://connectivitycheck.gstatic.com/generate_204
HTTP/1.1 204 No ContentGET http://captive.apple.com/hotspot-detect.html
HTTP/1.1 200 OKGET http://www.apple.com/library/test/success.html
HTTP/1.1 200 OKGET https://www.google.com
HTTP/1.1 200 OKGET https://www.apple.com
HTTP/1.1 200 OK
```And this is what the output looks like when the internet access is being blocked by a captive portal doing DNS spoofing:
```
$ connectivity-check
GET http://connectivity-check.ubuntu.com
curl: (52) Empty reply from serverGET http://www.neverssl.com
curl: (52) Empty reply from serverGET http://www.msftconnecttest.com/connecttest.txt
curl: (52) Empty reply from serverGET http://www.msftncsi.com/ncsi.txt
curl: (52) Empty reply from serverGET http://clients3.google.com/generate_204
curl: (52) Empty reply from serverGET http://connectivitycheck.android.com/generate_204
curl: (52) Empty reply from serverGET http://connectivitycheck.gstatic.com/generate_204
curl: (52) Empty reply from serverGET http://captive.apple.com/hotspot-detect.html
curl: (52) Empty reply from serverGET http://www.apple.com/library/test/success.html
curl: (52) Empty reply from serverGET https://www.google.com
curl: (51) SSL: no alternative certificate subject name matches target host name 'www.google.com'GET https://www.apple.com
curl: (51) SSL: no alternative certificate subject name matches target host name 'www.apple.com'
```https://rootsh3ll.com/captive-portal-guide/
## [open-clipboard](open-clipboard)
Reads a file path or URL from the clipboard and opens it in the corresponding system default application. I have this command associated to a custom keyboard shortcut (Ctrl+B). This is particularly useful and easy to remember when you want to open a non-clickable URL: just select the URL text and do Ctrl+C then Ctrl+B to open in default browser.