Skip to content

Instantly share code, notes, and snippets.

View hrvoj3e's full-sized avatar
💻
Cloning ...

hrvoj3e

💻
Cloning ...
View GitHub Profile
@hrvoj3e
hrvoj3e / php7.3-yaz.sh
Created April 24, 2019 06:30
Install YAZ for PHP 7.3
## PHP 7.3
apt update
apt install software-properties-common
apt-add-repository ppa:ondrej/php
apt install yaz libyaz5-dev
apt install php7.3-dev php7.3 php7.3-fpm
pecl channel-update pecl.php.net
pecl install yaz
## Installing '/usr/lib/php/20180731/yaz.so'
## install ok: channel://pecl.php.net/yaz-1.2.3
@hrvoj3e
hrvoj3e / php7.2-yaz.sh
Last active April 19, 2019 07:39
Install YAZ for PHP 7.2
## PHP 7.2
apt install yaz php7.2-dev php7.2-pear libyaz5-dev
pecl channel-update pecl.php.net
pecl install yaz
## Installing '/usr/lib/php/20170718/yaz.so'
echo 'extension=yaz.so' > /etc/php/7.2/mods-available/yaz.ini
ln -s /etc/php/7.2/mods-available/yaz.ini /etc/php/7.2/fpm/conf.d/20-yaz.ini
ln -s /etc/php/7.2/mods-available/yaz.ini /etc/php/7.2/cli/conf.d/20-yaz.ini
@hrvoj3e
hrvoj3e / sync-using-gitignore.sh
Created February 7, 2019 14:30 — forked from theothermattm/sync-using-gitignore.sh
Rsync files using .gitignore
# sync everything excluding things in .gitignore
# delete anything on target not in source
# include dotfiles and symlinks, also use compression
rsync -azP --delete --filter=":- .gitignore" . my-target-host:/my/target/directory
@hrvoj3e
hrvoj3e / db_backup.sh
Created January 30, 2019 13:18 — forked from bendavis78/db_backup.sh
A simple database backup / rotation / prune script
#!/bin/bash
# for use with cron, eg:
# 0 3 * * * postgres /var/db/db_backup.sh foo_db
if [[ -z "$1" ]]; then
echo "Usage: $0 <db_name> [pg_dump args]"
exit 1
fi
@hrvoj3e
hrvoj3e / gist:030975f03f3762299cc6220914de5b0f
Created November 15, 2018 15:22 — forked from jaxbot/gist:5748513
Block nginx from serving .git directories
location ~ /\.git {
deny all;
}
# or, all . directories/files in general (including .htaccess, etc)
location ~ /\. {
deny all;
}
@hrvoj3e
hrvoj3e / django_aaieduhr.md
Created October 23, 2018 16:18 — forked from darbula/django_aaieduhr.md
Instructions on how to implement Single Sign-On authentication using AAI@EduHr in Django. In Croatian language.

AAI@EduHr: Django SSO

  1. Osnovni preduvjet za korištenje Single Sign-On (SSO) autentikacije u Django projektu je instalacija i konfiguracija paketa djangosaml2 koja se može obaviti prateći detaljne upute na stranici https://bitbucket.org/lgs/djangosaml2

    Referentne, testirane te u ovim uputama preporučene verzije potrebnih paketa su:

    • xmlsec1 1.2.18 (openssl)
    • pysaml2==0.4.3
    • djangosaml2==0.10.0
@hrvoj3e
hrvoj3e / .gitignore
Created October 10, 2018 11:13 — forked from hieblmedia/.gitignore
Gitignore - Exclude all except specific subdirectory
#
# If all files excluded and you will include only specific sub-directories
# the parent path must matched before.
#
/**
!/.gitignore
###############################
# Un-ignore the affected subdirectory
@hrvoj3e
hrvoj3e / docker-compose.yml
Created October 3, 2018 05:18 — forked from joelhans/docker-compose.yml
My self-hosting `docker-compose.yml` file. To use, 1) set up your DNS, 2) replace domain/email fields, 3) execute `docker-compose up -d`. Should work.
version: '2'
services:
portainer:
image: portainer/portainer
container_name: portainer
restart: always
environment:
- VIRTUAL_HOST=docker.DOMAIN.TLD
@hrvoj3e
hrvoj3e / README.md
Created September 7, 2018 14:28 — forked from magnetikonline/README.md
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script to:

  • Iterate all commits made within a Git repository.
  • List every object at each commit.

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0