Skip to content

Instantly share code, notes, and snippets.

@vipmax
vipmax / zed_tasks.md
Created October 15, 2024 12:18
zed tasks cwd example

Zed Tasks Configuration

This configuration allows Zed to run tasks with specific working directories for multiple projects.

Tasks Configuration

[
  {
 "label": "backend",
@vipmax
vipmax / docker-compose.yml
Last active October 8, 2024 19:53
minimal docker-compose apache kafka broker and kafka-ui
version: '3.8'
networks:
my_network:
driver: bridge
volumes:
kafka-data:
kafka-ui-data:
services:
@vipmax
vipmax / readme.md
Created October 13, 2023 11:38
websocket send with response

websocket send with response

By default with WebSocket you only can send message.

0. Initialization

let ws = new WebSocket('ws://localhost:3000/ws')

ws.onopen = function(event) {
  console.log("on open")
}
@vipmax
vipmax / .tmux.conf
Last active December 30, 2023 12:25
alacritty and tmux confings
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
bind-key s set-option status
bind r source-file ~/.tmux.conf
bind h split-window -v
bind v split-window -h
@vipmax
vipmax / scala 3 and apache spark.md
Created November 10, 2022 10:38
scala 3 and apache spark

scala 3 and apache spark

1. Install The Scala installer is a tool named Coursier

mac os

brew install coursier/formulas/coursier && cs setup

linux

@vipmax
vipmax / kafka concurrent batch commit
Last active September 20, 2018 15:55
kafka concurrent batch commit
val kafkaProps = new Properties()
kafkaProps.put("bootstrap.servers", endpoint)
kafkaProps.put("key.serializer", classOf[ByteArraySerializer])
kafkaProps.put("key.deserializer", classOf[ByteArrayDeserializer])
kafkaProps.put("value.serializer", classOf[ByteArraySerializer])
kafkaProps.put("value.deserializer", classOf[ByteArrayDeserializer])
kafkaProps.put("group.id", "CrawlerTasksStorage")
kafkaProps.put("max.poll.records", "1000")
kafkaProps.put("enable.auto.commit","false")

Kafka installation with systemd

0. Create kafka user

sudo adduser kafka
sudo adduser kafka sudo
su -l kafka

1. Download and Install kafka archive

cat social/scripts/social-site.service
cat social/scripts/social-crawler.service
import sys
reload(sys) # Reload does the trick!
sys.setdefaultencoding('UTF8')
import tarfile
# extract dictionary package
tar = tarfile.open("polyglot_data/sentiment2/ru/ru.sent.pkl.tar.bz2")
tar.extractall()
tar.close()