Skip to content

Instantly share code, notes, and snippets.

View ebrucucen's full-sized avatar
🎯
Focusing

Ebru Cucen ebrucucen

🎯
Focusing
View GitHub Profile
@ebrucucen
ebrucucen / java_hadoop_mapreduce
Last active February 16, 2021 08:54
java example for mapreduce
public static void main(String[] args) throws Exception {
Configuration conf = new Configuration();
String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
if (otherArgs.length != 2) {
System.err.println("Usage: ratemovie <in> <out>");
System.exit(2);
}
Job job = new Job(conf, "rate movie");
job.setJarByClass(MovieRating.class);
job.setMapperClass(TokenizerMapper.class);
@ebrucucen
ebrucucen / reducer.py
Created January 29, 2021 06:03
Simple reducer function
def reducer(self, word, counts):
yield word, sum(counts)
@ebrucucen
ebrucucen / mapper.py
Created January 29, 2021 05:49
Simple mapper function in Python
def mapper(line):
words = line.split()
for word in words:
yield word.lower(), 1
@ebrucucen
ebrucucen / mapreduce.py
Last active January 29, 2021 05:47
a sample for mapreduce
from mrjob.job import MRJob
class WordOccurence(MRJob):
def mapper(self, _, line):
words = line.split()
for word in words:
yield word.lower(), 1
def reducer(self, word, counts):
yield word, sum(counts)
#====================
#Step0: Define Variables
#====================
rgName="rg-core"
kvName="kv-core-20200125"
appName="demo_backend_spn"
spnCertName="SpnCoreCert"
location="ukwest"
#=====================
#Step1: Create Resource Group and KeyVault
provider "azurerm" {
version="=1.36.1"
}
resource azurerm_resource_group "rg_demo_backend" {
name="rg-demo-backend"
location="ukwest"
}
resource azurerm_storage_account "sa_demo_backend" {

Keybase proof

I hereby claim:

  • I am ebrucucen on github.
  • I am ebrucucen (https://keybase.io/ebrucucen) on keybase.
  • I have a public key ASDzWyx8JE7ZlqLUclZkr4OMqRc-xtbuWpxCXJ-mP_Iq6go

To claim this, I am signing this object:

@ebrucucen
ebrucucen / terraform_azurerm_sample.tf
Last active December 6, 2017 13:49
terraform_azurerm_sample
# Configure the Microsoft Azure Provider
provider "azurerm" {
    subscription_id="xxxxyyyy-xxyy-xxyy-xxyy-xxxxxxyyyyyy"
    tenant_id="xxxxyyyy-xxyy-xxyy-xxyy-xxxxxxyyyyyy"
    client_id="xxxxyyyy-xxyy-xxyy-xxyy-xxxxxxyyyyyyyy"
    client_secret="xxxxxxxxxxxxxxxxxxxxxxxxx"
}
resource "azurerm_resource_group" "test" {
name = "demo-rg-test"
location = "West Europe"
@ebrucucen
ebrucucen / New-AzureServicePlanWebApp.ps1
Last active September 10, 2017 04:21
Creating Service Plan and WebApp
###############################################
function Add-Account {
param(
[string]$AzureTenantId,
[string]$AzureServicePrincipalName,
[string]$AzureSPNPassword
)
###############################################
##Step1: Get Variables
@ebrucucen
ebrucucen / New-AzureSPN.ps1
Last active September 9, 2017 17:00
Creating SPN for Azure Resource Group
function New-AzureSpn{
param([string]$Subscriptionid ,
[string]$environmentName,
[string]$ApplicationName,
[string]$resourceGroupName,
[string]$location,
[string]$password
)
#Login-AzureRmAccount