Skip to content

Instantly share code, notes, and snippets.

@apzentral
apzentral / check-process.sh
Created July 6, 2019 22:17
Bash: Script to Monitor Process. If not running will start it.
#!/bin/bash
####################
#
# Script: Checking process and if it is not running will start that process
#
####################
#*** CONFIG ***
@apzentral
apzentral / sublime.sublime-project
Created January 30, 2021 23:00
Sublime Project Setting
{
"folders": [
{
"path": ".",
"folder_exclude_patterns": [
"x64",
"x86",
".nuget",
"packages",
"TestResults",
@apzentral
apzentral / php.json
Created March 2, 2021 20:16
VS Code: PHP Code Snippets
{
// Place your snippets for php here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@apzentral
apzentral / Makefile
Last active February 4, 2022 23:12
Makefile for docker-compose
## docker-compose : Makefile
ENV_FILE_PATH = ./docker/.env
DOCKER_COMPOSE_FILE_PATH = ./docker/docker-compose.yml
start:
docker-compose --env-file $(ENV_FILE_PATH) -f $(DOCKER_COMPOSE_FILE_PATH) build && docker-compose --env-file $(ENV_FILE_PATH) -f $(DOCKER_COMPOSE_FILE_PATH) up -d
logs:
docker-compose --env-file $(ENV_FILE_PATH) -f $(DOCKER_COMPOSE_FILE_PATH) logs -f --tail 20
@apzentral
apzentral / docker-compose.yml
Last active April 1, 2021 00:34
Example: docker-compose.yml file
version: "3.8"
services:
demo-service:
build:
context: .
dockerfile: Dockerfile
restart: "no"
image: demo-image:2.4
@apzentral
apzentral / dk-remove-all.sh
Created March 17, 2021 04:52
Remove all docker containers
#!/usr/bin/env bash
echo "Stoppping and removing all container(s)"
docker container stop $(docker container ls -aq) && docker container rm $(docker container ls -aq)
@apzentral
apzentral / dk-stop-all.sh
Created March 17, 2021 04:53
Stop all docker containers
#!/usr/bin/env bash
echo "Stoppping all container(s)"
docker container stop $(docker container ls -aq)
@apzentral
apzentral / .tmux.conf
Last active September 29, 2023 19:18
TMUX basic config using A instead of B
# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
bind C-a send-prefix
unbind C-b
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
@apzentral
apzentral / dk-network-all.sh
Created April 26, 2021 22:56
Docker check all subnet
# Need to install jq
docker network inspect $(docker network ls | awk '$3 == "bridge" { print $1}') | jq -r '.[] | .Name + " " + .IPAM.Config[0].Subnet' -
@apzentral
apzentral / .vimrc
Last active December 8, 2022 21:22
This is a basic vimrc file
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)