We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder
python -m venv ./venv
version: "2" | |
services: | |
drupal: | |
build: | |
context: . | |
dockerfile: drupal.Dockerfile | |
image: custom-drupal | |
ports: | |
- 8080:80 |
<?php | |
/* | |
Rule-based pattern + Open/close principle. | |
Good for nested if-else statements especially on automation. | |
https://stackoverflow.com/questions/16849656/design-pattern-to-implement-business-rules-with-hundreds-of-if-else-in-java | |
*/ | |
// Do not modify. Just extend or convert to a plugin. | |
interface SatisfiableContract | |
{ |
We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder
python -m venv ./venv
In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc
Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server
Use this link and get $10 free. Just select the $5 plan unless this a production app.
#!/usr/bin/php-zts | |
<?php | |
# By: https://github.com/zheltikov | |
# Used in: https://www.youtube.com/watch?v=L_FdpmJatdw | |
# Define a custom Thread class | |
class MyThread extends Thread { | |
private $name = ""; | |
private $duration = 0; |
#!/bin/bash | |
# By: https://github.com/zheltikov | |
# Based on: http://blog.programster.org/ubuntu16-04-compile-php-7-2-with-pthreads | |
# Used in: https://www.youtube.com/watch?v=L_FdpmJatdw | |
# Download the necessary packages | |
sudo apt update | |
sudo apt install libzip-dev bison autoconf build-essential pkg-config git-core libltdl-dev libbz2-dev libxml2-dev libxslt1-dev libssl-dev libicu-dev libpspell-dev libenchant-dev libmcrypt-dev libpng-dev libjpeg8-dev libfreetype6-dev libmysqlclient-dev libreadline-dev libcurl4-openssl-dev |
Ref: | |
https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes | |
Remove all: | |
docker system prune -a | |
Images: | |
Remove all: | |
docker rmi $(docker images -a -q) |
#Main proj. | |
#Add a submodule. | |
git submodule add https://proj.git | |
#Go to submodule's dir and change to specific branch. | |
cd submodule_dir | |
git checkout -b branch origin/branch | |
#Go back to proj root and push to repo along with the new submodule's new branch. | |
git add . -u | |
git commit ... | |
git push |
<?php namespace App\Services\Enums; | |
final class LogType | |
{ | |
const | |
//Total failures. Major systems are unavailable. | |
EMERGENCY_UNUSABLE_SYSTEMS = 'emergency', | |
//Usable hardwares with unusal outputs such as website down, unavailable DBs. | |
ALERT_CORRUPTED_SYSTEMS = 'alert', |
#!/bin/bash | |
#sudo ln -s /full-path/git-log-live /usr/local/bin/git-log-live | |
#sudo chmod +x git-log-live | |
#git-log-live /absolute-proj-root-path | |
#git-log-live . | |
while : | |
do | |
clear |