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
# First run this in top cell: pip install pyhive | |
from pandas import read_sql | |
from pyhive import presto | |
presto_conn = presto.Connection(host="collab-cluster-hostname-m", schema="your_presto_schema", catalog="presto_catalog", port=8060, username ="presto") | |
presto_cursor = presto_conn.cursor() | |
# Query presto node | |
query = "select * FROM system.runtime.nodes" | |
query_result = read_sql(query, presto_conn) |
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
diff --git a/pg_graphql--0.3.3.sql b/pg_graphql--0.3.3.sql | |
index 1c7e735..c35ca13 100644 | |
--- a/pg_graphql--0.3.3.sql | |
+++ b/pg_graphql--0.3.3.sql | |
@@ -3226,19 +3226,19 @@ begin | |
order by | |
%s | |
limit | |
- least(%s, 30) + 1 | |
+ least(%s, 150) + 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
-- You will need to remove some quotation marks | |
select 'drop table if exists "schema_name"."' || tablename || '" cascade;' | |
from pg_tables | |
where schemaname = 'schema_name'; |
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
WITH RECURSIVE pg_inherit(inhrelid, inhparent) AS | |
(select inhrelid, inhparent | |
FROM pg_inherits | |
UNION | |
SELECT child.inhrelid, parent.inhparent | |
FROM pg_inherit child, pg_inherits parent | |
WHERE child.inhparent = parent.inhrelid), | |
pg_inherit_short AS (SELECT * FROM pg_inherit WHERE inhparent NOT IN (SELECT inhrelid FROM pg_inherit)) | |
SELECT table_schema | |
, TABLE_NAME |
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
# Add the following step to kick some helpful debugging about what's in your google cloud build container! | |
- id: "Read Values" | |
name: ubuntu | |
dir: '/workspace' | |
entrypoint: bash | |
args: | |
- -c | |
- | | |
# Read from "/workspace" | |
echo "Where am I " $(pwd) |
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
// | |
// Looks up a host using the resolver and returns an IP. | |
// Utility function for testing against K8s over VPN. | |
// Resolver should be the POD ip of kube-dns | |
// | |
func hostToIP(host string, resolver string) string { | |
fmt.Printf("Looking up %s using resolver %s\n", host, resolver) | |
r := &net.Resolver{ | |
PreferGo: true, | |
Dial: func(ctx context.Context, network, address string) (net.Conn, error) { |
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
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list | |
sudo apt update | |
sudo apt install elasticsearch |
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
import requests | |
import time | |
def contact_monitor(): | |
print("Calling the monitor...") | |
r= requests.get("https://heartbeat.uptimerobot.com/m11111111-11111111111111111111111111") | |
while 1==1: | |
time.sleep(30) | |
try: |
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
import ( | |
appsv1 "k8s.io/api/apps/v1" | |
) | |
// StatefulSetGetAll returns all STS for the managed cluster | |
func (mgr *manager) StatefulSetGetAll() *appsv1.StatefulSetList { | |
stslister, err := mgr.k8sclient.AppsV1().StatefulSets("").List(context.TODO(), metav1.ListOptions{}) | |
if err != nil { | |
fmt.Println("error getting StatefulSetGetAll: ", err) | |
} |
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
package main | |
import( | |
"log" | |
"net/url" | |
"net/http" | |
"net/http/httputil" | |
) | |
func main() { |