Skip to content

Instantly share code, notes, and snippets.

@apzentral
apzentral / java-installer.sh
Created July 18, 2022 02:46
Install java script
#!/usr/bin/env bash
JAVA_VERSION=jdk1.8.0_05
JAVA_FILE_NAME="jdk-8u5-linux-i586.tar.gz"
sudo tar xvzf "${JAVA_FILE_NAME}" -C /usr/java
JAVA_HOME="/usr/java/${JAVA_VERSION}/"
sudo update-alternatives --install /usr/bin/java java ${JAVA_HOME%*/}/bin/java 20000
sudo update-alternatives --install /usr/bin/javac javac ${JAVA_HOME%*/}/bin/javac 20000
@apzentral
apzentral / vim-installer.sh
Created July 18, 2022 01:50
Install vim script
#!/usr/bin/env bash
git clone https://github.com/vim/vim.git
cd vim
git pull
cd src
make distclean # if you build Vim before
make
sudo make install
@apzentral
apzentral / tmux-installer.sh
Last active July 18, 2022 01:48
Install tmux script
#!/usr/bin/env bash
TMUX_VERSION=3.3
sudo apt-get update
sudo apt-get install -y libevent-dev libncurses-dev make
wget "https://github.com/tmux/tmux/releases/download/${TMUX_VERSION}/tmux-${TMUX_VERSION}.tar.gz"
tar xvzf "tmux-${TMUX_VERSION}.tar.gz"
cd "tmux-${TMUX_VERSION}/"
./configure && make
sudo make install
@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 / 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 / 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 / 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-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 / 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 / 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');",