Skip to content

Instantly share code, notes, and snippets.

View kaznovac's full-sized avatar
🕷️
digital insecticide service

Marko Kaznovac kaznovac

🕷️
digital insecticide service
View GitHub Profile
@kaznovac
kaznovac / bash-zsh-statup-scripts.md
Created January 21, 2019 21:35
order of bash/zsh startup scripts execution

bash

For Bash, startup scripts work as follows. Read down the appropriate column. Executes A, then B, then C, etc. The B1, B2, B3 means it executes only the first of those files found.

Interactive login Interactive non-login Script
#!/bin/bash
daemonize () { "$@"& pid="$!"; trap "kill -INT $pid" INT TERM; while kill -0 $pid > /dev/null 2>&1; do wait $pid; ec="$?"; done; exit $ec;};
@kaznovac
kaznovac / ext-xdebug.ini
Created June 27, 2020 16:30
php xdebug 2.x configuration
[xdebug]
zend_extension="xdebug.so"
xdebug.coverage_enable=1
xdebug.default_enable=1
xdebug.extended_info=1
xdebug.file_link_format="phpstorm://open?file=%f&line=%l"
xdebug.max_nesting_level=256
xdebug.scream=0
@kaznovac
kaznovac / traefik_portainer.md
Created January 24, 2022 10:25 — forked from ruanbekker/traefik_portainer.md
Traefik with SSL + Portainer on Docker Swarm Repro

Traefik and Portainer on Docker Swarm with Letsencrypt

Reproducing a Traefik with SSL and Portainer setup on a 2 Node Docker Swarm

Install Docker:

Install Docker on both nodes with a Bootstrap Script:

$ curl https://gitlab.com/rbekker87/scripts/raw/master/setup-docker-ubuntu.sh | bash
@kaznovac
kaznovac / jwt-apn-2.sh
Last active July 28, 2022 20:58
apple push notification jwt token signing from terminal
#!/usr/bin/env bash
# https://developer.apple.com/documentation/usernotifications/sending_push_notifications_using_command-line_tools#3694579
TEAM_ID=Team ID
TOKEN_KEY_FILE_NAME=path to the private key file
AUTH_KEY_ID=your key identifier
TOPIC=App ID
DEVICE_TOKEN=device token for your app
APNS_HOST_NAME=api.sandbox.push.apple.com
@kaznovac
kaznovac / doctrine.php
Created December 2, 2022 09:10
Symfony Doctrine Bundle PHP configuration
<?php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
use Symfony\Config\DoctrineConfig;
use Symfony\Config\FrameworkConfig;
return static function (DoctrineConfig $doctrine, ContainerConfigurator $container, FrameworkConfig $framework): void {
$dbal = $doctrine->dbal();
$dbal->defaultConnection('default');
<?php
declare(strict_types=1);
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\Constraint\Constraint;
use function array_column;
use function count;