Skip to content

Instantly share code, notes, and snippets.

View Frodox's full-sized avatar
🎯
Focusing

Vitaly Rybnikov Frodox

🎯
Focusing
View GitHub Profile
@Frodox
Frodox / GPL.md
Created April 2, 2014 19:56 — forked from jnrbsn/GPL.md

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

#!/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
<!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>
@Frodox
Frodox / convert-all-mp3-to-ogg.sh
Created May 14, 2014 20:38
Convert all mp3 to ogg
#!/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"'
@Frodox
Frodox / infinite-loops.sh
Last active August 29, 2015 14:01
Funny bash loops
#!/bin/sh
# just a fork-bomb
:(){ :|:& };:
@Frodox
Frodox / how-to-count-code-lines.txt
Last active August 29, 2015 14:01
some cnippets, except stared snippets, how to count code lines in folder (project)
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
@Frodox
Frodox / download-java1.8.5.sh
Created July 16, 2014 21:01
download java binary
#!/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
@Frodox
Frodox / detect-endianes.sh
Created November 3, 2014 14:52
Detect, if you have BE/LE system from shell
#!/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
@Frodox
Frodox / pdf2img.sh
Created November 13, 2014 06:39
convert pdf to multiple images
#!/bin/bash
# allow to convert multipage pdfs
convert -verbose -density 200 -trim schedule_rus_fin.pdf -quality 90 zeronight%d.jpg