This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- encoding: utf-8 -*- | |
| import subprocess | |
| class command(object): | |
| def __init__(self, cmd): | |
| self._cmd = cmd | |
| def __call__(self, *args, **kwargs): | |
| cmd = [self._cmd] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # exact_count: 1 | |
| # nothing changed, instances will be in tagged_instances | |
| TASK [debug] ******************************************************************* | |
| ok: [127.0.0.1] => { | |
| "ec_aa": { | |
| "changed": false, | |
| "instance_ids": null, | |
| "instances": [], | |
| "tagged_instances": [ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/expect | |
| set timeout -1; | |
| spawn {{django_dir}}/venv/bin/python manage.py changepassword {{admin_user}}; | |
| expect { | |
| "Password:" { exp_send "{{admin_pass}}\r" ; exp_continue } | |
| "Password (again):" { exp_send "{{admin_pass}}\r" ; exp_continue } | |
| eof | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| TARBALL="swift-2.2.tar.gz" | |
| TARBALL_SIG="swift-2.2.tar.gz.sig" | |
| SWIFT_TARBALL_URL="https://swift.org/builds/ubuntu1404/swift-2.2-SNAPSHOT-2015-12-01-b/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04.tar.gz" | |
| SWIFT_TARBALL_SIG_URL="https://swift.org/builds/ubuntu1404/swift-2.2-SNAPSHOT-2015-12-01-b/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04.tar.gz.sig" | |
| DESTDIR="/opt/swift-2.2" | |
| if [ ! -e "$TARBALL" ]; then | |
| wget "$SWIFT_TARBALL_URL" -O "$TARBALL" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # ^^^ YAML documents must begin with the document separator "---" | |
| # | |
| #### Example docblock, I like to put a descriptive comment at the top of my | |
| #### playbooks. | |
| # | |
| # Overview: Playbook to bootstrap a new host for configuration management. | |
| # Applies to: production | |
| # Description: | |
| # Ensures that a host is configured for management with Ansible. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - name: Provision servers | |
| hosts: 127.0.0.1 | |
| connection: local | |
| tasks: | |
| - name: add host | |
| add_host: hostname=127.0.0.1 groupname=xmpp | |
| - include: playbook2.yml passed_to_me='Hello, John' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # Need python-libvirt | |
| from __future__ import print_function, unicode_literals | |
| import sys | |
| import libvirt | |
| from xml.etree import ElementTree | |
| from subprocess import check_output | |
| import re |
We can't make this file beautiful and searchable because it's too large.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "繞繞繞繞口令","http://www.taaze.tw/gift_sing.html?pid=81300014968" | |
| "要活就要動!","http://www.taaze.tw/gift_sing.html?pid=81300014969" | |
| "上海攻略-上海最値得","http://www.taaze.tw/gift_sing.html?pid=81300014971" | |
| "中國現代作家選集8:","http://www.taaze.tw/gift_sing.html?pid=81300014973" | |
| "會計學新論解答(全一","http://www.taaze.tw/gift_sing.html?pid=81300014977" | |
| "屍鬼湖","http://www.taaze.tw/gift_sing.html?pid=81300014978" | |
| "有效處理壓力的第一本","http://www.taaze.tw/gift_sing.html?pid=81300014873" | |
| "鬼靈精一族","http://www.taaze.tw/gift_sing.html?pid=81300014874" | |
| "我要擺脫煩惱","http://www.taaze.tw/gift_sing.html?pid=81300014875" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Refer https://docs.docker.com/reference/commandline/ps/ to get more usage about filter(-f). | |
| docker ps -f "status=exited" -q | xargs docker rm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Need to do the following steps: | |
| # 1. create /var/prometheus first. | |
| # 2. run: docker-compose run promdash ./bin/rake db:migrate | |
| nodeexporter: | |
| image: prom/node-exporter | |
| ports: | |
| - "9100:9100" | |
| prometheus: | |
| image: prom/prometheus |