Skip to content

Instantly share code, notes, and snippets.

View AshishDhamalaAD's full-sized avatar

Ashish Dhamala AshishDhamalaAD

View GitHub Profile
@AshishDhamalaAD
AshishDhamalaAD / Merge specific files from one branch to another.md
Last active December 3, 2020 17:07
How to pick specific files from one branch and add it to another branch

Let's say there are two branches: master and feature-one.

There are some files that you want in the master branch from the feature-one branch but not all the files. Let's say those files are:

app/Models/User.php
app/Controllers/UsersController.php

You can accomplish that by doing the following:

@AshishDhamalaAD
AshishDhamalaAD / database_backup.sh
Created August 3, 2020 17:30
Script to backup database and automatically delete after certain days
#!/bin/bash
export PATH=/bin:/usr/bin:/usr/local/bin
TODAY=`date +"%Y_%m_%d__%H_%M_%S"`
DB_BACKUP_PATH='/your/database/backup/folder'
MYSQL_HOST='localhost'
MYSQL_PORT='3306'
MYSQL_USER='db_user_name'
MYSQL_PASSWORD='db_user_password'

Git post-receive for laravel project deployment

#!/bin/sh
echo -e "\e[92m Cd into project directory \e[97m"
cd /path/to/project/

echo -e "\e[92m composer install \e[97m"
/usr/local/bin/php /usr/local/bin/composer/composer.phar install --no-dev

To flush all jobs in redis or queues

Open redis cli and run flushdb command

Run redis server

~/redis-5.0.4/src/redis-server