Skip to content

Instantly share code, notes, and snippets.

View shal's full-sized avatar
🇺🇦

Ali shal

🇺🇦
  • Poland, Warsaw
View GitHub Profile
@shal
shal / Dockerfile
Created August 30, 2020 20:59
Dockerfile for OpenALPR 4.4
View Dockerfile
FROM quay.io/opencars/opencv:4.4-alpine AS openalpr
ENV OPENALPR_VERSION=2.3.0
ENV LEPTONICA_VERSION=1.80.0
ENV LOG4CPLUS_VERSION=2.0.5
ARG LD_LIBRARY_PATH=/usr/local/lib
ARG MAKEFLAGS="-j2"
ARG PKG_CONFIG_PATH="/usr/local/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig"
ARG PREFIX=/usr/local
@shal
shal / Dockerfile
Created August 30, 2020 20:58
Dockefile OpenCV 4.4.0
View Dockerfile
FROM alpine:3.12
ENV OPENCV_VERSION=4.4.0
ARG LD_LIBRARY_PATH=/usr/local/lib
ARG MAKEFLAGS="-j2"
ARG PKG_CONFIG_PATH="/usr/local/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig"
ARG PREFIX=/usr/local
ARG LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64:/usr/lib64:/usr/lib:/lib64:/lib"
@shal
shal / main.go
Created June 26, 2020 12:11
Copy objects to another bucket
View main.go
package main
import (
"fmt"
"os"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
)
func main() {
// Create an OSSClient instance.
View benchmark.sh
#!/bin/bash
update_system() {
apt-get update && apt-get -y upgrade
}
download_video() {
wget --progress=dot -O input.mp4 "https://hls-jmind-test.s3.eu-central-1.amazonaws.com/example/full_2160p_60fps.mp4"
}
@shal
shal / main.go
Last active February 6, 2020 22:57
The issue of Go
View main.go
package main
import (
"fmt"
"runtime"
"time"
)
func cpuIntensive(p *int) {
for i := 1; i <= 100000000000; i++ {
@shal
shal / main.go
Created November 13, 2019 16:47
Simple example of EEX webhook consumer in golang
View main.go
package main
import (
"encoding/json"
"flag"
"fmt"
"log"
"net/http"
"time"
)
@shal
shal / parser.go
Last active October 5, 2019 20:05
Parsing of big XML files using stream of tokens
View parser.go
// Parser is a command line tool for parsing big XML file.
// Author: Ali Shanaakh <hi@shal.dev>
// Usage: go run parse.go -path=./15-ufop/15.1-EX_XML_EDR_UO_03.10.2019.xml
package main
import (
"encoding/xml"
"flag"
"fmt"
"io"
@shal
shal / reflect.go
Last active October 2, 2019 20:21
Golang reflect play
View reflect.go
package main
import (
"errors"
"fmt"
"os"
"reflect"
"strconv"
"strings"
)
View gist:45d19895022e15f528d78bc6ddcca8c4
import { check } from "k6";
import http from "k6/http";
import { hmac } from "k6/crypto";
export let options = {
// simulate rampup of trafficm 1 to 200 users over 5 minutes.
stages: [
{ duration: "12m", target: 50 },
]
};
@shal
shal / import_members.rb
Created August 12, 2019 12:23
Import users generated by barong rake task to peatio
View import_members.rb
#!/usr/bin/env ruby
# Author: Ali Shanaakh <hi@shal.dev>
# Usage: import_members.rb --path=users.yml
require 'optparse'
options = {}
option_parser = OptionParser.new do |opts|
opts.banner = 'Usage: import_members.rb [options]'