Skip to content

Instantly share code, notes, and snippets.

@AbhilashG97
AbhilashG97 / consumer.js
Created May 27, 2021 03:57
Kafka JS consumer code
const { Kafka } = require("kafkajs");
const kafka = new Kafka({
clientId: "kafka-tweets",
brokers: ["localhost:9092"],
});
const consumer = kafka.consumer({ groupId: "tweets_cg_one" });
const runConsumer = async () => {
@AbhilashG97
AbhilashG97 / producer.js
Last active May 27, 2021 03:56
Kafka JS producer code
const { Kafka } = require("kafkajs");
const { CompressionTypes, CompressionCodecs } = require("kafkajs");
const LZ4Codec = require("kafkajs-lz4");
CompressionCodecs[CompressionTypes.LZ4] = new LZ4Codec().codec;
var Twitter = require("node-tweet-stream"),
t = new Twitter({
consumer_key: "xxxx",
This file has been truncated, but you can view the full file.
196 242 3 881250949
186 302 3 891717742
22 377 1 878887116
244 51 2 880606923
166 346 1 886397596
298 474 4 884182806
115 265 2 881171488
253 465 5 891628467
305 451 3 886324817
6 86 3 883603013
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-21-67bef302aaa0> in <module>
----> 1 resize_images(os.path.join(os.getcwd(), 'data/images/'), resize_image_path)
<ipython-input-18-2856c9fdcdb0> in resize_images(root_image_path, resized_image_path)
16
17 # check if image can be resized i.e. if it is too small or not
---> 18 is_valid = resizeimage.resize_cover.validate(img, [256, 256])
19
@AbhilashG97
AbhilashG97 / README.md
Last active July 18, 2020 18:55
Installing Tensorflow-2.0 on Ubuntu 19.04 with RTX 2070 Max Q GPU

Building and Installing TensorFlow-2.0 for Ubuntu-19

There are a few guides which tell how to install TensorFlow for RTX GPUs, but I found out that they were not complete.

This blog is pretty good, but it does not include all the steps. The missing steps will be included here.

Check Compatible Versions

You check the compatabilty of different versions here. This link is for Windows.

@AbhilashG97
AbhilashG97 / install.log
Last active November 3, 2019 20:29
Error log for the installation of python-htmlentities
Collecting htmlentities
Using cached https://files.pythonhosted.org/packages/9d/fa/f698172cea0f59b5ecd05532a041ade71db109753c29c4503b8189a8e6fc/htmlentities-0.2.1.tar.gz
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-odgwtov1/htmlentities/setup.py'"'"'; __file__='"'"'/tmp/pip-install-odgwtov1/htmlentities/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-odgwtov1/htmlentities/pip-egg-info
cwd: /tmp/pip-install-odgwtov1/htmlentities/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-odgwtov1/htmlentities/setup.py", line 2, in <module>
from htmlentities import __version__
configurations.implementation.setCanBeResolved(true)
configurations.api.setCanBeResolved(true)
task showMeCache {
doLast {
configurations.implementation.each {
println it}
}
}
sudo apt-get install lib32stdc++6
@AbhilashG97
AbhilashG97 / logs
Created June 3, 2019 03:57
Logcat for Fineract Build 2
09:10:28.183 [main] INFO o.a.f.c.customer.CustomerApplication - No active profile set, falling back to default profiles: default
09:10:28.681 [main] INFO o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@12f41634: startup date [Mon Jun 03 09:10:28 IST 2019]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@dcf3e99
09:10:41.616 [main] WARN o.s.c.a.ConfigurationClassPostProcessor - Cannot enhance @Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
09:10:43.047 [main] INFO o.s.cloud.context.scope.GenericScope - BeanFactory id=294a8c79-f4a9-3b7e-8557-1a7ca88803be
09:10:43.367 [main] INFO o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation
@AbhilashG97
AbhilashG97 / logcat
Created June 2, 2019 16:34
Fneract CN Server Build log
java -Ddemoserver.provision=true -Ddemoserver.persistent=true -Ddemoserver.lite=true -Dcustom.cassandra.contactPoints=127.0.0.1:9042 -Dcassandra.cluster.user=cassandra -Dcassandra.cluster.pwd=password -Dcustom.mariadb.host=localhost -Dcustom.mariadb.user=root -Dcustom.mariadb.password=mysql -jar demo-server-0.1.0-BUILD-SNAPSHOT.jar
JUnit version 4.12
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.4.1.RELEASE)