Skip to content

Instantly share code, notes, and snippets.

@raztud
raztud / elk-docker-compose.yml
Created October 25, 2020 21:01 — forked from Shmarkus/elk-docker-compose.yml
ELK stack (version 7.9.1) Docker compose bundle
version: "3"
services:
elasticsearch:
image: elasticsearch:7.9.1
container_name: elasticsearch
restart: unless-stopped
environment:
- node.name=elasticsearch
- discovery.seed_hosts=elasticsearch
- cluster.initial_master_nodes=elasticsearch
@raztud
raztud / all.py
Created April 23, 2019 16:56
Rabbitmq retry mechanism with Dead Letter
######### CREATE EXCHANGES/QUEUES
import pika
import sys
WORK_QUEUE = "WorkQueue"
WORK_EXCHANGE = "WorkExchange" # dead letter exchange
connection = pika.BlockingConnection(
pika.ConnectionParameters(host='localhost'))
@raztud
raztud / sentiment.py
Created January 6, 2019 21:08
check sentiment aws
import boto3
client = boto3.client('comprehend')
dataset = ["Food is good and not too expensive. Serving is just right for adult. Ambient is nice too.",
"Used to be good. Chicken soup was below average, bbq used to be good.",
"Food was good, standouts were the spicy beef soup and seafood pancake! ",
"Good office lunch or after work place to go to with a big group as they have a lot of private areas with large tables",
"As a Korean person, it was very disappointing food quality and very pricey for what you get. I won't go back there again. ",
@raztud
raztud / sign.go
Last active October 1, 2024 05:00
Sign string with go and openssl
package main
/**
With openssl command:
# echo -n "string to sign" | openssl rsautl -inkey private.key -sign|base64
or with openssl + sha256 (if it is used SignSHA256 function)
# openssl dgst -sha256 -sign private.key -out sign.txt.sha256 <(echo -n "string to sign") ; cat sign.txt.sha256 | base64
With sign.go
@raztud
raztud / asyncio_tcp_server_cassandra.py
Created May 15, 2016 20:51
asyncio tcp server write number of requests to cassandra; golang client
import sys
import asyncio
import asyncio.streams
import uuid
from cassandra.cluster import Cluster
class MyServer:
def __init__(self, uid):
self.server = None # encapsulates the server sockets
@raztud
raztud / memcached_decorator.py
Last active February 29, 2016 11:20
memcached decorator for functions
import time
import re
import urllib2
from memcache import Client
servers = ["127.0.0.1:11211"]
mc = Client(servers, debug=False)
def memcached_value(func):
def strigify(str):