Skip to content

Instantly share code, notes, and snippets.

View bronhy's full-sized avatar

Marko Antolović bronhy

View GitHub Profile
@bronhy
bronhy / docker-compose.yaml
Last active March 28, 2023 15:57
docker compose with apache php mysql phpmyadmin
# This setup avoids dockerfile and is used for quick starts and testing. Do not use in production
# Command in the web service is used for installing mysqli and pdo_mysql extensions. Extension mysqlnd is already present
version: "3.8"
services:
web:
image: php:apache # latest php:apache image
ports:
- "80:80"
command: >
bash -c "docker-php-ext-install mysqli pdo_mysql
@bronhy
bronhy / accounts.conf
Last active December 5, 2024 20:31
NATS Cluster with Leaf Node
# accounts.conf
accounts {
SYS: {
users: [{user: admin, password: admin}]
},
ACC: {
users: [{user: acc, password: acc}],
jetstream: enabled
}
}
@bronhy
bronhy / GuzzleAsync.php
Last active November 4, 2021 16:45
Guzzle Async
<?php
# You cant use the async without wait or the event loop.
# If you wait then you wait.
# If you want to do stuf while you wait then you need to tick in the event loop
require_once './vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\Handler\CurlMultiHandler;
use GuzzleHttp\HandlerStack;
@bronhy
bronhy / curl.md
Created March 10, 2021 13:02 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@bronhy
bronhy / Dockerfile
Created March 9, 2021 15:57 — forked from sophiaphillipa/Dockerfile
Configuring PHPStorm to work with xDebug and Docker, by listening.
FROM php:7-fpm
RUN apt-get update && \
apt-get install -y \
zlib1g-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev
@bronhy
bronhy / remove.sh
Last active April 14, 2019 16:42
Remove passphrase from private key
openssl rsa -in original.id_rsa -out id_rsa
chmod 400 ~/.ssh/id_rsa
@bronhy
bronhy / convert.sh
Last active September 5, 2019 12:48
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 600 id_rsa.pem
@bronhy
bronhy / docker.sh
Created February 28, 2019 13:08
Docker nslookup
docker run --rm alpine nslookup host.docker.internal
@bronhy
bronhy / 000-default.conf
Last active July 25, 2019 12:14
Generate self signed ssl certificate for apache configuraiton
# Configure virtual host
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/cert.pem
SSLCertificateKeyFile /etc/apache2/ssl/key.pem
</VirtualHost>
@bronhy
bronhy / string.sh
Last active January 21, 2019 23:00
Split a string on a delimiter in bash
#!/bin/bash
string="test1;test2;test3"
IFS=';' read -a ADDR <<< "$string"
for i in "${ADDR[@]}"; do
echo "$i"
done