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
| SELECT | |
| t1.a -- I need all of these | |
| SUM(t2.b) --but only sum these of t2.c = TRUE | |
| WHERE | |
| t2.c = 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
| SELECT | |
| meta.name AS "Name", | |
| string_agg(DISTINCT product.code, ', ') AS "Product Codes", | |
| COALESCE(SUM(line.quantity_ordered * | |
| line.unit_price_at_checkout_time), | |
| 0) AS "Total Quantity Ordered (in dollars)" | |
| FROM warehouse_pieces_piecemeta AS meta | |
| LEFT JOIN warehouse_pieces_piece AS piece | |
| ON piece.piece_meta_id = meta.id | |
| LEFT JOIN products_product AS product |
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
| -- This doesn't work as product.id is not grouped. | |
| SELECT | |
| meta.name AS "Name", | |
| string_agg(DISTINCT product.code, ', ') AS "Product Codes", | |
| ( | |
| SELECT COALESCE(SUM(line.quantity_ordered * | |
| line.unit_price_at_checkout_time), | |
| 0) | |
| FROM orders_orderline AS line | |
| LEFT JOIN orders_order AS orders ON orders.id = line.order_id |
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
| -- Works! | |
| SELECT | |
| name AS "Name", | |
| codes AS "Product Codes", | |
| COALESCE(total, 0.00) AS "Total Sales (in Dollars)" | |
| FROM | |
| (SELECT | |
| meta.id AS meta_id, | |
| meta.name AS "name", | |
| string_agg(DISTINCT product.code, ', ') AS "codes" |
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
| admin: | |
| group: | |
| - present | |
| beehive: | |
| group: | |
| - present | |
| user.present: | |
| - shell: /bin/bash | |
| - home: /srv/beehive |
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
| salt-minion --versions-report | |
| Salt: 0.15.1 | |
| Python: 2.7.3 (default, Jan 2 2013, 13:56:14) | |
| Jinja2: 2.6 | |
| M2Crypto: 0.21.1 | |
| msgpack-python: 0.1.10 | |
| msgpack-pure: Not Installed | |
| pycrypto: 2.6 | |
| PyYAML: 3.10 | |
| PyZMQ: 2.2.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 selenium.common.exceptions import NoSuchElementException | |
| from selenium.common.exceptions import ElementNotSelectableException | |
| from selenium.webdriver.common.by import By | |
| def qaclickit(driver, bytype, loc, options='') : | |
| # | |
| # required parms | |
| # | |
| # driver - web page to click on ( driver instance from webdriver ) | |
| # bytype - ID, XPATH, CSS, Etc... |
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 selenium.common.exceptions import NoSuchElementException | |
| from selenium.common.exceptions import ElementNotSelectableException | |
| from selenium.webdriver.common.by import By | |
| def qaclickit(driver, bytype, loc, options='') : | |
| # | |
| # required parms | |
| # | |
| # driver - web page to click on ( driver instance from webdriver ) | |
| # bytype - ID, XPATH, CSS, Etc... |
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 selenium.common.exceptions import NoSuchElementException, ElementNotSelectableException | |
| from selenium.webdriver.common.by import By | |
| def clickit(driver, bytype, loc): | |
| # | |
| # required parms | |
| # | |
| # driver - web page to click on ( driver instance from webdriver ) | |
| # bytype - ID, XPATH, CSS, Etc... | |
| # loc - location of where to find the item(s) to click on |
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 | |
| import salt.client | |
| import os | |
| client = salt.client.LocalClient() | |
| ret = client.cmd("*", "network.ip_addrs") | |
| ips = set(reduce(lambda x, y: x+y, ret.values())) | |
| cmd = "ssh-keyscan " | |
| for ip in ips: | |
| cmd += ip + " " |