Skip to content

Instantly share code, notes, and snippets.

View plashchynski's full-sized avatar
🎯
Focusing

Dzmitry Plashchynski plashchynski

🎯
Focusing
View GitHub Profile
$
$
$ matlab
MATLAB is selecting SOFTWARE OPENGL rendering.
< M A T L A B (R) >
Copyright 1984-2021 The MathWorks, Inc.
R2021b Update 4 (9.11.0.2022996) 64-bit (glnxa64)
July 22, 2022
root@6c168ef8ff06:/mediapipe# bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --copt -I/usr/include/opencv4/ mediapipe/examples/desktop/iris_tracking:iris_tracking_cpu_video_input
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "c2cdcf55ffaf49366725639e45dedd449b8c3fe22b54e31625eb80ce3a240f1e"
DEBUG: Repository rules_foreign_cc instantiated at:
/mediapipe/WORKSPACE:49:13: in <toplevel>
Repository rule http_archive defined at:
/root/.cache/bazel/_bazel_root/4884d566396e9b67b62185751879ad14/external/bazel_tools/tools/build_defs/repo/http.bzl:353:31: in <toplevel>
WARNING: Download from http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.
@plashchynski
plashchynski / log.txt
Created November 9, 2022 12:39
mediapipe iris_tracking Docker compilation error
[ec2-user@ip-172-31-48-200 mediapipe]$ git rev-parse HEAD
b4e1833dd06f6fe3a4fe2e396df45e1fa0bf902e
[ec2-user@ip-172-31-48-200 mediapipe]$ docker build --tag=mediapipe .
Sending build context to Docker daemon 77.62MB
Step 1/18 : FROM ubuntu:20.04
20.04: Pulling from library/ubuntu
eaead16dc43b: Pull complete
Digest: sha256:450e066588f42ebe1551f3b1a535034b6aa46cd936fe7f2c6b0d72997ec61dbd
Status: Downloaded newer image for ubuntu:20.04
---> 680e5dfb52c7
@plashchynski
plashchynski / prime.rb
Last active April 11, 2020 22:03
Check if the number is prime in Ruby
# trial division — the simplest primality test
def is_prime(number)
return number > 1 if number <= 3
return false if number % 2 == 0 || number % 3 == 0
i = 5
while i * i <= number do
return false if number % i == 0 || number % (i + 2) == 0
i = i + 6

1.3

(define (proc x1 x2 x3)
        (cond   ((and (> x1 x3) (> x2 x3)) (+ (* x1 x1) (* x2 x2)))
                ((and (> x1 x2) (> x3 x2)) (+ (* x1 x1) (* x3 x3)))
                ((and (> x2 x1) (> x3 x1)) (+ (* x2 x2) (* x3 x3)))
        )
)
@plashchynski
plashchynski / save_as_small_jpg.rb
Created February 28, 2019 11:58
Ruby script to convert images using magick
ARGV.each do |input_file|
basename = File.basename(input_file, ".*")
dirname = File.dirname(input_file)
output_file = "#{dirname}/#{basename}.jpg"
`/usr/local/bin/magick convert '#{input_file}' -quality 20 '#{output_file}'`
end
@plashchynski
plashchynski / save_as_small_jpg.scpt
Created February 9, 2019 23:31
Apple script to save any images as low fidelity JPG
on run {input, parameters}
set theList to input
repeat with a from 1 to length of theList
set theCurrentListItem to item a of theList
set theFilePath to theCurrentListItem
set theFile to theFilePath as alias
tell application "Image Events"
@plashchynski
plashchynski / merge_dna_files.rb
Last active December 30, 2022 09:20
Tool to merge 23andme and Ancestory.com raw dna files
#!/usr/bin/ruby
#
# Usage:
# ruby ./merge_dna_files.rb file,file1,file2... > merged_file.txt
#
# Example:
# ruby ./merge_dna_files.rb AncestryDNA.txt genome_John_Doe_v4_Full_20170428065226.txt > merged_raw.txt
#
# Supports 23andMe, AncestryDNA, and Genes for Good 23andMe compatible file formats.
# The result will be in 23andMe file format.
We can't make this file beautiful and searchable because it's too large.
rs3094315
rs3131972
rs75333668
rs11240777
rs4970383
rs4475691
rs200686669
rs13302982
rs201186828
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHw2ONqkDChoKfisxtvgQ1x4haN1d01HaRHdJQveKKngwErgdRaItSmoaS+7382pm9hpfHzFs5HAIObwmRMfeK0t59keoI+NdL3iq+CagCyPrw3DLOv7sn129wrspXDEVPfVhKjXsL2pSFYz7P1Gr6BQlij7U8RvUCCj5gpaWQWwKtfq5HtWQ0KiMLvP13Tdq6uBvyp5IQALp2+s1wlzgBFxV6nOTICN6g4/Bh3oCGxyFTr77Kjv6HJ0kmJo48tNUhClnJB1NilOsSdjCzajCdV6jvjM1XzXeeVzuK9m+UKdT7eImBxgkhFBS4NwjQ7dCfHXT4waFyeSYv+ZUSm/qx plashchynski@gmail.com