Skip to content

Instantly share code, notes, and snippets.

View majidalavizadeh's full-sized avatar

Majid Alavizadeh majidalavizadeh

View GitHub Profile
#! /bin/bash
TIMESTAMP=$(date +"%F")
BACKUP_DIR="/backup/$TIMESTAMP"
MYSQL_USER="backup"
MYSQL=/usr/bin/mysql
MYSQL_PASSWORD="password"
MYSQLDUMP=/usr/bin/mysqldump
mkdir -p "$BACKUP_DIR/mysql"
@majidalavizadeh
majidalavizadeh / fw.stop
Last active September 20, 2019 12:17
Flush and remove all iptables rules
#!/bin/sh
echo "Stopping firewall and allowing everyone..."
ipt="/sbin/iptables"
## Failsafe - die if /sbin/iptables not found
[ ! -x "$ipt" ] && { echo "$0: \"${ipt}\" command not found."; exit 1; }
$ipt -P INPUT ACCEPT
$ipt -P FORWARD ACCEPT
$ipt -P OUTPUT ACCEPT
$ipt -F
$ipt -X
@majidalavizadeh
majidalavizadeh / git-change-commit-messages.md
Created February 5, 2019 15:31 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@majidalavizadeh
majidalavizadeh / Tabler_on_Laravel.md
Last active May 31, 2024 10:05
Use Tabler on laravel

This is a simple instruction to use Tabler in your next Laravel project.

(Tabler is a beautiful dashboard: https://tabler.io/)

How to install:

  1. first of all run content of gistfile1.txt in your Laravel project.
  2. Copy tabler.js to recourses/js.
  3. Copy tabler.scss to resources/sass.
  4. Replace webpack.mix.js with your current webpack.mix.js