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.
@slgithub
slgithub / Stop RabbitMQ on Ubuntu on booting.md
Last active September 4, 2015 09:00
Stop RabbitMQ on Ubuntu on booting

‘chkconfig‘ is popularly used for adding or removing any services during boot. In other words, it updates and queries runlevel information for system services.

update-rc.d. This is very simple to use & equally intuitive as well

Use update-rc.d:

update-rc.d -f rabbitmq-server remove

@slgithub
slgithub / prevent mysql from starting on boot.md
Last active September 4, 2015 08:46
prevent mysql from starting on boot:

Open the terminal: Ctrl+Alt+T

Open the mysql.conf file: nano /etc/init/mysql.conf

Comment out the "start on" line near the top of the file, the "start on" might be spread across two lines, so comment out both. (comment adding # at the beginning)

If you want to manually start mysql, use the following command:

service mysql start

@slgithub
slgithub / Eclipse secure storage disable.md
Created September 4, 2015 08:46
Eclipse secure storage

To disable the master password prompt you have to specifiy a file containing the password with -eclipse.password, see Eclipse SDK Help and Bug 241223.

The complete procedure is as follows (this is on Linux, on Windows it should work as well if you change the paths):

Exit Eclipse Delete the directory ~/.eclipse/org.eclipse.equinox.security Create a text file containing your master password, e.g. echo "secret" > ~/.eclipse/master Add to the very top of eclipse.ini, found in the Eclipse program directory (as two lines, don't combine into one)

-eclipse.password

@slgithub
slgithub / remove redis Server from start up booting.md
Last active September 4, 2015 09:03
remove redis Server from start up booting

sudo update-rc.d -f redis_6379 remove