Skip to content

Instantly share code, notes, and snippets.

View gobinathm's full-sized avatar
💻
I may be slow to respond.

Gobinath Mallaiyan gobinathm

💻
I may be slow to respond.
View GitHub Profile
@gobinathm
gobinathm / recipe: cherry-pick tags
Created November 15, 2017 05:38 — forked from nickfloyd/recipe: cherry-pick tags
To cherry pick from head and commit back into a tag
-from master in working branch
>> git branch [new branch] [tag]
>> git checkout [branch]
-pull commit out and add it to the commit at the top of the tag
>> git cherry-pick [commit] or git cherry-pick [firstcommit]^..[lastcommit] if you have a range
-resolve conflicts
-delete the local tag
>> git git tag -d [tag]
-add a new tag at the head of the old one
>> git tag [tag]
@gobinathm
gobinathm / recipe: cherry-pick tags
Created November 15, 2017 05:38 — forked from nickfloyd/recipe: cherry-pick tags
To cherry pick from head and commit back into a tag
-from master in working branch
>> git branch [new branch] [tag]
>> git checkout [branch]
-pull commit out and add it to the commit at the top of the tag
>> git cherry-pick [commit] or git cherry-pick [firstcommit]^..[lastcommit] if you have a range
-resolve conflicts
-delete the local tag
>> git git tag -d [tag]
-add a new tag at the head of the old one
>> git tag [tag]
@gobinathm
gobinathm / Git push deployment in 7 easy steps.md
Created November 14, 2017 06:16 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@gobinathm
gobinathm / Bash_CheatSheet.txt
Created November 13, 2017 21:10 — forked from sripadapavan/Bash_CheatSheet.txt
One Stop for - Bash hacks!!!
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#####################################################
# 0. Shortcuts.
CTRL+A # move to beginning of line
@gobinathm
gobinathm / bash-cheatsheet.sh
Created November 13, 2017 20:09 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@gobinathm
gobinathm / Documentation.md
Created November 12, 2017 03:37 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@gobinathm
gobinathm / install.sh
Created November 7, 2017 17:32 — forked from aschiwi/install.sh
Example install.sh
################################################################################
# Shell and drush commands to set up (or some part of it) the new site.
#
# Go to sites/all/scripts (e.g. cd sites/all/scripts) and type "sh install.sh"
# in your console/shell/Terminal.
#
# The commands are built to run once, e.g. to set some symlinks, but shall be
# designed to not break other commands on the second run.
#
################################################################################
@gobinathm
gobinathm / .php_cs
Created July 7, 2017 05:18
Sample PHP CS Fixer Config for Symfony 2 Project
<?php
$header = <<<'EOF'
Sample PHP CS Fixer Config for Symfony 2 Project.
(c) Gobinath Mallaiyan <i@gobinath.com>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
Ref : https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/README.rst
EOF;
@gobinathm
gobinathm / gist:21f940eb79a8458fa5557652ec3a9fa7
Created June 13, 2017 01:16 — forked from djangofan/gist:3113588
Cron job script to give a disk space usage alert email
#!/bin/sh
# this script was initially written for Redhat/CentOS
# file is /etc/cron.daily/diskAlert.cron
# requires enabling outgoing sendmail from localhost to a valid
# smtp server, which is usually disabled by default
ADMIN="jausten@adomain.com,another@adomain.com"
THRESHOLD=90
df -PkH | grep -vE '^Filesystem|tmpfs|cdrom|media' | awk '{ print $5 " " $6 }' | while read output;
do