Skip to content

Instantly share code, notes, and snippets.

View cijagani's full-sized avatar
🏤
new office :)

chirag jagani cijagani

🏤
new office :)
View GitHub Profile
@toddsby
toddsby / backup.php
Last active December 30, 2021 06:01 — forked from menzerath/backup.php
backup.php
<?php
/*
* PHP: Recursively Backup Files & Folders to ZIP-File
* (c) 2012-2014: Marvin Menzerath - http://menzerath.eu
* contribution: Drew Toddsby
*/
// Make sure the script can handle large folders/files
ini_set('max_execution_time', 600);
ini_set('memory_limit','1024M');
@nunorbatista
nunorbatista / centos_php7_fresh.sh
Last active November 14, 2019 17:43
PHP7 Centos 7 fresh install script
#/!/bin/bash
# update system
yum update -y
# install bind-utils
sudo yum install bind-utils
# Apache
yum install nano wget curl vim git httpd -y
@alopresto
alopresto / gpg_git_signing.md
Last active January 18, 2024 22:42
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@natanfelles
natanfelles / db_helper.php
Last active August 18, 2023 03:15
CodeIgniter Database Helper to Add and Drop Foreign Keys and Triggers
<?php
/**
* @author Natan Felles <natanfelles@gmail.com>
*/
defined('BASEPATH') OR exit('No direct script access allowed');
if ( ! function_exists('add_foreign_key'))
{
/**
* @param string $table Table name
@riodw
riodw / deploy.php
Last active May 8, 2023 08:54
Deploy to Production Server with git using PHP
<?php
/**
* GIT DEPLOYMENT SCRIPT
*
*/
// The commands
$commands = array(
'echo $PWD',
'whoami',
'git reset --hard HEAD',
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 18, 2024 21:47
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@Greegko
Greegko / nginx_global_domains.config
Created May 23, 2017 22:03
nginx setup for dynamic domains and their subdomains
# Source: https://stackoverflow.com/questions/8199231/how-to-setup-mass-dynamic-virtual-hosts-in-nginx
server {
listen 80 default_server;
listen [::]:80 default_server;
# Match any server name with the format [subdomain.[.subdomain...]].domain.tld.dev
server_name ~^(?<subdomain>([\w-]+\.)*)?(?<domain>[\w-]+\.[\w-]+)\.dev$;
# Map by default to (projects_root_path)/(domain.tld)/www;
Install PHP 7.1
sudo update-alternatives --set php /usr/bin/php7.0
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.1
php -v
PHP 7.1 Modules list (Example)
@GhazanfarMir
GhazanfarMir / Instructions.sh
Last active May 14, 2024 03:26
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@cijagani
cijagani / Instructions.sh
Created April 24, 2018 05:06 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa