Skip to content

Instantly share code, notes, and snippets.

View fmtarif's full-sized avatar

Faisal Muhammad fmtarif

View GitHub Profile
@fmtarif
fmtarif / dump.sh
Created October 22, 2017 08:26 — forked from andsens/dump.sh
#cli #mysql Backup all MySQL databases into separate files
#!/bin/sh
## backup each mysql db into a different file, rather than one big file
## as with --all-databases. This will make restores easier.
## To backup a single database simply add the db name as a parameter (or multiple dbs)
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is
## Create the user and directories
# mkdir -p /var/backups/mysql/databases
# useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup
## Remember to make the script executable, and unreadable by others
@fmtarif
fmtarif / gist:9bb5b5bfdc3c19e246cb73e6f0a13d7f
Last active November 16, 2017 06:36 — forked from dopa/gist:5245868
#cli #mysql Shell Script to Back Up all MySQL Databases, Keep 7 Days of Backups
#!/bin/bash
# Script will output dumps for all databases using seperate files
# Derived from this post: http://www.cyberciti.biz/faq/ubuntu-linux-mysql-nas-ftp-backup-script/
USER="user"
PASSWORD="password"
HOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
OUTPUT_DIR="/backups/files"
@fmtarif
fmtarif / mysql-cheat-sheet.md
Created October 23, 2017 15:13
#mysql MySql Cheat Sheet
@fmtarif
fmtarif / README.md
Last active October 23, 2017 15:14 — forked from hofmannsven/README.md
#mysql #cli MySQL Command Line Cheatsheet
@fmtarif
fmtarif / install-choco-script.bat
Last active May 14, 2019 07:37 — forked from zaccb/install-choco-script.bat
#cli #windows Chocolatey install script (PowerShell) - Install software and web development dependencies automatically in Windows through a script
:: Open Windows PowerShell in Administrative mode and run this file, i.e., ./install-choco-script.bat
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
:: Install Applications
choco install vcredist2010 -fy
choco install flashplayerplugin -fy
choco install k-litecodecpackfull -fy
choco install ffmpeg -fy
choco install jre8 -fy
choco install javaruntime -fy
@fmtarif
fmtarif / angularjs-providers-explained.md
Last active February 28, 2018 10:42 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider

call order: jsfiddle link

Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes
@fmtarif
fmtarif / angular-error-handling.js
Created April 16, 2018 12:56 — forked from abyx/angular-error-handling.js
AngularJS HTTP Error Handling Mechanism
var HEADER_NAME = 'MyApp-Handle-Errors-Generically';
var specificallyHandleInProgress = false;
angular.module('myApp').factory('RequestsErrorHandler', ['$q', function($q) {
return {
// --- The user's API for claiming responsiblity for requests ---
specificallyHandled: function(specificallyHandledBlock) {
specificallyHandleInProgress = true;
try {
return specificallyHandledBlock();
@fmtarif
fmtarif / webdev_online_resources.md
Created January 29, 2019 16:18 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@fmtarif
fmtarif / bitbucket-webhook.php
Created February 14, 2019 14:25 — forked from maztch/bitbucket-webhook.php
A simple php script for deploy using bitbucket webhook
<?php
//edit with your data
$repo_dir = '~/repository.git';
$web_root_dir = '~/project';
$post_script = '~/project/scripts/post_deploy.sh';
$onbranch = 'master';
// A simple php script for deploy using bitbucket webhook
// Remember to use the correct user:group permisions and ssh keys for apache user!!
// Dirs used here must exists on server and have owner permisions to www-data
@fmtarif
fmtarif / mysql_replication_autostart.sh
Created February 24, 2019 11:07 — forked from nicomak/mysql_replication_autostart.sh
This script automates the process of starting a Mysql Replication on 1 master node and N slave nodes. More details on how it works at http://blog.ditullio.fr/2016/04/30/initialize-mysql-master-slave-replication-script/
#!/bin/bash
#title : replication-start.sh
#description : This script automates the process of starting a Mysql Replication on 1 master node and N slave nodes.
#author : Nicolas Di Tullio
#date : 20160706
#version : 0.2
#usage : bash mysql_replication_autostart.sh
#bash_version : 4.3.11(1)-release
#=============================================================================