Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dmuhs/little-helpers

:coffee: Some small helper scripts I hacked up in my day to day business
https://github.com/dmuhs/little-helpers

Last synced: 9 days ago
JSON representation

:coffee: Some small helper scripts I hacked up in my day to day business

Awesome Lists containing this project

README

        

# Little Helpers
Some small helper scripts I hacked up in my day to day business.

## Requirements
All Python scripts run on Python 3, because you should let Python 2.x die already and move on with your life. To provide a sweet cli and avoid any pesky argparse code I use [click](http://click.pocoo.org/). Simply install it by running `pip3 install click`.

### geoip.py
Looks up the location data (if available) for any valid IPv4 or IPv6 address using the [nekudo geolocation API](http://geoip.nekudo.com/).

### docker-clean.sh
Removes all docker containers shown in `docker ps -a` that are **currently not running** and newline-separatedly outputs their IDs. Example:
```bash
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ecffc300d8a3 hello-world:latest "/hello" 6 seconds ago Exited (0) 6 seconds ago lonely_stallman
c7ed3897180f hello-world:latest "/hello" 7 seconds ago Exited (0) 6 seconds ago fervent_banach
7f59c19a3e50 hello-world:latest "/hello" 7 seconds ago Exited (0) 6 seconds ago prickly_goldstine
$ ./docker-clean.sh
ecffc300d8a3
c7ed3897180f
7f59c19a3e50
```

### url-size.py
Displays the size of a given URL based on its Content-Length in a human-readable format. Especially useful when you're stuck with a bad download rate, need to estimate dependency downloads and the build tool only provides you with resource links.