To see what hosts would be affected by a playbook before you run it, you can do this:
ansible-playbook playbook.yml --list-hosts
Run Ansible playbook
ansible-playbook -i hosts site.yml
To see what hosts would be affected by a playbook before you run it, you can do this:
ansible-playbook playbook.yml --list-hosts
Run Ansible playbook
ansible-playbook -i hosts site.yml
Show line numbers: :set number
SO: How to edit multi gigabyte text files in vim
Vim will hang if you try to open up a multi-gigabyte file because it is trying to load the whole thing into a buffer. Ctrl-C will stop file load. If the file is small enough you may have been lucky to have loaded all the contents and just killed any post load steps. Verify that the whole file has been loaded when using this tip.
Vim can handle large files pretty well. I just edited a 3.4GB file, deleting lines, etc. Three things to keep in mind:
This will run the loans queue with the weight of 5
bundle exec sidekiq -q loans,5
SO: How to run Sidekiq in production
Users are stored in the users table of the mysql database.
MySQL "show users" - how to show/list the users in a MySQL database
mysql> CREATE USER 'finley'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'finley'@'localhost'
-> WITH GRANT OPTION;
Docker commands:
$ docker run --name fin-graylog-mongo -d mongo:3
$ docker run --name fin-graylog-elasticsearch -d elasticsearch:2 elasticsearch -Des.cluster.name="graylog"
$ docker run --name fin-graylog-server --link fin-graylog-mongo:mongo --link fin-graylog-elasticsearch:elasticsearch -d -e GRAYLOG_WEB_ENDPOINT="http://127.0.0.1:9000/api" -e GRAYLOG_REST_TRANSPORT_URI='http://127.0.0.1:12900' -p 9000:9000 -p 12900:12900 graylog2/server
Graylog2/graylog2-server#1908 The purpose of GRAYLOG_PASSWORD_SECRET is also under-documented and there should be a suggestion to use pwgen -N 1 -s 96 in the docker documentation (or the whole thing should be initialized on first boot with a random seed without user intervention)
Base commands:
Creating a new container
docker run [-d (runs in background] [-p <host-system-port>:<container-port>] <image:tag>
* Creates a new container from an image
* If you run it 4 times, it will create 4 containers
Options:
--name Give the container a name, otherwise it will pick a default name.
At this link <omitted> is a tab-delimited text file containing a list of members of the 114th Congress. Use these names for the following exercise. Import the list of names into a database - Oracle, SQL Server, or HANA. (PostgreSQL was used instead due to its similarity to the selections given. The other options were not readily available.)
Create a list of all possible three-letter combinations (“trigrams”), from ‘AAA’ to ‘ZZZ’, in order, with an ID column. ‘AAA’ gets ID = 1.
Parse each last name into a set of trigrams; e.g., “Brandt” contains BRA, RAN, AND, and NDT. Determine the five most common trigrams in the Congressional roster. For each last name, sum the ID values of its trigrams and determine the last names with the five highest scores.
module WAKUtils | |
def self.reload(require_regex) | |
$".grep(/#{require_regex}/).each {|e| $".delete(e) && require(e) } | |
end | |
end |