Skip to content

Instantly share code, notes, and snippets.

View jayunit100's full-sized avatar
🎯
Focusing

jay vyas jayunit100

🎯
Focusing
View GitHub Profile
/**
* Transform the non-sparksql mappable calendar
* into a spark sql freindly field.
*/
val mappableTransactions:RDD[TransactionM] =
r._5.map(trans =>
TransactionM(trans.customerId, trans.transactionId, trans.storeId, Map("dayOfWeek"->"Wed"), trans.productId));
mappableTransactions.registerTempTable("transactionsM");
@jayunit100
jayunit100 / -
Created February 17, 2015 19:30
{"totalTransaction":12,"transactionsByZip":[{"count":64,"productId":54,"zipcode":"94583"},{"count":38,"productId":18,"zipcode":"34761"},{"count":158,"productId":14,"zipcode":"11368"},{"count":66,"productId":46,"zipcode":"33027"},{"count":52,"productId":27,"zipcode":"94583"},{"count":84,"productId":19,"zipcode":"33027"},{"count":143,"productId":0,"zipcode":"94583"},{"count":58,"productId":41,"zipcode":"72715"},{"count":76,"productId":54,"zipcode":"15014"},{"count":118,"productId":52,"zipcode":"45439"},{"count":99,"productId":34,"zipcode":"46236"},{"count":151,"productId":14,"zipcode":"72715"},{"count":60,"productId":27,"zipcode":"15014"},{"count":122,"productId":52,"zipcode":"22101"},{"count":41,"productId":7,"zipcode":"46236"},{"count":56,"productId":25,"zipcode":"45439"},{"count":144,"productId":0,"zipcode":"15014"},{"count":75,"productId":42,"zipcode":"94536"},{"count":55,"productId":25,"zipcode":"22101"},{"count":60,"productId":15,"zipcode":"94536"},{"count":51,"productId":56,"zipcode":"34761"},{"count":11
@jayunit100
jayunit100 / -
Created February 19, 2015 04:36
import sys,json
data=json.loads(sys.stdin.read())
for x in range(0,4):
s=data["items"][x]["endpoints"]
print s[0].encode('utf8')
@jayunit100
jayunit100 / -
Created February 19, 2015 04:36
import sys,json
data=json.loads(sys.stdin.read())
for x in range(0,4):
s=data["items"][x]["endpoints"]
print s[0].encode('utf8')
package main
/*
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
public Iterator<Transaction> iterateData() throws Throwable {
final InputData inputData = new DataLoader().loadData();
final SeedFactory seedFactory = new SeedFactory(seed);
System.out.println("Generating stores...");
final ArrayList<Store> stores = new ArrayList<Store>();
final StoreGenerator storeGenerator = new StoreGenerator(inputData, seedFactory);
for (int i = 0; i < nStores; i++) {
Store store = storeGenerator.generate();
@jayunit100
jayunit100 / gist:b35730e955d90a365f6a
Created April 2, 2015 13:18
haskell all the things
import Data.Ord
import Data.List
-- type classe = contructor + arguments.
data BookInfo = Book Int String [String]
deriving (Show)
data MagazineInfo = Magazine Int String [String]
deriving (Show)
-- Now use type aliases.
type CustomerID = Int
[jay@rhbd ~]$ docker logs a23d17f32379
error from Lstat("/etc/secret-volume/data-1"): lstat /etc/secret-volume/data-1: no such file or directory
error reading file content for "/etc/secret-volume/data-1": open /etc/secret-volume/data-1: no such file or directory
[jay@rhbd ~]$
[jay@rhbd kubernetes]$ _output/local/bin/linux/amd64/e2e.test --provider="local" --host="http://127.0.0.1:8080" -ginkgo.focus="Secrets" -kubeconfig=/opt/kube-creds -kubectl-path='./cluster/kubectl.sh' --repo-root=./b
>>> testContext.KubeConfig: /opt/kube-creds
INFO: Waiting up to 10m0s for all pods (need at least 0) in namespace 'default' to be running and ready
@jayunit100
jayunit100 / gist:60c87014a457bf07f522
Created June 16, 2015 17:44
vagrantfile w/ duplicate etcd provisioning breaks
21
22 config.vm.define "kube0" do |kube0|
23 kube0.vm.box = centos
24 kube0.vm.hostname = "kube0.ha"
25 kube0.vm.synced_folder ".", "/vagrant"
26 kube0.vm.network :private_network, ip: "192.168.4.100"
27 config.vm.provision "shell", path:script, args:[discovery_url]
28 end
29
30 config.vm.define "kube1" do |kube1|
diff --git a/group_vars/all.yml b/group_vars/all.yml
index 71ff44c..05f1a8e 100644
--- a/group_vars/all.yml
+++ b/group_vars/all.yml
@@ -1,7 +1,7 @@
# Account name of remote user. Ansible will use this user account to ssh into
# the managed machines. The user must be able to use sudo without asking
# for password.
-ansible_ssh_user: root
+ansible_ssh_user: fedora