Skip to content

Instantly share code, notes, and snippets.

@imanifaiz
imanifaiz / massInsertOrUpdate.php
Created April 12, 2024 16:54 — forked from RuGa/massInsertOrUpdate.php
Mass (bulk) insert or update on duplicate for Laravel 4/5
/**
* Mass (bulk) insert or update on duplicate for Laravel 4/5
*
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
*
*
* @param array $rows
@imanifaiz
imanifaiz / cashier.php
Created January 17, 2024 03:01 — forked from Braunson/cashier.php
Extending the Laravel package Cashier for creating an customer without a credit card
namespace Acme\V1\Billing;
// BillableInterface.php
use Laravel\Cashier\BillableInterface as CashierInterface;
interface BillableInterface extends CashierInterface {
}
@imanifaiz
imanifaiz / nginx.conf
Created February 10, 2023 12:06 — forked from v0lkan/nginx.conf
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@imanifaiz
imanifaiz / mysql-sail.md
Created January 21, 2022 12:44 — forked from jjcodes78/mysql-sail.md
Laravel Sail - GRANT ALL PRIVILEGES to sail user

Run this command in sail project folder:

docker-compose exec mysql bash

execute the mysql -u root -p command

provide the default password password

then executes

@imanifaiz
imanifaiz / mysql-db-dump-backup.sh
Created April 18, 2021 00:12 — forked from yashodhank/mysql-db-dump-backup.sh
Shell Script to take mysql database dump backup and upload to FTP or send it as email
#!/bin/sh
# This script will backup one or more mySQL databases
# and then optionally email them and/or FTP them
# This script will create a different backup file for each database by day of the week
# i.e. 1-dbname1.sql.gz for database=dbname1 on Monday (day=1)
# This is a trick so that you never have more than 7 days worth of backups on your FTP server.
# as the weeks rotate, the files from the same day of the prev week are overwritten.
@imanifaiz
imanifaiz / Bash MySQL backupo script
Created March 16, 2021 00:45 — forked from walterheck/Bash MySQL backupo script
Backup script for MySQL backups locally, both mysqldumps and binary backupos using percona's xtrabackup
#!/bin/bash
# Configuration
. /etc/mysql/mysql_backup.conf
# Dump the mysql databases to a daily dump file.
function log()
{
logger -i -p daemon.info -t mysqldump "$1"
echo $1 >> $LOGFILE
@imanifaiz
imanifaiz / oracle-instant-client.sh
Created February 22, 2021 03:30 — forked from cbj4074/oracle-instant-client.sh
Shell script to install Oracle OCI8 extension for PHP on Ubuntu
#!/bin/sh
echo 'Installing Oracle Instant Client...'
export DEBIAN_FRONTEND=noninteractive
apt-get -yq install libaio1 unzip php-dev
# See: http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html#ic_x64_inst
client_version='12_2'
System overview
Staff, roles & responsibilities
Environments
Applications
Software Licenses
Version control
Process Flows
Documentation
Support & Maintenance
Issue Submission & Resolution
@imanifaiz
imanifaiz / [1] main.js
Created April 4, 2018 09:46 — forked from hfalucas/[1] main.js
[Vue.js] Authentication and Authorization
/**
* Think of this "main.js" file as your application bootstrap.
*/
import Vue from 'vue'
import Resource from 'vue-resource'
import VueRouter from 'vue-router'
import routes from './routes'
import middleware from './middleware'
@imanifaiz
imanifaiz / zip.php
Last active August 27, 2015 12:53 — forked from jonmaim/zip.php
PHP script to remotely create zip archives of your FTP
<?php
/*
*
* This script will backup your web site by remotely archiving all files on the root FTP directory.
* It will work even if your web server is memory limited buy splitting zips in several arhive files it they are too many files.
* All zip files will be stored in a directory called temporary which must be writable.
*
* How to use it:
* - Place the script at the root of your FTP.