Skip to content

Instantly share code, notes, and snippets.

View MicTech's full-sized avatar
😎
make product people want

Michal Těhník MicTech

😎
make product people want
View GitHub Profile
@MicTech
MicTech / setup.sh
Created February 18, 2015 08:29
Setup jMeter on Ubuntu server (EC2)
#Prepare environment
sudo apt-get update
sudo apt-get install -y openjdk-7-jdk
sudo apt-get install -y jmeter
sudo apt-get install -y unzip
wget http://jmeter-plugins.org/downloads/file/JMeterPlugins-Standard-1.2.0.zip
wget http://jmeter-plugins.org/downloads/file/JMeterPlugins-Extras-1.2.0.zip
wget http://jmeter-plugins.org/downloads/file/JMeterPlugins-ExtrasLibs-1.2.0.zip
library(plyr)
block.size = 128 * 1024 * 1024
files.informations <- read.csv('workflow.csv', header=FALSE, stringsAsFactors=F)
files <- files.informations[c("V5", "V8")]
colnames(files) <- c("size", "filepath")
for(i in 1:nrow(files)) {
splitted.path <- strsplit(files[i,"filepath"], "/")
SELECT user_name FROM v_catalog.users;
SELECT database_name FROM databases;
SELECT schema_name FROM v_catalog.schemata;
SELECT table_name FROM tables WHERE table_schema = 'my_schema';
@MicTech
MicTech / consumer_App1_1.xml
Created May 17, 2014 16:25
Resources for article about ActiveMQ VirtualTopics.
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.6" jmeter="2.11 r1554548">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
@MicTech
MicTech / avroToCsv.pig
Last active February 11, 2016 08:13
Avro to Csv in Pig
#Based on Petr's code - https://github.com/PetrVales
#You need PiggyBank library
#info: https://cwiki.apache.org/confluence/display/PIG/PiggyBank
#jar: http://search.maven.org/#search%7Cga%7C1%7Cpiggybank
#start pig in local mode
pig -x local
#register PiggyBank library
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
@MicTech
MicTech / Graph Databases
Last active August 29, 2015 14:00
Simplified Examples from Graph Databases
CREATE (shakespeare:Author { firstname: 'William', lastname: 'Shakespeare' }),
(juliusCaesar:Play { title: 'Julius Caesar' }),
(shakespeare)-[:WROTE_PLAY { year: 1599 }]->(juliusCaesar),
(theTempest:Play { title: 'The Tempest' }),
(shakespeare)-[:WROTE_PLAY { year: 1610}]->(theTempest),
(rsc:Company { name: 'RSC' }),
(production1:Production { name: 'Julius Caesar' }),
(rsc)-[:PRODUCED]->(production1),
(production1)-[:PRODUCTION_OF]->(juliusCaesar),
(performance1:Performance { date: 20120729 }),
@MicTech
MicTech / script.sh
Last active August 29, 2015 13:58
Hadoop Pig playground
#resources
https://pig.apache.org/
http://hortonworks.com/hadoop-tutorial/how-to-use-basic-pig-commands/
http://engineering.linkedin.com/open-source/introducing-datafu-open-source-collection-useful-apache-pig-udfs
http://pig.apache.org/docs/r0.7.0/piglatin_ref2.html
#terminal
hadoop dfs -copyFromLocal /tmp/NYSE_daily_prices_A.csv /NYSE_daily_prices_A.csv
###Following operation may not make sense for stack data, but I using them only for playing with Pig.
@MicTech
MicTech / 0_reuse_code.js
Created March 19, 2014 13:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
➜ hadoop --version
Error: No command named `--version' was found. Perhaps you meant `hadoop -version'
➜ hadoop -version
Error: No command named `-version' was found. Perhaps you meant `hadoop version'
➜ hadoop version
Hadoop 2.2.0