Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Cloning ...

hrvoj3e

💻
Cloning ...
View GitHub Profile
@hrvoj3e
hrvoj3e / php7.3-yaz.sh
Created Apr 24, 2019
Install YAZ for PHP 7.3
View php7.3-yaz.sh
## 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 Apr 19, 2019
Install YAZ for PHP 7.2
View php7.2-yaz.sh
## 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
View sync-using-gitignore.sh
# 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 Jan 30, 2019 — forked from bendavis78/db_backup.sh
A simple database backup / rotation / prune script
View db_backup.sh
#!/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 Nov 15, 2018 — forked from jaxbot/gist:5748513
Block nginx from serving .git directories
View gist:030975f03f3762299cc6220914de5b0f
location ~ /\.git {
deny all;
}
# or, all . directories/files in general (including .htaccess, etc)
location ~ /\. {
deny all;
}
@hrvoj3e
hrvoj3e / django_aaieduhr.md
Created Oct 23, 2018 — forked from darbula/django_aaieduhr.md
Instructions on how to implement Single Sign-On authentication using AAI@EduHr in Django. In Croatian language.
View django_aaieduhr.md

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 Oct 10, 2018 — forked from hieblmedia/.gitignore
Gitignore - Exclude all except specific subdirectory
View .gitignore
#
# 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 Oct 3, 2018 — 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.
View docker-compose.yml
version: '2'
services:
portainer:
image: portainer/portainer
container_name: portainer
restart: always
environment:
- VIRTUAL_HOST=docker.DOMAIN.TLD
@hrvoj3e
hrvoj3e / README.md
Created Sep 7, 2018 — forked from magnetikonline/README.md
List all Git repository objects by size.
View README.md

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.
View gist:8ab81b53a6f26c402aa4e0efbd9f96cc

mdadm

Glossary:

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