Skip to content

Instantly share code, notes, and snippets.

View amalakar's full-sized avatar

Arup Malakar amalakar

  • San Francisco, US
View GitHub Profile
@amalakar
amalakar / issue_598.py
Created May 30, 2012 18:56
Test Case for requests Issue #598 Pass json objects as url parameters
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import unittest
# Path hack.
sys.path.insert(0, os.path.abspath('..'))
import requests
@amalakar
amalakar / HiveClientCache.java
Created July 26, 2012 21:19
thread safe cache client
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
package main
import (
"fmt"
"log"
"sarama"
)
const (
topic = "aruptest"
0 AssignedMaps:0 AssignedReds:6 CompletedMaps:12 CompletedReds:11 ContAlloc:39 ContRel:13 HostLocal:2 RackLocal:2
2014-09-02 12:23:29,945 INFO [IPC Server handler 14 on 55846] org.apache.hadoop.mapred.TaskAttemptListenerImpl: Status update from attempt_1406489347014_104994_r_000002_0
2014-09-02 12:23:29,945 INFO [IPC Server handler 14 on 55846] org.apache.hadoop.mapred.TaskAttemptListenerImpl: Progress of TaskAttempt attempt_1406489347014_104994_r_000002_0 is : 0.7098628
2014-09-02 12:23:29,978 INFO [IPC Server handler 16 on 55846] org.apache.hadoop.mapred.TaskAttemptListenerImpl: Commit-pending state update from attempt_1406489347014_104994_r_000006_0
2014-09-02 12:23:29,978 INFO [AsyncDispatcher event handler] org.apache.hadoop.mapreduce.v2.app.job.impl.TaskAttemptImpl: attempt_1406489347014_104994_r_000006_0 TaskAttempt Transitioned from RUNNING to COMMIT_PENDING
2014-09-02 12:23:29,978 INFO [AsyncDispatcher event handler] org.apache.hadoop.mapreduce.v2.app.job.impl.TaskImpl: attempt_1406489347014_104994_r
init_config:
instances:
- directory: "/opt/ooyala/logger/shared/log-failed"
name: player.log.upload.failed
pattern: "player.*"
recursive: False
- directory: "/opt/ooyala/logger/shared/log-failed"
filetagname: all.log.upload.failed
-- { "user_id": "{{ query_runner_email }}", "is_scheduled": {{ is_scheduled }}, "run_at": {{ run_at }} }
@amalakar
amalakar / reset_wifi.sh
Last active July 28, 2021 16:56
Checks current bandwidth and forgets/joins wifi if it is lower than min threshold
#! /bin/bash
# Needs brew install speedtest-cli
network='en0'
wifi_name='XXXX-TODO'
wifi_password='YYYY-TODO'
min_bandwidth_mbps=125
function download_speed() {