Skip to content

Instantly share code, notes, and snippets.

View kilatib's full-sized avatar

Vitalii Shtykhno kilatib

View GitHub Profile
export KEY_FILE=/var/secrets/google/key.json
node ./script/reprocessPubsubMessages.js --tenantIds 1 --deliveryIds 80725cfd386d
#!/bin/bash
##
## Update GoDaddy Domain DNS records by your IP
domain=$1 # your domain
type="A" # Record type A, CNAME, MX, etc.
name=$2 # name of record to update
ttl="3600" # Time to Live min value 600
port="1" # Required port, Min value 1
@kilatib
kilatib / merge_mkv_video.sh
Last active December 18, 2023 12:53
Merge video audo and subtitres to one file for easy read by Plex player
#!/bin/zsh
export DIR=$1
pushd $DIR
for video in *.mkv; do
ovideo=$(basename ${video} .mkv)
oaudio=""
osub=""
@kilatib
kilatib / jwt_tool_set_public_devkit.json
Last active November 21, 2023 17:44
jwt_tool_set.json
{"keys":[{"alg":"RS256","kty":"RSA","use":"sig","n":"yZXlfd5yqChtTH91N76VokquRu2r1EwNDUjA0GAygrPzCpPbYokasxzs-60Do_lyTIgd7nRzudAzHnujIPr8GOPIlPlOKT8HuL7xQEN6gmUtz33iDhK97zK7zOFEmvS8kYPwFAjQ03YKv-3T9b_DbrBZWy2Vx4Wuxf6mZBggKQfwHUuJxXDv79NenZarUtC5iFEhJ85ovwjW7yMkcflhUgkf1o_GIR5RKoNPttMXhKYZ4hTlLglMm1FgRR63pvYoy9Eq644a9x2mbGelO3HnGbkaFo0HxiKbFW1vplHzixYCyjc15pvtBxw_x26p8-lNthuxzaX5HaFMPGs10rRPLw","e":"AQAB","kid":"toolKey"}]}
#!/usr/bin/env sh
COMPOSER=composer.json
if [ ! -f "$COMPOSER" ]; then
echo "$COMPOSER does not exist."
exit 1
fi
NAME=$(jq -r '.name' "$COMPOSER")
@kilatib
kilatib / tao.md
Last active July 13, 2022 12:00
TAO useful command

Bucket CORS

Check status

gsutil cors get gs://d0-oat-demo-tr-gcs-deliver

Apply CORS policy

gsutil cors set cors-oat-demo-img-upload-test.json gs://d0-oat-demo-tr-gcs-deliver

Make pull

[
{
"maxAgeSeconds": 60,
"method": [
"*"
],
"origin": [
"https://testrunner-oat-demo.dev.gcp-eu.taocloud.org"
],
"responseHeader": [
#!/bin/bash
# Script: pitemp.sh
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+
# -------------------------------------------------------
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)"
echo "CPU => $((cpu/1000))'C"
@kilatib
kilatib / photo_sort.sh
Last active January 22, 2025 15:57
Resolve problems of sort photos/videos by date and separate it to specific folders
#!/bin/bash
# Script sort file to folder by mask hhhh/mm
# Also rename files by formats hhhh_mm-dd-hh_mm_ss.*
#
# Example: /mnt/DCIM/IMG-20131014112354.* -> $HOME/Photo/2013/10/2013_10-14_11_23_54.*
# If file has name collision it set as tail current time with seconds
#
# Search does in that order:
# 1) Exiftool in metadata (Media Create Date -> Date/Time -> Original Create Date -> Date/Time Created -> Exif.Photo.DateTimeOriginal -> Exif.Image.DateTime)
# 2) By photo name if metadata empty
#GoDaddy DDNS Update Script
#Test with RouterOS 6.45.2 (Minimum version RouterOS 6.44)
#Date:2019/08/02
#The read,write,policy,test that all of these policies need to be set in script for the global variable
#ref1 https://www.instructables.com/id/Quick-and-Dirty-Dynamic-DNS-Using-GoDaddy/
#ref2 http://www.minitw.com/post/2018/05/09/routeros-ddns-namecheap
#Easy Test
# /tool fetch url="https://api.godaddy.com/v1/domains/[domain]/records/A/[hostname]" http-method=put http-data="[{\"data\": \"10.10.10.10\"}]" http-header-field="content-type: application/json,Authorization: sso-key [API_KEY]:[API_SECRET]"