example to create docker image in tar file
tar \
--numeric-owner \
--exclude=/boot \
--exclude=/dev \
--exclude=/pack \
--exclude=/proc \
--exclude=/sys \
[[ -f "$1" ]] && \ | |
NAME="$1" && \ | |
sname=$(awk -F_original '{print $1}' <<< $NAME) && \ | |
extname=$(cut -d"." -f2 <<< $NAME) && \ | |
convert $NAME \ | |
-sampling-factor 4:2:0 \ | |
-strip \ | |
-quality 85 \ | |
-interlace JPEG \ | |
-colorspace sRGB \ |
example to create docker image in tar file
tar \
--numeric-owner \
--exclude=/boot \
--exclude=/dev \
--exclude=/pack \
--exclude=/proc \
--exclude=/sys \
# GNU Awk 4.2.1, API: 2.0 | |
# | |
# before run - set variable values, after | |
# awk -f generator_svg_with_rect_and_text.awk > document.svg | |
# | |
# after you can convert svg to png with inkscape | |
# inkscape --export-png=document.png document.svg | |
function print_start( page_width, page_height, unit_size) { | |
printf "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" |
#!/bin/bash | |
# how to use | |
# | |
# |----------------------- $1 - filename; can be _ | |
# | |------------------ $2 - window coordinate x | |
# | | |---------------- $3 - window coordinate y | |
# | | | |------------ $4 - width | |
# | | | | |------- $5 - height | |
# | | | | | |--- $6 - display number |
ldd "$1" | awk '/=>/{sub(/\.so\.[0-9]{0,}$/, "", $1); print $1}' |
fc-scan --format "{\"family\":\"%{family}\",\"fontformat\":\"%{fontformat}\",\"postscriptname\":\"%{postscriptname}\"}" | |
# fc-scan --format "{\"family\": \"%{family}\" , \"postscriptname\": \"%{postscriptname}\"}" ~/.fonts/7288.ttf | jq . | |
# | |
# { | |
# "family": "Lazurski", | |
# "postscriptname": "LazurskiBoldCyrillic" | |
# } |
# jq - jq-1.5 | |
# awk - GNU Awk 4.2.1, API: 2.0 | |
jq .dependencies,.devDependencies package.json | awk '/^\s/{gsub(/("|:)/, "", $0); command="npm info " $1 " version"; command | getline version; close(command); print " \"" $1 "\": \"" version "\","}' |
date -d "$(date +%Y/%m/%d)-10 day" +%Y/%m/%d # => 2018/07/11 | |
date -d "$(date +%Y/%m/%d)-0 day" +%Y/%m/%d # => 2018/07/21 |
fs = require 'fs' | |
random = (min, max) -> | |
rand = Math.floor( min + Math.random() * ( max + 1 - min )) | |
rand | |
arrDataSize = parseInt process.env['ITEM'] | |
arrData = [] | |
[0...arrDataSize].forEach (item) -> | |
arrData.push attr: random(1, 20) |
#!/bin/bash | |
# how to use | |
# youtubeplaylistdownload.sh link_to_playlist format_to_download | |
# example | |
# youtubeplaylistdownload.sh PL5zohYERz9XAYqBu0HQJ_tudt2R6gbPtb 171 | |
# | |
for url in $(curl -s -X GET https://www.youtube.com/playlist?list="$1" | awk '/data-video-id=/{match($0, /data-video-id="([^"]*)/, arr); print("https://www.youtube.com/watch?v="arr[1]);}'); do | |
youtube-dl -f "$2" $url | |
done |