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 / shallow_update_git.md
Created March 6, 2017 18:24
Fix for Remote rejected shallow update not allowed after changing Git remote URL

Some Time there is a shallow update not allowed issue in your cloned GIT repo.

This means that you have to unshallow your repository. To do so you will need to add your old remote again.

git remote add origin <path-to-old-remote> After that we use git fetch to fetch the remaining history from the old remote (as suggested in this answer).

git fetch --unshallow origin And now you should be able to push into your new remote repository.

@gobinathm
gobinathm / mysql_password_retrival.md
Created March 9, 2017 00:48
Retrive Lost MySql Root Password in Mac / Linux
  • Stop MySQL:
sudo /usr/local/mysql/support-files/mysql.server stop
  • Next Step would be to start it in safe mode:
sudo mysqld_safe --skip-grant-tables

Keybase proof

I hereby claim:

  • I am gobinathm on github.
  • I am gobinathm (https://keybase.io/gobinathm) on keybase.
  • I have a public key ASCHO0X_kXqcI0TOyjmGZy-HrHwDi3yINENYEze3HFLHPQo

To claim this, I am signing this object:

@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
@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 / 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 / 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
#!/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 / 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
@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