Skip to content

Instantly share code, notes, and snippets.

@jwkidd3
jwkidd3 / austin_visa
Last active September 21, 2018 18:07
https://jkstoragedata.blob.core.windows.net/data/spark_materials.tar.gz
https://jkstoragedata.blob.core.windows.net/data/products.json.zip
spark-shell --driver-memory 10G --executor-memory 15G --executor-cores 8
CREATE TABLE `movie`(
`id` int,
`name` string,
@jwkidd3
jwkidd3 / splunk
Last active September 18, 2018 22:12
sourcetype="access_combined_wcookie" status=200|stats count as views count(eval(action="addtocart")) as addtocart count(eval(action="purchase")) as purchases by productName |eval viewstopurchases=(purchases/views) *100| eval carttopurchases=(purchases/addtocart) *100| table productName views addtocart purchases viewstopurchases carttopurchases | rename productName as "Product Name", views as "Views", addtocart as "Adds to Cart", purchases as "Purchases"
Field Extraction
(?i)^(?:[^"]*"){8}\s+(?P<response>.+)
index=main sourcetype=access_combined| eval browser=useragent|replace *Firefox* with Firefox , *Chrome* with Chrome, *MSIE* with IE, *Version*Safari* with Safari , *Opera* with Opera in browser|top limit=5 useother=t browser
index=main sourcetype=access_combined| eval os=useragent|replace *Windows* with Windows, *Macintosh* with Apple, *Linux* with Linux in os| top limit=3 useother=t os
index=main sourcetype=access_combined|stats dc(clientip) as Referals by referer_domain|sort - Referals
var http = require('http');
var handleRequest = function(request, response) {
console.log('Received request for URL: ' + request.url);
response.writeHead(200);
response.end('Hello World!');
};
var www = http.createServer(handleRequest);
www.listen(8080);
az vmss extension set \
--publisher Microsoft.Azure.Extensions \
--version 2.0 \
--name CustomScript \
--resource-group myResourceGroupAG \
--vmss-name myvmss \
--settings '{ "fileUris": ["https://raw.githubusercontent.com/Azure/azure-docs-powershell-samples/master/application-gateway/iis/install_nginx.sh"], "commandToExecute": "./install_nginx.sh" }'
sudo yum install git
wget http://ftp.wayne.edu/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz
tar xvf apache-maven-3.5.4-bin.tar.gz
mv apache-maven-3.5.4 maven
sudo mv maven/ /usr/local/
export PATH=$PATH:/usr/local/maven/bin
git clone https://github.com/jwkidd3/kafka
cd kafka/kafka_macys
mvn package
https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-table
git clone https://github.com/kubernetes-incubator/metrics-server.git
kubectl create -f metrics-server/deploy/1.8+/
provider "azurerm" {}
resource "azurerm_resource_group" "rg" {
name="jkterratestrg"
location="southcentralus"
}
terraform init
terraform plan
terraform apply -auto-approve
terraform destroy -auto-approve
create new vm from ubuntu 16.04LTS
ssh into new vm
install nginx
run sudo waagent -deprovision+user -force
az vm deallocate --resource-group myResourceGroup --name myVM
az vm generalize --resource-group myResourceGroup --name myVM
az image create -g myResourceGroup -n myImage --source myVM
provider "azurerm" {}
data "azurerm_resource_group" "image" {
name = "jktempvmrg"
}
data "azurerm_image" "image" {
name = "jknginx"
resource_group_name = "${data.azurerm_resource_group.image.name}"
}