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 | |
| # Just a wrapper to deal with charms branches in my own customized way | |
| # use it under your own risk!. | |
| # Example: | |
| # $ charm-branch ceph lp1449279 next | |
| # bzr branch lp:~openstack-charmers/charms/trusty/ceph/next ceph.lp1449279 | |
| # Branched 106 revisions. | |
| set -e | |
| CHARM_DEVEL_ROOT=$HOME/Projects/charms/devel | |
| if [ ! -d $CHARM_DEVEL_ROOT ]; then |
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 | |
| # Example: | |
| # $ pa-def-sink | |
| # * index: 0 | |
| # name: <alsa_output.pci-0000_00_03.0.hdmi-stereo> | |
| # index: 1 | |
| # name: <alsa_output.usb-Sony_Computer_Entertainment_Wireless_Stereo_Headset-00-Headset.iec958-stereo> | |
| # index: 2 | |
| # name: <alsa_output.pci-0000_00_1b.0.analog-stereo> | |
| # $ pa-def-sink 1 |
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
| """ | |
| lp.py - Willie Launchpad Module | |
| Copyright (C) 2015 Felipe Reyes <[email protected]> | |
| This program is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation, either version 3 of the License, or | |
| (at your option) any later version. | |
| This program is distributed in the hope that it will be useful, |
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 -e | |
| # | |
| # Find extracted sosreport and remove them | |
| # | |
| for i in $(find . -name 'sosreport-*' -type d); do | |
| test -f "${i}.tar.xz" && echo -n "Removing ${i}..." && sudo rm -rf "${i}" && echo "done" | |
| done |
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 -ex | |
| CARD_NAME="bluez_card.0C_E0_E4_64_23_27" | |
| SINK_NAME="bluez_sink.0C_E0_E4_64_23_27" | |
| pacmd list | grep "$SINK_NAME.a2dp" && pacmd set-card-profile $CARD_NAME hsp && pacmd set-default-sink "$SINK_NAME.hsp" && exit 0 | |
| pacmd list | grep "$SINK_NAME.hsp" && pacmd set-card-profile $CARD_NAME a2dp && pacmd set-default-sink "$SINK_NAME.a2dp" && exit 0 |
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
| from Crypto.Hash import HMAC | |
| from Crypto.Hash import SHA | |
| import hashlib | |
| import datetime | |
| class Auth: | |
| @classmethod | |
| def sign(cls, method, c_type, body, uri, key=None): |
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
| 1) Connect to machine 0 as root | |
| juju ssh 0 sudo su - | |
| 2) Install mongodb client | |
| apt-get install mongodb-clients | |
| 3) Connect to mongodb | |
| mongo --ssl -u admin -p $(grep oldpassword /var/lib/juju/agents/machine-0/agent.conf | awk -e '{print $2}') localhost:37017/admin | |
| 4) Use juju db | |
| use juju | |
| 5) Change status | |
| db.units.update({"name": "UNIT"}, {$set: {"life": 0}}); |
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
| 1) Connect to machine 0 as root | |
| juju ssh 0 sudo su - | |
| 2) Install mongodb client | |
| apt-get install mongodb-clients | |
| 3) Connect to mongodb | |
| mongo --ssl -u admin -p $(grep oldpassword /var/lib/juju/agents/machine-0/agent.conf | awk -e '{print $2}') localhost:37017/admin | |
| 4) Use juju db | |
| use juju | |
| 5) Change state | |
| db.actions.update({"receiver": "UNIT", "status": "pending"}, {$set: {"status": "cancelled"}}, {multi: true}); |
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
| # vim: set ts=2 et: | |
| # deployer bundle for stable charms | |
| # UOSCI relies on this for OS-on-OS deployment testing | |
| openstack-services: | |
| services: | |
| mysql: | |
| branch: lp:charms/trusty/percona-cluster | |
| constraints: mem=1G | |
| options: | |
| dataset-size: 50% |
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
| for i in $(virsh list --all | awk -F' ' '{print $2}' | grep instance);do virsh dumpxml $i | grep -q 34f013fa-7275-489d-8152-4f5118a43b64 && echo $i ;done |