Skip to content

Instantly share code, notes, and snippets.

View slgithub's full-sized avatar
🎯
Focusing

SUMANTAL slgithub

🎯
Focusing
View GitHub Profile
@slgithub
slgithub / RandomHttpLogGen.scala
Last active September 3, 2015 12:18 — forked from ashrithr/RandomHttpLogGen.scala
Scala script to generate random http log events to a output file specified, one can specify the number of events to generate per second. Also, class IPGenerator can take in number of sessions and session length which can be used to simulate a user returning back.
#!/bin/sh
exec scala -savecompiled "$0" "$@"
!#
import scala.collection.mutable.Map
import scala.util.Random
import scala.collection.mutable.ArrayBuffer
import java.io._
class IPGenerator(var sessionCount: Int, var sessionLength: Int) {
@slgithub
slgithub / flume-ng-agent.sh
Last active September 3, 2015 12:21 — forked from ashrithr/flume-ng-agent.sh
Custom Flume NG Agent INIT script for centos for runnig multiple agents on same machine
#!/bin/bash
#
# 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
@slgithub
slgithub / kafka.md
Last active September 3, 2015 12:22 — forked from ashrithr/kafka.md
kafka introduction

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
Mac Shortcut Windows Shortcut Description
⌘ + ⇧ + R Ctrl + Shift + R Open / Search for Resources
⌘ + ⇧ + T Ctrl + Shift + T Open / Search for types (Useful in finding classes)
⌘ + O Ctrl + O Shows Quick Outline of the Java Class
⌘ + T CTRL-T Show type hierarchy
ALT – ↑ or ↓ ALT – ↑ or ↓ Move line/block
⌃ + Space Ctrl + Space Content assist and Code completion
⌘ + ⇧ + F Ctrl + Shift + F Format source code
⌘ + L Ctrl + L Go to Line Number
@slgithub
slgithub / kafka
Last active September 3, 2015 12:30 — forked from superscott/kafka
Simple Kafka Ubuntu init.d Startup Script
DAEMON_PATH=/opt/kafka/bin
DAEMON_NAME=kafka
# Check that networking is up.
#[ ${NETWORKING} = "no" ] && exit 0
PATH=$PATH:$DAEMON_PATH
# See how we were called.
case "$1" in
start)
@slgithub
slgithub / git_brushup.md
Last active September 3, 2015 12:41 — forked from arttuladhar/git_brushup.md
Basic GIT Commands for everyday use.