This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# version 1.2 | |
### changelog: first ask whether it's a laravel project or not. | |
# to be able to work this function globally, copy or create link in /usr/local/bin with execute permission (chmod +x) | |
## Process | |
# 1. cp .env.example .env | |
# 2. composer install | |
# 3. php artisan key:generate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# set up automatic deployment with git to VPS | |
# format :::: ./deploy-to-server.sh <project-name> | |
project=$1 | |
server_www_dir=/var/www/html/$project | |
server_repo=/srv/git/$project.git | |
# create server_repo if not exists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# colors | |
GREEN='\033[0;32m' | |
NC='\033[0m' # No Color | |
# dbDump functions | |
dbDump() { | |
# backup location | |
LOCATION=~/dumps/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Call this file with `bash ./project-create.sh project-name [service-name]` | |
# - project-name is mandatory | |
# - service-name is optional | |
# This will creates 4 directories and a git `post-receive` hook. | |
# The 4 directories are: | |
# - $GIT: a git repo | |
# - $TMP: a temporary directory for deployment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# colors | |
YELLOW='\e[43m' | |
LRED='\e[101m' | |
NC='\033[0m' # No Color | |
getOSArchitecture() { | |
arch=$(awk -F= '/^ID_LIKE/{print $2}' /etc/os-release) | |
if [ "$arch" = "debian" ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#format | |
# drop-db.sh '`test-1234`' | |
mysql -u root -p <<MYSQL_SCRIPT | |
DROP DATABASE $1; | |
MYSQL_SCRIPT | |
echo Mysql Database $1 dropped |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# synclient | |
# Disable touchpad while typing | |
synclient PalmDetect=1 | |
synclient PalmMinWidth=8 | |
synclient PalmMinZ=100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# to be able to work this function globally, copy or create link in /usr/local/bin | |
# Change ownership for .env | |
sudo chown $USER:$USER .env | |
# Give write Permission to /bootstrap/cache & /storage | |
sudo chown -R $USER:www-data storage bootstrap/cache | |
sudo chmod -R ug+rwx storage bootstrap/cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#format | |
# create-db.sh '`test-1234`' | |
mysql -u root -p <<MYSQL_SCRIPT | |
CREATE DATABASE $1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
MYSQL_SCRIPT | |
echo Mysql Database $1 created |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# to be able to work this function globally, copy or create link in /usr/local/bin | |
# remove domain if found | |
sudo sed -i '/'$1'/d' /etc/hosts | |
# remove sites-available & sites-enabled if found | |
file=$1 |