Skip to content

Instantly share code, notes, and snippets.

Avatar

Vigo2 LostinOrchid

  • Go2DesignLab
View GitHub Profile
@LostinOrchid
LostinOrchid / machine-user-as-owner.md
Last active Jul 13, 2020
Laravel File Permissions
View machine-user-as-owner.md

Assuming www-data is the webserver user.

It's not needed but for the sake of shortening commands we will set the LARAVEL_ROOT env variable to the root of our laravel app.

LARAVEL_ROOT=/path/to/your/laravel/root/directory

Change the ownership of our project folder.

@LostinOrchid
LostinOrchid / update_wp_plugin
Last active Jun 1, 2020
Update Wordpress Plugin using Local zip file
View update_wp_plugin
#!/usr/bin/env bash
script_filename=$0
plugin_name=$1
version=$2
plugins_dir=~/plugins
old_plugins_dir=~/old-plugins
script_name="Wordress Plugin Updater"
script_description="Updates a wordpress plugin given the local plugin directory path."
plugin_filename=
@LostinOrchid
LostinOrchid / wp_db_create_backup.sh
Created Jul 6, 2018
Create database backup in Wordpress
View wp_db_create_backup.sh
#!/usr/bin/env bash
sqllocation=~/.sql_backup_files
# echo $(wp --version)
wp --version >/dev/null 2>&1 || {
echo "I need 'wp' command to be able to execute further"
exit 1
}
# Check if it is a wordpress directory or is installed
@LostinOrchid
LostinOrchid / encoding-video.md
Created Apr 8, 2019 — forked from Vestride/encoding-video.md
Encoding video for the web
View encoding-video.md

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@LostinOrchid
LostinOrchid / object_assign_mutation.js
Last active Sep 20, 2018
Warning on object assign mutation
View object_assign_mutation.js
var a = {
one: {
nested: 'a',
onlyInA: 'a',
nestedMore: { what: 'a' },
},
aOnly: 'a only',
}, b = {
one: {
nested: 'b',
@LostinOrchid
LostinOrchid / install_php71.sh
Last active Aug 3, 2018
Vagrant Debian/Ubuntu OS
View install_php71.sh
#!/usr/bin/env sh
# Install php71
apt-get install -y python-software-properties
add-apt-repository -y ppa:ondrej/php
apt-get update -y
apt-get install -y php7.1 php7.1-fpm php7.1-cli php7.1-common php7.1-mbstring php7.1-gd php7.1-intl php7.1-xml php7.1-mysql php7.1-mcrypt php7.1-zip
# Tell apache to use php71
a2enmod proxy_fcgi setenvif
a2enconf php7.1-fpm
@LostinOrchid
LostinOrchid / wp_make_site_backup.sh
Created Jul 19, 2018
Make backup for a wordpress site
View wp_make_site_backup.sh
#!/usr/bin/env sh
project_root=$1
tmp_dir=$project_root/.tmp
files_dir=$tmp_dir/files
include_db=1
files=(
wp-config.php
wp-content/themes/zeko
wp-content/themes/zeko-child
@LostinOrchid
LostinOrchid / post-receive.sh
Last active Jul 4, 2018
Example deployment script for roots bedrock
View post-receive.sh
#!/bin/bash
# The document root of the project
APP_ROOT=
# The directory of the remote repository
GIT_DIR=
# What branch to accept
BRANCH="master"
composer=~/bin/composer
wp=~/bin/wp
@LostinOrchid
LostinOrchid / 01install_lamp.md
Last active Jun 26, 2018
install LAMP stack in Amazon AMI
View 01install_lamp.md
  1. Update packages
$ sudo yum update -y
  1. Install Apache, mysql and php.
$ sudo yum update http24 php70 mysql56-server php70-mysqlnd -y
  1. Start the Apache Web Server.
View aws_eb_create_app.md