Skip to content

Instantly share code, notes, and snippets.

View slgithub's full-sized avatar
🎯
Focusing

SUMANTAL slgithub

🎯
Focusing
View GitHub Profile
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
@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
@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 / 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 / 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 / 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 / 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

@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 / 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 / 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