Skip to content

Instantly share code, notes, and snippets.

View YarikST's full-sized avatar
👨‍💻
Focusing

Malyk Yaroslav YarikST

👨‍💻
Focusing
View GitHub Profile
sudo nano /usr/sbin/pull
#!/bin/bash
# Load RVM into a shell session *as a function*
printf "Load RVM.\n"
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
# Then try to load from a root install
source "/usr/local/rvm/scripts/rvm"
DROP TABLE IF EXISTS categories;
DROP TABLE IF EXISTS product_categories;
DROP TABLE IF EXISTS products;
CREATE TEMP TABLE categories
as
select *
from (
VALUES
(1 :: int, 'a' :: VARCHAR, null),
(2 :: int, 'b' :: VARCHAR, null),
CREATE TEMP TABLE task
as
select *
from (
VALUES
(1 :: int, 'Xліб' :: VARCHAR),
(2 :: int, 'Xліб' :: VARCHAR),
(3 :: int, 'Xліб' :: VARCHAR),
(4 :: int, 'Вино' :: VARCHAR),
(5 :: int, 'Вино' :: VARCHAR),
#https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-redis-on-ubuntu-16-04
#https://www.linode.com/docs/databases/redis/how-to-install-a-redis-server-on-ubuntu-or-debian8/
#https://aws-labs.com/configure-redis-cluster-ubuntu-14-04/
sudo apt-get update
sudo apt-get install build-essential tcl
cd /tmp
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
cd redis-stable
make
# mediainfo
#http://manpages.ubuntu.com/manpages/bionic/man1/mediainfo.1.html
# mediainfo --help
# mediainfo --Info-Parameters
.get the duration of video stream:
mediainfo --Inform="Video;%Duration%" [inputfile]
.get the duration of video stream as text:
mediainfo --Inform="Video;%Duration/String3%" [inputfile]
.get the duration of the media file:
mediainfo --Inform="General;%Duration%" [inputfile]