Skip to content

Instantly share code, notes, and snippets.

Cloning ...


Cloning ...
View GitHub Profile
hrvoj3e / nginx.conf
Created Aug 19, 2020 — forked from sgomez84/nginx.conf
Nginx Proxy Pass to PHP-FPM
View nginx.conf
upstream phpfpm {
#server unix:/var/run/php5-fpm.sock;
#avoid sockets for nginx-fpm on Linux, they are good for BSD
server {
listen 8080;
rewrite ^(.*) $scheme://$1 permanent;
hrvoj3e /
Created Mar 9, 2020 — forked from PhilipSchmid/
Ubuntu 18.04 LACP Network Interface Bonding

Interface bonding

Configure an LACP active network interface bonding on Ubuntu 18.04 using netplan:

root@srv01:~# mv /etc/netplan/50-cloud-init.yaml /etc/netplan/01-netcfg.yaml
root@srv01:~# cat /etc/netplan/01-netcfg.yaml 
    version: 2
    renderer: networkd
hrvoj3e / docker-compose.yml
Created Feb 27, 2020 — forked from iki/docker-compose.yml
Docker-compose nginx CORS proxy
View docker-compose.yml
version: '3.7'
image: jwilder/whoami
View Core-UserBundle-Controller-SecurityController.php
namespace Core\UserBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class SecurityController extends Controller
public function loginAction(Request $request)
hrvoj3e /
Created Dec 31, 2019 — forked from soulmachine/
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:


Keybase proof

I hereby claim:

  • I am hrvoj3e on github.
  • I am hrvoj3e ( on keybase.
  • I have a public key ASCouDrOYVr7vbfxwRQatfK00eIaLr07bFnUYfPSHn131Ao

To claim this, I am signing this object:

hrvoj3e /
Created Oct 10, 2019 — forked from Ariel-Rodriguez/
semver compare tool in bash
# semantic version comparition using semver specification
# This bash script compares pre-releases alphabetically as well
# returns 1 when A greater than B
# returns 0 when A equals B
# returns -1 when A lower than B
hrvoj3e /
Created Apr 24, 2019
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 install yaz
## Installing '/usr/lib/php/20180731/'
## install ok: channel://
hrvoj3e /
Last active Apr 19, 2019
Install YAZ for PHP 7.2
## PHP 7.2
apt install yaz php7.2-dev php7.2-pear libyaz5-dev
pecl channel-update
pecl install yaz
## Installing '/usr/lib/php/20170718/'
echo '' > /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
# 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