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/sh | |
kubectl get deploy --namespace metrics prom-prometheus-server -o yaml --export > deploy.yml | |
kubectl get configmaps --namespace metrics prom-prometheus-server -o yaml --export > prom-prometheus-server-config-map.yml |
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/sh | |
kubectl edit configmaps --namespace metrics prom-prometheus-server |
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 | |
docker run --entrypoint='' -ti quay.io/prometheus/prometheus:latest /bin/cat /etc/prometheus/prometheus.yml > prometheus.yml |
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 | |
find ./someDir -name "*.php" -o -name "*.html" | tar -cf my_archive -T - | |
# or | |
tar -cf my_archive.tar $( find -name "*.php" -or -name "*.html" ) |
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
func executeTemplate(tmpls *template.Template, tmplName string, w io.Writer, data interface{}) error { | |
var err error | |
layout := tmpls.Lookup("layout.html") | |
if layout == nil { | |
return errNoLayout | |
} | |
layout, err = layout.Clone() | |
if err != nil { | |
return err |
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 | |
gcloud spanner instances create test-instance --config=regional-us-central1 \ | |
--description="Test Instance" --nodes=1 | |
gcloud iam service-accounts create [NAME] | |
gcloud projects add-iam-policy-binding [PROJECT_ID] --member "serviceAccount:[NAME]@[PROJECT_ID].iam.gserviceaccount.com" --role "roles/owner" | |
gcloud iam service-accounts keys create [FILE_NAME].json --iam-account [NAME]@[PROJECT_ID].iam.gserviceaccount.com |
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
-- Enable PostGIS (includes raster) | |
CREATE EXTENSION postgis; | |
-- Enable Topology | |
CREATE EXTENSION postgis_topology; | |
-- Enable PostGIS Advanced 3D | |
-- and other geoprocessing algorithms | |
-- CREATE EXTENSION postgis_sfcgal; | |
-- fuzzy matching needed for Tiger | |
CREATE EXTENSION fuzzystrmatch; | |
-- rule based standardizer |
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 *, pg_size_pretty(total_bytes) AS total | |
, pg_size_pretty(index_bytes) AS INDEX | |
, pg_size_pretty(toast_bytes) AS toast | |
, pg_size_pretty(table_bytes) AS TABLE | |
FROM ( | |
SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM ( | |
SELECT c.oid,nspname AS table_schema, relname AS TABLE_NAME | |
, c.reltuples AS row_estimate | |
, pg_total_relation_size(c.oid) AS total_bytes | |
, pg_indexes_size(c.oid) AS index_bytes |
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-AzSubscription "SubscriptionName" | |
$nic = Get-AzureRmNetworkInterface -ResourceGroupName "ResourceGroupName" -Name "networkInterfaceName" | |
$nic.EnableAcceleratedNetworking = $true | |
$nic | Set-AzureRmNetworkInterface |