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/python | |
| # | |
| # Usage: | |
| # $ lp-attach 1234 foo.debdiff bar.debdiff | |
| # | |
| import os | |
| import sys | |
| from launchpadlib.launchpad import Launchpad | |
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/python3 | |
| # Usage: | |
| # $ juju status --format yaml | ./juju-st | |
| import yaml | |
| import select | |
| import subprocess | |
| import sys | |
| from pprint import pprint | |
| from prettytable import PrettyTable, PLAIN_COLUMNS |
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/perl | |
| # | |
| # url_rewrite_program /etc/squid/rewrite.pl | |
| # add ^^^ to your squid.conf | |
| # | |
| $mirror = "example.com"; | |
| $| = 1; | |
| while (<>) { |
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 | |
| for dname in `find . -maxdepth 1 -type d -name 'sosreport-*' `;do | |
| for NAME in $(grep jujud ${dname}/ps | grep unit- | awk -F' ' '{print $11}' | cut -d'/' -f6); do | |
| echo "${dname} -> ${NAME}" | |
| ln -s ${dname} $NAME | |
| 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/python3 | |
| import colored | |
| import sys | |
| class bcolors: | |
| DEBUG = 4 | |
| INFO = 26 | |
| WARNING = 11 | |
| ERROR = 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
| #!/usr/bin/python | |
| # Example output: | |
| # 7 foo | |
| # 32 bar | |
| # 33 some | |
| # 32 example | |
| __author__ = "Felipe Reyes <[email protected]>" | |
| import os | |
| from collections import defaultdict | |
| from novaclient import client |
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/python3 | |
| # example output: | |
| # $ juju st | |
| # unit workload agent message | |
| # neutron-gateway/0* waiting executing Incomplete relations: network-service | |
| # neutron-api/0* active idle Unit is ready | |
| # nova-cloud-controller/0* waiting executing Incomplete relations: neutron-api, image, database, identity, messaging | |
| # percona-cluster/0* active idle Unit is ready | |
| # ceph-proxy/0* active idle Ready to proxy settings | |
| # ceph/0* active idle Unit is ready and clustered |
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 | |
| # source: http://php.ingewikkeld.net/entry/human-readable-memory-usage-in-linux-per-process | |
| ps -heo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' |
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/python3 | |
| import json | |
| import subprocess | |
| from prettytable import PrettyTable, PLAIN_COLUMNS | |
| table = PrettyTable() | |
| table.field_names = ['unit', 'workload', 'agent', 'message'] | |
| table.set_style(PLAIN_COLUMNS) | |
| table.align['unit'] = table.align['message'] = 'l' |
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 | |
| ROUTER=$1 | |
| neutron l3-agent-list-hosting-router ${ROUTER} | |
| neutron router-update ${ROUTER} --admin-state-up=False | |
| neutron router-update ${ROUTER} --admin-state-up=True |