davetron5000/methadone - GitHub
Framework to write command-line apps in Ruby. Comes with a nice way of processing parameter options, some utility classes and Cucumber steps for testing your CLI app.
Related cards:
Running external commands with Open3
There are various ways to run external commands from within Ruby, but the most powerful ones are Open3.capture3
and Open3.popen3
. Since those can do almost everything you would possibly need in a clean way, I prefer to simply...
Linux: Running a single unique instance of command + arguments
run-one
is a wrapper script that won't run the given command while another instance of it is running. Is brings several utility commands that offer similar behavior.
NAME
run-one - run just one instance at a time of some command and...
Manage Linux services on the command line (Ubuntu)
Ubuntu 18.04 uses systemd
to manage services.
There are basically two commands for listing all services and manipulating the state of a certain service: service
and systemctl
:
-
service
manages System V init scripts -
systemctl
control...
How to use the Capistrano 2 shell to execute commands on servers
Capistrano 2 brings the shell
command which allows you to run commands on your deployment targets.
There is also invoke
to run a command directly from your terminal.
Both commands allow running Capistrano tasks or shell commands, and scope to...
Opening Rubymine projects from the command line
To activate the shell command, go to Tools > Create Command-line Launcher
and confirm.
Now you have mine
as bash command. Run this to open a project in RubyMine:
mine path/to/my_project
Booting Rubymine
The mine
script will a...
Colorful output for several linux command line tools: grc
Because colors improve readability so much.
On Ubuntu 18.04 you can install it with sudo apt install grc
From github:
For the impatient - try following commands:
grc netstat
grc ping hostname
grc tai...
Open dialogs from shell scripts
Using the dialog
command you can launch ASCII-art dialogs from your shell scripts.
Check out man dialog
for a list of supported dialog types. Aside from simple text boxes or choice dialogs, it supports mo...
Regular Expressions - Cheat Sheet
You can write regular expressions some different ways, e.g. /regex/
and %r{regex}
. For examples, look here.
Remember that it is always a good idea [to matc...
How to: Store multiple Vim commands in macros and recall them
Vim allows recording a batch of commands as a macro. This is handy if you need to do the same things over and over.
Here is how:
- Press
q
to enter macro mode. - Press a letter (not a number!) key to assign a slot to your macro.
- You are n...