Skip to content

Instantly share code, notes, and snippets.

View bupy7's full-sized avatar

Vasily Belosloodcev bupy7

View GitHub Profile
@bupy7
bupy7 / coloring.sh
Last active January 30, 2024 07:15
Bash/Shell coloring
#!/usr/bin/env bash
BOLD="$(tput bold)"
UNDERLINE="$(tput smul)"
STANDOUT="$(tput smso)"
NONE="$(tput sgr0)"
BLACK="$(tput setaf 0)"
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
@bupy7
bupy7 / vk_audio_download.md
Last active July 2, 2023 17:23
Download VK audio file

vk_audio_download

ffmpeg -y -http_persistent false -i <m3u8_file_url> -c copy ./audio.mp3
@bupy7
bupy7 / video2gif.sh
Last active April 16, 2022 17:03
Converting video file to GIF using ffmpeg
#!/usr/bin/env bash
INPUT_FILE=$1
OUTPUT_FILE=$2
ffmpeg -i $INPUT_FILE \
-filter_complex "[0:v] fps=12,scale=w=480:h=-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" \
$OUTPUT_FILE
@bupy7
bupy7 / .xmodmaprc_apple
Last active March 23, 2023 07:23
Remap keys of Apple Magic Keyboard 2 for Linux (EN/RU)
! Usage: xmodmap ~/.xmodmaprc_apple
! ===
! 4 $ 4 %
keycode 13 = 4 dollar 4 percent
! 5 % 5 :
keycode 14 = 5 percent 5 colon
! 6 ^ 6 ,
keycode 15 = 6 asciicircum 6 comma
! 7 & 7 .
@bupy7
bupy7 / ttl.sh
Created April 25, 2017 15:27
Change TTL on OSX
#!/usr/bin/env bash
if [ "${1}" == "--help" ]; then
echo "Usage: sudo `basename $0` [64|65]"
exit 0
fi
TTL=${1:-64}
sysctl -w net.inet.ip.ttl=$TTL
@bupy7
bupy7 / num2str.php
Created December 14, 2015 08:34
Сумма прописью
<?php
/**
* Возвращает сумму прописью
* @author runcore
* @uses morph(...)
*/
function num2str($num) {
$nul='ноль';
$ten=array(
array('','один','два','три','четыре','пять','шесть','семь', 'восемь','девять'),