Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / sublime.sublime-project
Created January 30, 2021 23:00
Sublime Project Setting
{
"folders": [
{
"path": ".",
"folder_exclude_patterns": [
"x64",
"x86",
".nuget",
"packages",
"TestResults",
@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 / starting-script-jupyter.py
Last active February 2, 2024 16:41
Python: starting script for Jupyter
# -*- coding: utf-8 -*-
"""
Summary:
"""
from IPython.display import display, HTML
import inspect
import logging
import os
@apzentral
apzentral / bash-remove-old-kernels.sh
Created July 11, 2018 15:54
Bash one-liner to delete only old kernels
dpkg -l linux-{image,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(uname -r | cut -d- -f-2) | xargs sudo apt-get -y purge
@apzentral
apzentral / .bash_aliases
Last active February 2, 2024 16:33
aliases file
###################################
# Utilities
###################################
alias b="brew"
alias c="clear && reset"
alias re="reset"
alias e="exit"
alias s="sudo su"
alias m="make"
alias n="node"
@apzentral
apzentral / ant-sshexec-build.xml
Last active April 11, 2023 18:00
ANT: sshexec template
<!-- Build Script for ANT -->
<project basedir="." default="" name="Build Script">
<property name="username" value="username"/>
<property name="passwd" value="passwd"/>
<property name="keyfile-path" value="/path-to-private-key"/>
<property name="applicationFolder" value="/var/www/html/"/>
<property name="sandboxRoot" value="${basedir}"/>
@apzentral
apzentral / starting-script.py
Last active March 4, 2024 15:45
Python: starting script
# -*- coding: utf-8 -*-
"""
Summary:
"""
import inspect
import logging
import os
import pathlib