This is a collection of interesting queries that can be run on http://commonwealth.io/~crunchbase. Each query is shown in full with a corresponding HTTP link. These queries can also be run on the native PostgreSQL interface, described more at http://commonwealth.io/about/postgres.
This file contains 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 | |
# This script receives a prompt as an argument, the prompt describes a dataset and a chart output to. This script does the folliwng steps: | |
# 1. Generate a CSV file of data for the chart using butterfish CLI | |
# 2. Generate a Python script that uses matplotlib to generate the chart using the input CSV using Butterfish CLI | |
# 3. Run the Python script to generate the chart | |
prompt=("$@") | |
echo "Prompt: $prompt" |
This file contains 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 | |
# This script defines a Linux network namespace with a given MAC address. For example: | |
# ./create_ns.sh mynamespace 00:00:00:00:00:01 192.168.0.10 | |
# This creates the namespace. Once it exists you can run: | |
# ip netns exec mynamespace /usr/bin/myservice | |
# The service will see the given MAC at eth0 and will be accessible at the IP you give (192.168.0.10 in the example). | |
# This seems to work well on GCP machines, untested elsewhere. | |
set -e | |
set -x |
This file contains 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 table_schema "Data Base Name", | |
SUM(data_length ) / 1024 / 1024 / 1024 "Data GB" , | |
SUM(index_length) / 1024 / 1024 / 1024 "Index GB" , | |
sum(data_free ) / 1024 / 1024 / 1024 "Free GB", | |
SUM( data_length + index_length) / 1024 / 1024 / 1024 "Full Data size in GB" | |
FROM information_schema.TABLES | |
GROUP BY table_schema; |
This file contains 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 | |
# | |
# esdiagdump | |
# | |
# Usage: esdiagdump [-h <hostname/IP>:<port>] [-o <output filename>] | |
# hostname defaults to localhost | |
# output file defaults to current directory/esdiagdump.out.<timestamp> | |
# | |
# TODO: | |
# - Support for collecting marvel indices for export |
This map plots undersea cables on an Armadillo projection. Mouse over cables to highlight them and click to rotate the projection a random amount. The cable data is from (http://www.submarinecablemap.com/)[http://www.submarinecablemap.com/] and translated and plotted using TopoJSON.
This file contains 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
{ | |
query : { | |
db : 'bakks', | |
coll : 'submarine_cables', | |
param : {query : {}, fields: {name:1, path:1, length:1}} | |
}, | |
css : { | |
height : 460, | |
width : 780 | |
}, |