Skip to content

Instantly share code, notes, and snippets.

View ognjenm's full-sized avatar

Ognjen Miletić ognjenm

View GitHub Profile
#!/bin/bash
OS=`cat /etc/redhat-release | awk {'print $1}'`
if [ "$OS" != "CentOS" ]; then
echo -e "\e[1;31mThis script is intended for CentOS only\e[0m" 1>&2
#exit 1
fi
@ognjenm
ognjenm / export.sh
Last active June 19, 2019 06:28
The following script will export all zimbra accounts to an import script
#!/bin/bash
# The following script will export all accounts to an import script.
# this script should be run as zimbra user
# target for ZCS 8, single server deployment
# last update 2014-04-04
# ognjen.miletic@gmail.com
# original at http://www.3open.org/d/zimbra/export_accounts
# customize these to your needs
@ognjenm
ognjenm / ocr.sh
Created August 30, 2014 06:38 — forked from ajerneck/ocr.sh
# Copyright Alexander Jerneck 2014
# Licensed under the MIT license (http://opensource.org/licenses/MIT)
#!/bin/bash
## Script to batch ocr pdfs, by first converting them to tifs.
echo "usage: ocr PATTERN where PATTERN is a glob matching pdf files to be converted."
echo "example: ./ocr file-20*.pdf"
for x in $@
do
```Shell
wget http://leptonica.googlecode.com/files/leptonica-1.69.tar.bz2
tat xvf leptonica-1.69.tar.bz2
cd leptonica-1.69
./configure
make && make install
ldconfig
wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz
#!/bin/sh
# Modified from http://ubuntuforums.org/showthread.php?t=880471, retrieved 2013-07-06
# fail fast
set -e
if [ -z "$1" ]; then
echo "Usage: `basename $0` [pdf file]";
exit 1;
#!/bin/bash
# requires ghostscript (http://www.ghostscript.com/)
# requires ImageMagick
# requires tesseract (https://code.google.com/p/tesseract-ocr/)
# requires GNU parallel (https://www.gnu.org/software/parallel/)
# all of these are typically available through yum/apt/brew/etc.
# number of cores over which the process will be parallelized
num_cores=$1
#!/bin/bash
project=${1:-Untitled Project}
mkdir -v "$project"
mkdir -v "$project/Design"
mkdir -v "$project/Design/Sketches"
mkdir -v "$project/Design/Prototypes"
mkdir -v "$project/Design/Branding"
mkdir -v "$project/Design/Production"
#!/bin/bash
automatic_apache() {
sudo cp /usr/local/apache2/bin/apachectl /etc/init.d
sudo chmod 755 /etc/init.d/apachectl
sudo update-rc.d apachectl defaults
}
remove_apache() {
sudo rm -rf /etc/apache2
@ognjenm
ognjenm / brojRadnihDana.php
Last active August 29, 2015 14:15
Broj radnih dana izmedju dva datuma (sa praznicima)
/**
*
* @param $pocetni_datum
* @param $krajnji_datum
* @return integer
* @author Ognjen Miletic, osnova uzeta sa interneta
* ne znam gdje, dodat dio za praznike
*/
public static function getBrojRadnihDana($pocetni_datum, $krajnji_datum)
{
BOOKS
The art of SQL
0: http://dev.mysql.com/doc/refman/5.7/en/execution-plan-information.html
http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_optimizer_search_depth
http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html