Skip to content

Instantly share code, notes, and snippets.

View slgithub's full-sized avatar
🎯
Focusing

SUMANTAL slgithub

🎯
Focusing
View GitHub Profile
@slgithub
slgithub / Sorting files 'numerically' instead of alphabetically in java.md
Created September 4, 2015 10:30
Sorting files 'numerically' instead of alphabetically in java
System.out.println("pathFolderPath IN RUN :::::" + pathFolderPath);
	File[] fileList = null;

	File folder = new File(pathFolderPath);
	
	if (folder.isDirectory()) {

		// Creating a filter to return only files.
		FileFilter fileFilter = new FileFilter() {

public boolean accept(File file) {

@slgithub
slgithub / check mongodb is running.md
Last active September 7, 2015 07:19
check mongodb is running

check with either:

ps -edaf | grep mongo # "ps" flags may differ on your OS or

/etc/init.d/mongod status or

service mongod status to see if mongod is running (you need to be root to do this, or prefix everything with sudo)

@slgithub
slgithub / Set Up Parameters in C++ KAFKA Client Project in Eclipse .md
Last active September 7, 2015 10:13
Set Up Parameters in C++ KAFKA Client Project in Eclipse

includes paths -I

/usr/local/boost/PREFIX/lib /home/hduser/apps/kafka.2.10/libkafka-asio/lib

Libraries (-l)

boost_thread boost_system pthread

@slgithub
slgithub / Delete message after consuming it in KAFKA.md
Created September 22, 2015 06:45
Delete message after consuming it in KAFKA

Delete message after consuming it in KAFKA

In Kafka, the responsibility of what has been consumed is the responsibility of the consumer and this is also one of the main reasons why Kafka has such great horizontal scalability.

Using the high level consumer API will automatically do this for you by committing consumed offsets in Zookeeper (or a more recent configuration option is using by a special Kafka topic to keep track of consumed messages).

The simple consumer API make you deal with how and where to keep track of consumed messages yourself.

Purging of messages in Kafka is done automatically by either specifying a retention time for a topic or by defining a disk quota for it so for your case of one 5GB file, this file will be deleted after the retention period you define has passed, regardless of if it has been consumed or not.

@slgithub
slgithub / move vagrant file in windows 10.txt
Last active August 28, 2017 23:37
move vagrant file in windows 10
In Windows 10,
1) Stop docker etc
2) Type "Hyper-V Manager" in task-bar search box and run it.
3) Select your PC in the left hand pane (Mine is called DESKTOP-CBP**)
4) Right click on the correct virtual machine (Mine is called MobyLinuxVM)
5) Select "Turn off" (If it is running)
6) Right click on it again and select "Move"
7) Follow the prompts
version: '3'
services:
mysqldb:
image: mysql
container_name: ${MYSQL_HOST}
restart: always
env_file:
- ".env"
#.env is the file for configuration which include
#MYSQL_HOST=mysql