This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2 | |
#!/bin/bash | |
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2" | |
#!/bin/bash | |
convert in.jpg \( +clone -blur 0x20 \) -compose Divide_Src -composite -normalize -level 10%,90% -deskew 40% -unsharp 0x5+2+0 out.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>{% if meta.title %}{{ meta.title }} | {% endif %}{{ site_title }}</title> | |
</head> | |
<body> | |
<h1><a href="{{ base_url }}">{{ site_title }}</a></h1> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# bitrate is "optimal" for every song | |
find -name '*.mp3' -print0 | xargs -0 -l -P 4 sh -c 'ffmpeg -v quiet -i "$0" -vn "${0%mp3}ogg"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cut video | |
## mencoder (bad way) | |
## http://www.misterhowto.com/?category=Computers&subcategory=Video&article=trim_or_split_with_mencoder | |
mencoder -endpos 00:01:32 -ovc copy -oac copy MVI_0587.MOV -o cutted2.mov | |
## ffmpeg (cut better) | |
## from 00:00 to 00:01:32 to separete file | |
ffmpeg -i MVI_0587.MOV -c:v -acodec copy -ss 00:00:00 -t 00:01:32 cutted.mov | |
# concatenate (ok) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# just a fork-bomb | |
:(){ :|:& };: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wc -l find . -iname "*.php" | |
find -name *.php | xargs cat | wc -l | |
http://cloc.sourceforge.net/ | |
--- | |
find . -regex '.+\.cc$' | xargs cat | wc | |
is the same as | |
find . -regex '.+\.cc$' | xargs wc | |
and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# little endian - forward byte order | |
# big endian - reverse byte order | |
echo "You have 32 bit system (1), 64bit (0)" | |
echo -n I | od -to2 | head -n1 | cut -f2 -d" " | cut -c6 | |
# cc: http://serverfault.com/questions/163487/linux-how-to-tell-if-system-is-big-endian-or-little-endian |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# allow to convert multipage pdfs | |
convert -verbose -density 200 -trim schedule_rus_fin.pdf -quality 90 zeronight%d.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in "$@" | |
do | |
TMP=$(mktemp) | |
SIZE_OLD=$(wc -c < "$f") | |
echo "Optimizing '$f' of size $SIZE_OLD" | |
/usr/bin/gs \ | |
-sDEVICE=pdfwrite \ | |
-dCompatibilityLevel=1.4 \ | |
-dPDFSETTINGS=/ebook \ | |
-dNOPAUSE \ |