Useful home-brewed small tools
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
examples
LICENSE
README.org

README.org

Tools

What is it?

Must-have tools for nomlab members; mainly small CLI scripts. It includes very site-specific scripts, but some script might be useful for other audiences.

Command list

ame
Set Slack status or send message with CLI
favico
Create simple one-letter icon for placeholder.
gem-new
Create a new Gem project in sandbox using bundler.
nginx-docker
Pull Nginx official docker image and run instantly.
rails-new
Create a new Rails project in sandbox using bundler.
slack-sweeper
Bulk remove all Slack files older than N days.
treetable
Convert markdown or org-mode style section tree into table. It is supposed to be used for conversion of issue list into table.

Descriptions

ame

Set Slack status or send message with CLI.

ame [-c CONFIG_FILE] [-t TOKEN_NAME] -m message CHANNEL TEXT
ame [-c CONFIG_FILE] [-t TOKEN_NAME] -m status ICON TEXT
  -c Set config file (default: ~/.config/ame/config.sh).
  -t Select token name found in config.sh.
  -m Select method (message or status).
examples:
  ame -m message general "Hi, there."
  ame -m status :office: "I am at office"

See also about config example examples/ame/config.sh

favico

Create simple one-letter icon for placeholder.

favico [-s size] [-c color] [-b bgcolor] [-f font] -o FILENAME STRING
examples:
  favico -s 64 -c white -b blue -o N.png 'N'
  favico -s 64 -f '/Library/Fonts/ヒラギノ丸ゴ ProN W4.ttc' -o nom.png '乃'

creates: examples/favico/N.png examples/favico/nom.png

gem-new

Create a new Gem project in sandbox using bundler.

gem-new project-name

It does:

  1. Create ./project-name directory
  2. Invoke bundle gem project-name with recommended options.
  3. Invoke bundle install --path vendor/bundle
  4. Add .gitignore from github/gitignore

nginx-docker

Pull Nginx official docker image and run instantly. You can serve your own HTML files in ~/Downloads/www/

nginx-docker {start|stop}

It does:

  1. Create minimum config file as $HOME/Downloads/nginx/nginx.conf
  2. Create minimum index.html as $HOME/Downloads/www/index.html
  3. pull official Nginx docker image and invoke:
    docker run -d -p 8080:8080 --name nginx \
    -v "$HOME/Downloads/nginx":/etc/nginx/conf.d/ \
    -v "$HOME/Downloads/www":/var/www \
    nginx
        
  4. open http://localhost:8080

rails-new

Create a new Rails project in sandbox using bundler.

rails-new project-name

It does:

  1. Create ./project-name directory
  2. Create temporal Gemfile for bootstrap
  3. Install Rails with bundler
  4. Invoke bundle exec rails new overriding initial Gemfile.
  5. Add .gitignore from github/gitignore

slack-sweeper

Bulk remove all Slack files older than N(>30) days.

Usage: slack-seeper [-n] SLACK_API_TOKEN DAYS
 -n: dry run.

For safety, this script does not remove more than 300 files.

treetable

Usage: treetable sample-todo-list.{md|org} > sample-todo-list.tex

For details about input-file format, check examples/treetable/todo-list.org or examples/treetable/todo-list.md. See also about output example examples/treetable/todo-list.pdf