There exists a way in the shell to do different kinds of checks, like if a file exists:
$ if [ -e some-file ]; then echo exists; fi
exists
There exists a way in the shell to do different kinds of checks, like if a file exists:
$ if [ -e some-file ]; then echo exists; fi
exists
#!/usr/bin/env bash | |
set -eu | |
portainer=https://example.com | |
user=name | |
password=... | |
endpoint=name | |
stack=name | |
auth_resp=$(http POST "$portainer/api/auth" Username="$user" Password="$password") |
There are basically two modes in which ssh
can operate: 1) interactive, 2) non-interactive. These are not official terms. I'm using them here in place of otherwise wordy names like, "an ssh session with an allocated pseudo terminal." To run a command in non-interactive mode you do:
$ ssh host echo test
Interactive mode is entered when you either do:
Debian Wheezy
/opt/eff.org/certbot/venv/bin/python: No module named pip.__main__; 'pip' is a package and cannot be directly executed
Traceback (most recent call last):
File "/tmp/tmp.Xxcju1yqBr/pipstrap.py", line 177, in <module>
sys.exit(main())
File "/tmp/tmp.Xxcju1yqBr/pipstrap.py", line 149, in main
pip_version = StrictVersion(check_output([python, '-m', 'pip', '--version'])
File "/usr/lib/python2.7/subprocess.py", line 544, in check_output
config/environments/production/custom.json
:
{
"prefixed-router": {
"enabled": true
}
}
I was building a docker image. Nothing foretold troubles, but then:
Step 7/13 : RUN SECRET_KEY_BASE=`bin/rake secret` RAILS_ENV=production bin/rails assets:precompile
---> Running in 51605ddacc67
FATAL: Listen error: unable to monitor directories for changes.
Visit https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers for info
on how to fix this.
You might have run, or might run in the future (or never run for that mater)
into the following issue. Let's do bundle init
, create 1.rb
:
require 'rubygems'
require 'bundler'
Bundler.setup(:default)
Then add require 'byebug'; debugger
to the beginning of the
The straightforward answer is: "You can't." But a more deliberate one would be:
"You can't after Bundle.setup
has finished executing."
But how does it achieve that? First we've got to clarify a couple of things about rubygems
and the require
method.
The bare require
method knows nothing about gems. It requires files, resolving their names (paths indeed)
relative to paths from the $LOAD_PATH
variable. $LOAD_PATH
is not particularly big at the start of an invocation:
version: '3' | |
services: | |
s1: | |
image: postgres:12 | |
container_name: ${prefix}_compose_anonymous | |
ports: | |
- $pg_port:5432 |
class A | |
def im; end | |
def self.cm; end | |
end | |
def superclasses c | |
r = [] | |
while c.superclass | |
r << c.superclass | |
c = c.superclass |