Skip to content

Instantly share code, notes, and snippets.

@bspavel
bspavel / ntp.sh
Created December 4, 2020 18:56
NTP client
#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!!)"
exit
fi
#timedatectl list-timezones
#sudo timedatectl set-timezone <time zone>
@bspavel
bspavel / aria2_installer.sh
Created March 25, 2020 11:48
the installer of the aria2 on the raspberry pi
#!/bin/bash
#https://medium.com/@yuanyifang/download-server-on-raspberry-pi-c5b1050242d8
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!!)"
exit
fi
sudo apt-get install -y aria2
@bspavel
bspavel / minidlna_installer.sh
Last active September 19, 2020 18:48
the installer of minidlna on the raspberry pi
#!/bin/bash
#https://superuser.com/questions/871532/mount-external-hard-drive-with-r-w-permissions-for-minidlna
#https://www.codingcookie.com/raspberry-pi-minidlna/
#@TODO:
#Automaticaly spin down the hard drive
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!!)"
@bspavel
bspavel / transmission_installer.sh
Last active April 2, 2020 12:12
the installer of transmission on the raspberry pi
#!/bin/bash
#https://geekelectronics.org/raspberry-pi/raspberry-pi-ustanovka-torrent.html
#https://pcminipro.ru/os/nastrojka-transmission-daemon-settings-json/
#https://help.ubuntu.ru/wiki/transmission-daemon
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!!)"
exit
fi
@bspavel
bspavel / ffmpeg_mkv_mp4_conversion.md
Created January 27, 2020 09:33 — forked from jamesmacwhite/ffmpeg_mkv_mp4_conversion.md
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@bspavel
bspavel / progress.py
Created January 27, 2020 09:01 — forked from vladignatyev/progress.py
Python command line progress bar in less than 10 lines of code.
# The MIT License (MIT)
# Copyright (c) 2016 Vladimir Ignatev
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the Software
# is furnished to do so, subject to the following conditions:
#
@bspavel
bspavel / metadata_image_cleanner.sh
Created July 27, 2019 20:44
meta data cleanner from a image
#http://www.linux-magazine.com/Online/Blogs/Productivity-Sauce/Remove-EXIF-Metadata-from-Photos-with-exiftool
#https://www.shellhacks.com/ru/remove-exif-data-images-photos-linux/
#https://askubuntu.com/questions/1005118/remove-all-picture-metadata-except-for-one
sudo apt-get install libimage-exiftool-perl
exiftool image.jpeg
exiftool -all= image.jpeg
@bspavel
bspavel / .bash_profile
Created July 21, 2019 17:57 — forked from prabirshrestha/.bash_profile
my terminal settings for windows
# curl -Lk https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/071a7d7060ba2b76603231f962d2240ed6bf0312/.bash_profile -o ~/.bash_profile
[[ -s ~/.nvm/nvm.sh ]] && . ~/.nvm/nvm.sh # This loads NVM
export PATH="$HOME/.cargo/bin:$HOME/go/bin:$HOME/Library/Python/3.7/bin:$PATH"
export PATH="$HOME/.config/nvim/plugins/vim-themis/bin:$PATH"
stty -ixon
# alias
alias ls='ls -Gp'
alias vi='nvim'
@bspavel
bspavel / vimrc
Created July 21, 2019 17:57 — forked from keelii/vimrc
vimrc for window
" ------------------------------
" Name: vimrc for windows
" Author: keelii
" Email: [email protected]
" ------------------------------
" Startup {{{
filetype indent plugin on
augroup vimrcEx
@bspavel
bspavel / .vimrc
Created July 21, 2019 17:57 — forked from jeresig/.vimrc
VIM Config
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
set nocompatible
set autoindent
set tabstop=2
set showmatch
set vb t_vb=
set ruler
set nohls
set incsearch
syntax on