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
@cijagani
cijagani / gpg_git_signing.md
Created September 22, 2022 05:11 — forked from alopresto/gpg_git_signing.md
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)
@cijagani
cijagani / .gitconfig
Created August 16, 2020 12:47 — forked from sarthaksavvy/.gitconfig
Git configuration
[alias]
acm = "!f() { git add . && git commit -m \"$(echo $@)\"; }; f";
com = checkout master
cob = checkout -b
b = branch
p = push
pl = pull
s = status
@cijagani
cijagani / .phpcsfixer
Created August 16, 2020 12:46 — forked from sarthaksavvy/.phpcsfixer
PHP CS Fixer
<?php
return PhpCsFixer\Config::create()
->setRules(array(
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => array('syntax' => 'short'),
'combine_consecutive_unsets' => true,
'method_separation' => true,
'no_multiline_whitespace_before_semicolons' => true,
@cijagani
cijagani / Zsh
Created August 16, 2020 12:46 — forked from sarthaksavvy/Zsh
Terminal Alias
export DEFAULT_USER="$(whoami)"
export PATH=~/.composer/vendor/bin:$PATH
# Alias for composer
alias cr=composer
alias cri="composer install"
alias crd="composer dump-autoload"
alias cru="composer update"
# Alias for artisan commands
@cijagani
cijagani / deploy.php
Last active January 15, 2021 13:19 — forked from riodw/deploy.php
Deploy to Production Server with git using PHP
<?php
function isEnabled($func) {
return is_callable($func) && false === stripos(ini_get('disable_functions'), $func);
}
if (!isEnabled('shell_exec')) {
echo "shell_exec is disabled";
exit();
}
/**
* GIT DEPLOYMENT SCRIPT
@cijagani
cijagani / HostNameRouter.php
Created July 2, 2020 11:22 — forked from chill117/HostNameRouter.php
Manage multiple hostnames (domains, sub-domains) within a single instance of CodeIgniter.
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
Manage multiple hostnames (domains, sub-domains) within a single instance of CodeIgniter.
Example:
If you had the following domain/sub-domain style for your site:
your-domain.com
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)
@cijagani
cijagani / ajax-form.js
Created April 4, 2019 13:44 — forked from havvg/ajax-form.js
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@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
@cijagani
cijagani / ubuntu-configure-sendmail-with-gmail
Created April 23, 2018 02:27 — forked from sshtmc/ubuntu-configure-sendmail-with-gmail
Ubuntu sendmail using smtp.gmail.com
#!/bin/bash
HOST=$(hostname)
function install_postfix() {
echo | sudo debconf-set-selections <<__EOF
postfix postfix/root_address string
postfix postfix/rfc1035_violation boolean false
postfix postfix/mydomain_warning boolean
postfix postfix/mynetworks string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128