Skip to content

Instantly share code, notes, and snippets.

View sega-yarkin's full-sized avatar
😺

Sergei Iarkin sega-yarkin

😺
View GitHub Profile
# Set EXIF timestamp based on filename
exiftool -d '%m-%d-%y_%H%M%S0.jpg' -overwrite_original '-DateTimeOriginal<Filename' -ext jpg .
exiftool -d '%m-%d-%y_%H%M%S0.jpg' -overwrite_original '-DateTimeOriginal<Filename' -if 'not $DateTimeOriginal' -ext jpg .
# Set EXIF User Comment to original filename
exiftool -overwrite_original '-UserComment<${Filename;s/\.[^.]*$//}' -ext jpg .
# Copy EXIF
exiftool -overwrite_original -TagsFromFile "$from" "$to"
# Set EXIF timestamp from file mtime
exiftool -overwrite_original '-DateTimeOriginal<FileModifyDate' -ext jpg .
# Shift dates in EXIF (-AllDates[+-]=Y:m:D HH:MM:SS)
@sega-yarkin
sega-yarkin / manage.py
Created January 5, 2020 07:55
Python RPC-like server module
#!/usr/bin/env python3
import os
import sys
import time
import prctl # pylint: disable=import-error
import signal
import socket
import threading
import logging
import json
@sega-yarkin
sega-yarkin / 1_mts_to_mp4.sh
Last active February 20, 2021 01:00
ffmpeg video convert from mts format
#!/bin/sh
# for Macbook (MacOS)
# prereq.:
# - custom ffmpeg installation:
# brew tap justinmayer/tap
# brew install justinmayer/tap/ffmpeg --with-fdk-aac --with-libvidstab --with-webp
# - brew install exiftool
function mts_to_mp4_h265_cpu() {
@sega-yarkin
sega-yarkin / mrg_ips.txt
Created November 24, 2018 23:08
mrg ip ranges
AS47764
AS60476
AS21051
5.61.16.0/21
5.61.232.0/21
79.137.157.0/24
79.137.174.0/23
79.137.183.0/24
94.100.176.0/20
@sega-yarkin
sega-yarkin / nats1.conf
Created March 2, 2018 23:37
Nats Streaming crash
port: 4231
http_port: 8231
store: "file"
dir: "/data"
cluster {
host: '10.10.0.100'
port: 5231
bootstrap: true
@sega-yarkin
sega-yarkin / haproxy-eventmq.cfg
Created September 29, 2017 14:10
HAProxy configuration for RabbitMQ (as STOMP over WS)
###
# HAProxy configuration for Eventmq Web-node.
# Configured to serve:
# - 100k websocket connections
# - 2k (2% of WS) streaming connections (5k fullconn)
# - 100 (0.1% of WS) xhr connections (5k fullconn)
###
global
log 127.0.0.1 local2 info
@sega-yarkin
sega-yarkin / rabbitmq-mgmt.vcl
Created September 29, 2017 14:01
Varnish VCL for caching RabbitMQ Management plugin (3.5.7)
vcl 4.0;
# RabbitMQ management console.
backend default { .host = "127.0.0.1"; .port = "15673"; }
sub vcl_recv {
# We only deal with GET and HEAD
if( req.method!="GET" && req.method!="HEAD" ) {
return (pass);
}