Skip to content

Instantly share code, notes, and snippets.

View pashamray's full-sized avatar
:octocat:

Pavlo Shamrai pashamray

:octocat:
View GitHub Profile

/ip firewall filter

add action=jump chain=input comment="sshbruteforces chain" connection-state=
new dst-port=22 jump-target=sshbruteforces protocol=tcp add action=drop chain=sshbruteforces comment="drop ssh brute forcers"
src-address-list=ssh_blacklist add action=add-src-to-address-list address-list=ssh_blacklist
address-list-timeout=1w3d chain=sshbruteforces connection-state=new
src-address-list=ssh_stage3 add action=add-src-to-address-list address-list=ssh_stage3 \

Simple Video Annotation Tool

This is a script to label the Scene in a Video based on the crowed density level. You can label the scene into 3 level, Empty, Half, and Full. In order to run this script we need to install OpenCV library on our system. Please follow the installation guide for your system.

How to run script

We assume that you install OpenCV and are ready to run the script. In ordor to download click here. Unzip the file and navigate into SceneDensity directory.

In Ubuntu 16.04

@pashamray
pashamray / tegra-cam.py
Created May 5, 2018 21:54 — forked from jkjung-avt/tegra-cam.py
Capture and display video from either IP CAM, USB webcam, or the Tegra X2/X1 onboard camera.
# --------------------------------------------------------
# Camera sample code for Tegra X2/X1
#
# This program could capture and display video from
# IP CAM, USB webcam, or the Tegra onboard camera.
# Refer to the following blog post for how to set up
# and run the code:
# https://jkjung-avt.github.io/tx2-camera-with-python/
#
# Written by JK Jung <jkjung13@gmail.com>
@pashamray
pashamray / receiver.py
Created March 9, 2018 19:45 — forked from Tehnix/receiver.py
Streamer and receiver. The streamer broadcasts your webcam video via multicast, and the receiver displays the stream.
#!/usr/bin/env python2.7
import socket
import struct
import cv2
import numpy
MCAST_GRP = '224.0.0.1'
MCAST_PORT = 5007
@pashamray
pashamray / gist:7866f21d2e1925f72132415903c45db0
Last active February 11, 2025 16:13
mount img files in linux
Первый шаг, получить список разделов в образе:
fdisk -l hive-0.5-12-20171211.img
Диск hive-0.5-12-20171211.img: 7 GiB, 7549747200 байтов, 14745600 секторов
Единицы измерения: секторов из 1 * 512 = 512 байтов
Размер сектора (логический/физический): 512 байт / 512 байт
I/O size (minimum/optimal): 512 bytes / 512 bytes
Тип метки диска: dos
Идентификатор диска: 0x244b7fbe
@pashamray
pashamray / test.js
Last active January 12, 2018 08:06
alert('external');
#download and install the rabbitmq c amqp lib
wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.5.1/rabbitmq-c-0.5.1.tar.gz
tar -zxvf rabbitmq-c-0.5.1.tar.gz
cd rabbitmq-c-0.5.1/
./configure
make
sudo make install
cd ..
#download and compile the amqp
wget http://pecl.php.net/get/amqp-1.4.0.tgz
http://www.avrfreaks.net/forum/digital-audio-spi-i2s-0
<?php
$previous_data = 35;
$current_data = 150;
$percent = ($previous_data != 0) ? round((($current_data - $previous_data) * 100) / $previous_data, 2) : 0;
echo $percent;